PartClass.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace modulekz
  7. {
  8. public partial class Book
  9. {
  10. public string CountStore
  11. {
  12. get
  13. {
  14. if (Store > 5)
  15. {
  16. return "Много";
  17. }
  18. else if (Store < 1)
  19. {
  20. return "Нет";
  21. }
  22. else
  23. {
  24. return Store.ToString();
  25. }
  26. }
  27. set { }
  28. }
  29. public string CountStock
  30. {
  31. get
  32. {
  33. if (Stock > 5)
  34. {
  35. return "Много";
  36. }
  37. else if (Stock < 1)
  38. {
  39. return "Нет";
  40. }
  41. else
  42. {
  43. return Stock.ToString();
  44. }
  45. }
  46. set { }
  47. }
  48. public int inc { get; set; } = 0;
  49. public double sale { get; set; }
  50. public string NewPrice
  51. {
  52. get
  53. {
  54. if (sale > 0) return Math.Floor(Convert.ToDouble(Cost) - Convert.ToDouble(Cost) * (sale / 100)).ToString();
  55. else return "";
  56. }
  57. set { }
  58. }
  59. public decimal OldPrice
  60. {
  61. get
  62. { return Convert.ToDecimal(Cost); }
  63. set { }
  64. }
  65. string d;
  66. public string decor
  67. {
  68. get
  69. {
  70. if (sale > 0) return d;
  71. else return "";
  72. }
  73. set { d = "Strikethrough"; }
  74. }
  75. public int allcount
  76. {
  77. get { return Stock + Store; }
  78. set { }
  79. }
  80. }
  81. }