DressOpenOrderFirstFormMain.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace LYFZ.Software.MainBusiness.Dresses
  10. {
  11. public partial class DressOpenOrderFirstFormMain : LYFZ.Software.UI.Dresses.DressOpenOrderFirstFormMain
  12. {
  13. public DressOpenOrderFirstFormMain()
  14. {
  15. this.Load += DressOpenOrderFormMain_Load;
  16. this.Shown += DressOpenOrderFormMain_Shown;
  17. this.btnPreselect.Click += btnPreselect_Click;
  18. this.btnRent.Click += btnRent_Click;
  19. this.btnSold.Click += btnSold_Click;
  20. this.btnSendWash.Click += btnSendWash_Click;
  21. this.FormClosed += DressOpenOrderFirstFormMain_FormClosed;
  22. }
  23. /// <summary>
  24. /// 是否要跳转界面
  25. /// </summary>
  26. bool IsGoForm = false;
  27. /// <summary>
  28. /// 点击要跳转的类型
  29. /// </summary>
  30. LYFZ.EnumPublic.EnumDressOrderType btnClickType;
  31. /// <summary>
  32. /// 窗体加载
  33. /// </summary>
  34. /// <param name="sender"></param>
  35. /// <param name="e"></param>
  36. void DressOpenOrderFormMain_Load(object sender, EventArgs e)
  37. {
  38. this.btnPreselect.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressManagement, CustomAttributes.OperatingAuthority.Dress_Preselection);
  39. this.btnRent.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressManagement, CustomAttributes.OperatingAuthority.Dress_Rental);
  40. this.btnSold.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressManagement, CustomAttributes.OperatingAuthority.Dress_Rental);
  41. this.btnSendWash.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressManagement, CustomAttributes.OperatingAuthority.Dress_Valet);
  42. }
  43. /// <summary>
  44. /// 窗体加载
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="e"></param>
  48. void DressOpenOrderFormMain_Shown(object sender, EventArgs e)
  49. {
  50. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.礼服管理);
  51. if (!b)
  52. {
  53. this.Close();
  54. return;
  55. }
  56. this.TopMost = false;
  57. }
  58. /// <summary>
  59. /// 预选
  60. /// </summary>
  61. /// <param name="sender"></param>
  62. /// <param name="e"></param>
  63. void btnPreselect_Click(object sender, EventArgs e)
  64. {
  65. this.btnClickType = EnumPublic.EnumDressOrderType.预选;
  66. this.IsGoForm = true;
  67. this.Close();
  68. }
  69. /// <summary>
  70. /// 出租
  71. /// </summary>
  72. /// <param name="sender"></param>
  73. /// <param name="e"></param>
  74. void btnRent_Click(object sender, EventArgs e)
  75. {
  76. this.btnClickType = EnumPublic.EnumDressOrderType.出租;
  77. this.IsGoForm = true;
  78. this.Close();
  79. }
  80. /// <summary>
  81. /// 出售
  82. /// </summary>
  83. /// <param name="sender"></param>
  84. /// <param name="e"></param>
  85. void btnSold_Click(object sender, EventArgs e)
  86. {
  87. this.btnClickType = EnumPublic.EnumDressOrderType.出售;
  88. this.IsGoForm = true;
  89. this.Close();
  90. }
  91. /// <summary>
  92. /// 送洗
  93. /// </summary>
  94. /// <param name="sender"></param>
  95. /// <param name="e"></param>
  96. void btnSendWash_Click(object sender, EventArgs e)
  97. {
  98. this.btnClickType = EnumPublic.EnumDressOrderType.送洗;
  99. this.IsGoForm = true;
  100. this.Close();
  101. }
  102. /// <summary>
  103. /// 窗体关闭后发生事件
  104. /// </summary>
  105. /// <param name="sender"></param>
  106. /// <param name="e"></param>
  107. void DressOpenOrderFirstFormMain_FormClosed(object sender, FormClosedEventArgs e)
  108. {
  109. if (this.IsGoForm)
  110. {
  111. if (this.btnClickType == EnumPublic.EnumDressOrderType.预选)
  112. {
  113. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrdePreselectedSmallForm frm = new SetSmallForm.DressOpenOrdePreselectedSmallForm();
  114. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  115. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  116. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  117. frm.TopMost = true;
  118. frm.Show();
  119. }
  120. else if (this.btnClickType == EnumPublic.EnumDressOrderType.送洗)
  121. {
  122. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashSmallForm frm = new SetSmallForm.DressOpenOrderSendWashSmallForm();
  123. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  124. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  125. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  126. frm.TopMost = true;
  127. frm.Show();
  128. }
  129. else if (this.btnClickType == EnumPublic.EnumDressOrderType.出租 || this.btnClickType == EnumPublic.EnumDressOrderType.出售)
  130. {
  131. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderRentSaleSmallForm frm = new SetSmallForm.DressOpenOrderRentSaleSmallForm();
  132. frm.LoadType = this.btnClickType.ToString().Trim();
  133. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  134. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  135. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  136. frm.TopMost = true;
  137. frm.Show();
  138. }
  139. }
  140. }
  141. }
  142. }