123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.InteropServices.ComTypes;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Media;
- namespace school
- {
- public partial class ClientService
- {
- public string fullName
- {
- get
- {
- string full = Client.LastName + " " + Client.FirstName;
- full += (Client.Patronymic != null)? " " + Client.Patronymic : "" ;
- return full;
- }
- }
- public string date
- {
- get => StartTime.ToString("dd MMMM yyyy");
- }
- public string time
- {
- get => StartTime.ToString("HH:mm");
- }
- public string otherTime
- {
- get
- {
- string line = "";
- int day = (int) (StartTime - DateTime.Now).TotalDays;
- int hours = (int)(StartTime - DateTime.Now).TotalHours - day * 24;
- int minuts = (int)(StartTime - DateTime.Now).TotalMinutes - day * 24 - hours * 60;
- line += (day > 0) ? (day + "д. ") : ("");
- line += (hours > 0) ? (hours + "ч. ") : ("");
- line += (minuts > 0) ? (minuts + "мин. ") : ("");
- return line;
- }
- }
- public SolidColorBrush colorRow
- {
- get
- {
- SolidColorBrush brush = new SolidColorBrush(Colors.White);
- int day = (int)(StartTime - DateTime.Now).TotalDays;
- int hours = (int)(StartTime - DateTime.Now).TotalHours - day * 24;
- int minuts = (int)(StartTime - DateTime.Now).TotalMinutes - day * 24 - hours * 60;
- if (day == 0 && hours == 0 && minuts < 60) brush = new SolidColorBrush(Colors.Red);
- return brush;
- }
- }
- }
- }
|