pcClientService.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices.ComTypes;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Media;
  8. namespace school
  9. {
  10. public partial class ClientService
  11. {
  12. public string fullName
  13. {
  14. get
  15. {
  16. string full = Client.LastName + " " + Client.FirstName;
  17. full += (Client.Patronymic != null)? " " + Client.Patronymic : "" ;
  18. return full;
  19. }
  20. }
  21. public string date
  22. {
  23. get => StartTime.ToString("dd MMMM yyyy");
  24. }
  25. public string time
  26. {
  27. get => StartTime.ToString("HH:mm");
  28. }
  29. public string otherTime
  30. {
  31. get
  32. {
  33. string line = "";
  34. int day = (int) (StartTime - DateTime.Now).TotalDays;
  35. int hours = (int)(StartTime - DateTime.Now).TotalHours - day * 24;
  36. int minuts = (int)(StartTime - DateTime.Now).TotalMinutes - day * 24 - hours * 60;
  37. line += (day > 0) ? (day + "д. ") : ("");
  38. line += (hours > 0) ? (hours + "ч. ") : ("");
  39. line += (minuts > 0) ? (minuts + "мин. ") : ("");
  40. return line;
  41. }
  42. }
  43. public SolidColorBrush colorRow
  44. {
  45. get
  46. {
  47. SolidColorBrush brush = new SolidColorBrush(Colors.White);
  48. int day = (int)(StartTime - DateTime.Now).TotalDays;
  49. int hours = (int)(StartTime - DateTime.Now).TotalHours - day * 24;
  50. int minuts = (int)(StartTime - DateTime.Now).TotalMinutes - day * 24 - hours * 60;
  51. if (day == 0 && hours == 0 && minuts < 60) brush = new SolidColorBrush(Colors.Red);
  52. return brush;
  53. }
  54. }
  55. }
  56. }