PartialClassService.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Media;
  7. namespace School
  8. {
  9. public partial class Service
  10. {
  11. public static System.Windows.Visibility Btn_Admin = System.Windows.Visibility.Collapsed;
  12. public static System.Windows.Visibility btn_admin
  13. {
  14. get
  15. {
  16. return Btn_Admin;
  17. }
  18. set
  19. {
  20. Btn_Admin = value;
  21. }
  22. }
  23. public string sale
  24. {
  25. get
  26. {
  27. if (Discount == null)
  28. {
  29. return "";
  30. }
  31. return "* скидка " + Discount * 100 + "%";
  32. }
  33. }
  34. public SolidColorBrush TextBrush
  35. {
  36. get
  37. {
  38. var brushConverter = new BrushConverter();
  39. if (Discount == null)
  40. {
  41. return Brushes.White;
  42. }
  43. else
  44. {
  45. return (SolidColorBrush)(Brush)brushConverter.ConvertFrom("#e7fabf");
  46. }
  47. }
  48. }
  49. public string price
  50. {
  51. get
  52. {
  53. if (Discount != null)
  54. {
  55. double b = (Convert.ToDouble(Cost) / 100) * (100 - (Discount.Value * 100));
  56. int time = DurationInSeconds / 60;
  57. return b + " рублей на " + time + " минут";
  58. }
  59. else
  60. {
  61. double a = Convert.ToDouble(Cost);
  62. int time = DurationInSeconds / 60;
  63. return a + " рублей на " + time + " минут";
  64. }
  65. }
  66. }
  67. public int time
  68. {
  69. get
  70. {
  71. return DurationInSeconds/60;
  72. }
  73. }
  74. public string cost
  75. {
  76. get
  77. {
  78. if (Discount != null)
  79. {
  80. double a = Math.Round(Convert.ToDouble(Cost),1);
  81. return a + " ";
  82. }
  83. return "";
  84. }
  85. }
  86. }
  87. }