PartialBook.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Exam19Apr
  7. {
  8. public partial class Books
  9. {
  10. public string CheckStoreCount
  11. {
  12. get
  13. {
  14. if (StoreCount > 5)
  15. return "Много";
  16. else if (StoreCount == 0)
  17. return "Нет";
  18. else
  19. return StoreCount.ToString();
  20. }
  21. }
  22. public string CheckStockCount
  23. {
  24. get
  25. {
  26. if (StockCount > 5)
  27. return "Много";
  28. else if (StockCount == 0)
  29. return "Нет";
  30. else
  31. return StockCount.ToString();
  32. }
  33. }
  34. public int Sale { get; set; }
  35. public int FullCount { get; set; }
  36. public decimal PriceSale
  37. {
  38. get
  39. {
  40. return Price - Price * (Convert.ToDecimal(Sale) / 100);
  41. }
  42. }
  43. public string VisiblePriceSale
  44. {
  45. get
  46. {
  47. if (Sale == 0)
  48. return "Collapsed";
  49. else
  50. return "Visible";
  51. }
  52. }
  53. public string DecorationPrice
  54. {
  55. get
  56. {
  57. if (Sale > 0)
  58. return "Strikethrough";
  59. else
  60. return "None";
  61. }
  62. }
  63. }
  64. }