ModalViewModel.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. namespace ShwasherSys.Models.Modal
  2. {
  3. public class ModalViewModel1
  4. {
  5. public ModalViewModel1(string header, string modalId = "modal", int footer = 0,string sizeClass="lg", int? width = null)
  6. {
  7. Header = new ModalHeaderViewModel(header);
  8. Footer = footer+"";
  9. ModalId = modalId;
  10. Width = width;
  11. SizeClass = sizeClass;
  12. }
  13. public ModalViewModel1(string header1, string header2, string modalId = "modal", int footer = 0,string sizeClass="lg", int? width = null)
  14. {
  15. Header = new ModalHeaderViewModel(header1, header2);
  16. Footer = footer+"";
  17. ModalId = modalId;
  18. Width = width;
  19. SizeClass = sizeClass;
  20. }
  21. public ModalViewModel1(string header, ModalBodyViewModel body, string modalId = "modal", string footer = "0",string sizeClass="lg", int? width = null)
  22. {
  23. Header = new ModalHeaderViewModel(header);
  24. Body = body;
  25. Body.ModalId = modalId;
  26. Footer = footer;
  27. ModalId = modalId;
  28. Width = width;
  29. SizeClass = sizeClass;
  30. }
  31. public ModalViewModel1(string header1, string header2, ModalBodyViewModel body, string modalId = "modal", int footer = 0,string sizeClass="lg", int? width = null)
  32. {
  33. Header = new ModalHeaderViewModel(header1, header2);
  34. Body = body;
  35. if (body != null)
  36. {
  37. Body.ModalId = modalId;
  38. }
  39. Footer = footer+"";
  40. ModalId = modalId;
  41. Width = width;
  42. SizeClass = sizeClass;
  43. }
  44. public ModalViewModel1(ModalHeaderViewModel header, ModalBodyViewModel body, string modalId = "modal", int footer = 0,string sizeClass="lg", int? width = null)
  45. {
  46. Header = header;
  47. Body = body;
  48. Body.ModalId = modalId;
  49. Footer = footer+"";
  50. ModalId = modalId;
  51. Width = width;
  52. SizeClass = sizeClass;
  53. }
  54. public ModalHeaderViewModel Header { get; set; }
  55. public ModalBodyViewModel Body { get; set; }
  56. public string Footer { get; set; }
  57. public string ModalId { get; set; }
  58. public int? Width { get; set; }
  59. public string SizeClass { get; set; }
  60. public ModalViewModel1 SetModalSize( string sizeClass)
  61. {
  62. SizeClass = sizeClass;
  63. return this;
  64. }
  65. public ModalViewModel1 SetModalSize( int width)
  66. {
  67. Width = width;
  68. return this;
  69. }
  70. }
  71. }