MemberPaymentSuperSmallForm.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. using LYFZ.Helper;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm
  12. {
  13. public partial class MemberPaymentSuperSmallForm : LYFZ.Software.UI.MembershipManage.SuperSmallForm.MemberPaymentSuperSmallForm
  14. {
  15. LYFZ.BLL.BLL_ErpMemberCard mcbll = new BLL.BLL_ErpMemberCard();
  16. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  17. LYFZ.BLL.BLL_ErpMemberCardGradeSet mcgsbll = new BLL.BLL_ErpMemberCardGradeSet();
  18. LYFZ.BLL.BLL_ErpMemberCardValidity mcvybll = new BLL.BLL_ErpMemberCardValidity();
  19. public MemberPaymentSuperSmallForm()
  20. {
  21. this.btnUpdateValidity.Click += btnUpdateValidity_Click;
  22. this.chkValidity.CheckedChanged += chkValidity_CheckedChanged;
  23. this.txtConfirmAmount.EventTextBoxEx_TextChanged += txtConfirmAmount_EventTextBoxEx_TextChanged;
  24. this.txtConfirmAmount.Leave += txtConfirmAmount_Leave;
  25. this.cmbPaymentMethod.ComboBoxTree_NodeMouseClick += cmbPaymentMethod_ComboBoxTree_NodeMouseClick;
  26. this.btn_CustomerPerformance.Click += Btn_CustomerPerformance_Click;
  27. this.btn_PerformanceClearn.Click += Btn_PerformanceClearn_Click;
  28. }
  29. private void Btn_PerformanceClearn_Click(object sender, EventArgs e)
  30. {
  31. ClearPerformance();
  32. }
  33. /// <summary>
  34. /// 清空业绩列表
  35. /// </summary>
  36. void ClearPerformance()
  37. {
  38. this.listboxPerformance.Items.Clear();
  39. this.listboxPerformance.Tag = null;
  40. this.currentPersonCommissionRatio = null;
  41. }
  42. LYFZ.BLL.OrderPersonCommissionRatio currentPersonCommissionRatio = null;
  43. /// <summary>
  44. /// 自定义业绩分配
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="e"></param>
  48. private void Btn_CustomerPerformance_Click(object sender, EventArgs e)
  49. {
  50. if (string.IsNullOrEmpty(this.cmbtreevOrderPerson.Text.ToString()))
  51. {
  52. MessageBoxCustom.Show("请选择接单人!");
  53. return;
  54. }
  55. LYFZ.Software.MainBusiness.DoorCityProcess.frmCustomPerformance customPerformance = new MainBusiness.DoorCityProcess.frmCustomPerformance();
  56. try
  57. {
  58. customPerformance.CollectionAmount = Convert.ToDecimal(this.txtConfirmAmount.Text.Trim());
  59. if (this.listboxPerformance.Items.Count > 0 && this.currentPersonCommissionRatio != null)
  60. {
  61. customPerformance.PersonCommissionRatio = this.currentPersonCommissionRatio;
  62. }
  63. else
  64. {
  65. customPerformance.OrderPersonInitialization(this.cmbtreevOrderPerson.Tag.ToString());
  66. }
  67. customPerformance.BindPerformancePersonControls();
  68. if (customPerformance.ShowDialog() == DialogResult.OK)
  69. {
  70. this.listboxPerformance.Items.Clear();
  71. this.currentPersonCommissionRatio = customPerformance.PersonCommissionRatio;
  72. customPerformance.BindListBoxPerformance(this.listboxPerformance);
  73. }
  74. }
  75. catch (Exception ex)
  76. {
  77. MessageBoxCustom.Show(String.Format("收款金额输入格式不正确:{0}", ex.Message));
  78. }
  79. }
  80. /// <summary>
  81. /// 变量名,需要三个参数
  82. /// 1.会员编号(htData["StrNumber"])
  83. /// 2.消费金额(htData["PaymentAmount"])
  84. /// 3.套系名称(htData["PackageClass"]),如果不是套系,则为空
  85. /// </summary>
  86. public Hashtable htData = new Hashtable();
  87. /// <summary>
  88. /// 是否保存
  89. /// </summary>
  90. public bool IsSaveed = false;
  91. /// <summary>
  92. /// 保存后返回参数
  93. /// </summary>
  94. public MemberPaymentModel model = null;
  95. public List<CommandInfo> clist = new List<CommandInfo>();
  96. //LYFZ.Model.Model_ErpMemberCard modelmc = null;
  97. /// <summary>
  98. /// 当前卡的折扣
  99. /// </summary>
  100. decimal decDiscount = 0;
  101. /// <summary>
  102. /// 窗体加载事件
  103. /// </summary>
  104. /// <param name="sender"></param>
  105. /// <param name="e"></param>
  106. protected override void MemberPaymentSuperSmallForm_Shown(object sender, EventArgs e)
  107. {
  108. DataTable tbl = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberMainGoldMember(" And Mc_Number = '" + this.htData["StrNumber"] + "'", inTopCount: 1);
  109. //DataTable tbl = mcbll.GetView_Custom("BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + this.htData["StrNumber"] + "'", ShowColumnName: "会员卡号,姓名,类型,金额,折扣").Tables[0];
  110. this.txtMemberNumber.Text = tbl.Rows[0]["会员卡号"].ToString().Trim();
  111. this.txtName.Text = tbl.Rows[0]["持卡人"].ToString().Trim();
  112. this.txtName.Tag = tbl.Rows[0]["类型"].ToString().Trim();
  113. this.txtAvailableAmount.Text = tbl.Rows[0]["金额"].ToString().Trim();
  114. this.txtCopeAmount.Text = htData["decCopeAmount"].ToString().Trim();
  115. this.txtConfirmAmount.Text = htData["decCopeAmount"].ToString().Trim();
  116. this.decDiscount = Convert.ToDecimal(tbl.Rows[0]["折扣"]);
  117. //if (Convert.ToDecimal(tbl.Rows[0]["欠款"]) > 0)
  118. //{
  119. // LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ArrearsTipsSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.ArrearsTipsSuperSmallForm();
  120. // frm.StrTipsText = "此客人余款未清,请核对!";
  121. // frm.ShowDialog();
  122. //}
  123. this.txtConfirmAmount.Focus();
  124. #region 加载有效期
  125. bool IsValidity = false;
  126. DataTable dt = mcbll.GetView_Custom("tb_ErpMemberCardValidity", StrWhere: "Mcvy_Number = '" + this.htData["StrNumber"] + "' And Mcvy_Type = " + ((int)LYFZ.EnumPublic.MemberFunctionAttribute.服务) + "", ShowColumnName: "ID,Mcvy_ValidityTime").Tables[0];
  127. if (dt.Rows.Count > 0)
  128. {
  129. this.chkValidity.Tag = dt.Rows[0]["ID"].ToString().Trim();
  130. if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(dt.Rows[0]["Mcvy_ValidityTime"].ToString().Trim())))
  131. {
  132. IsValidity = true;
  133. this.dtpValidity.DateValue = dt.Rows[0]["Mcvy_ValidityTime"].ToString().Trim();
  134. this.chkValidity.Checked = false;
  135. }
  136. }
  137. if (!IsValidity)
  138. {
  139. this.dtpValidity.DateValue = "";
  140. this.chkValidity.Checked = true;
  141. }
  142. #endregion
  143. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_PaymentMethod(this.cmbPaymentMethod);
  144. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbtreevOrderPerson);
  145. this.btnSet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersReceivablesCompetence, LYFZ.CustomAttributes.OperatingAuthority.OrderPaymentMethodSet);
  146. }
  147. /// <summary>
  148. /// 输入付款金额后计算出折后金额
  149. /// </summary>
  150. /// <param name="sender"></param>
  151. /// <param name="e"></param>
  152. void txtConfirmAmount_EventTextBoxEx_TextChanged(object sender, EventArgs e)
  153. {
  154. this.labelEx4.Visible = false;
  155. if (!string.IsNullOrEmpty(this.txtConfirmAmount.Text.Trim()))
  156. {
  157. if (this.cmbPaymentMethod.Tag != null && this.cmbPaymentMethod.Tag.ToString().Trim() == "BEBACCAFEGECFBJFD")
  158. {
  159. if (this.decDiscount > 0)
  160. {
  161. decimal decDiscountAmount = Convert.ToDecimal((Convert.ToDecimal(this.txtConfirmAmount.Text) * (this.decDiscount / 10)).ToString("0.00"));
  162. this.labelEx4.Text = "优惠:" + (Convert.ToDecimal(this.txtConfirmAmount.Text) - decDiscountAmount).ToString("0.00") + "元";
  163. this.labelEx4.Visible = true;
  164. }
  165. }
  166. }
  167. }
  168. /// <summary>
  169. ///
  170. /// </summary>
  171. /// <param name="sender"></param>
  172. /// <param name="e"></param>
  173. void cmbPaymentMethod_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  174. {
  175. this.txtConfirmAmount_EventTextBoxEx_TextChanged(this, null);
  176. }
  177. /// <summary>
  178. /// 输入付款金额后计算出折后金额
  179. /// </summary>
  180. /// <param name="sender"></param>
  181. /// <param name="e"></param>
  182. void txtConfirmAmount_Leave(object sender, EventArgs e)
  183. {
  184. //if (!string.IsNullOrEmpty(this.txtConfirmAmount.Text.Trim()))
  185. //{
  186. // if (this.decDiscount > 0)
  187. // {
  188. // this.txtConfirmDiscountAmount.Text = (Convert.ToDecimal(this.txtConfirmAmount.Text) * (this.decDiscount / 10)).ToString("0.00");
  189. // this.txtConfirmDiscountAmount.Tag = (Convert.ToDecimal(this.txtConfirmAmount.Text) - Convert.ToDecimal(this.txtConfirmDiscountAmount.Text)).ToString("0.00");
  190. // }
  191. // else
  192. // {
  193. // this.txtConfirmDiscountAmount.Text = this.txtConfirmAmount.Text;
  194. // this.txtConfirmDiscountAmount.Tag = "0.00";
  195. // }
  196. //}
  197. //else
  198. //{
  199. // this.txtConfirmDiscountAmount.Text = "0.00";
  200. // this.txtConfirmDiscountAmount.Tag = "0.00";
  201. //}
  202. }
  203. /// <summary>
  204. /// 金额输入控制
  205. /// </summary>
  206. /// <param name="sender"></param>
  207. /// <param name="e"></param>
  208. protected override void txtConfirmAmount_KeyPress(object sender, KeyPressEventArgs e)
  209. {
  210. if (Convert.ToString(e.KeyChar) == ".")
  211. {
  212. if (this.txtConfirmAmount.Text.Trim().IndexOf('.') != -1)
  213. { e.Handled = true; }
  214. }
  215. else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  216. { e.Handled = true; }
  217. }
  218. /// <summary>
  219. /// 备注输入控制
  220. /// </summary>
  221. /// <param name="sender"></param>
  222. /// <param name="e"></param>
  223. protected override void txtRemark_KeyPress(object sender, KeyPressEventArgs e)
  224. {
  225. if (Convert.ToString(e.KeyChar) == "|")
  226. { e.Handled = true; }
  227. }
  228. /// <summary>
  229. /// 确定
  230. /// </summary>
  231. /// <param name="sender"></param>
  232. /// <param name="e"></param>
  233. protected override void btnOK_Click(object sender, EventArgs e)
  234. {
  235. if (this.txtConfirmAmount.Text.Trim() == "")
  236. { MessageBoxCustom.Show("确认金额不能为空"); return; }
  237. if (Convert.ToDecimal(htData["DiscountAmount"]) > Convert.ToDecimal(this.txtConfirmAmount.Text))
  238. { MessageBoxCustom.Show("确认金额不能少至折后金额"); return; }
  239. if (this.cmbPaymentMethod.Tag == null)
  240. { MessageBoxCustom.Show("请选择支付方式!"); return; }
  241. if (this.cmbtreevOrderPerson.Tag == null)
  242. { MessageBoxCustom.Show("请选择接单人!"); return; }
  243. if (this.cmbtreevOrderPerson.Tag.ToString().Trim() == "")
  244. { MessageBoxCustom.Show("请选择接单人!"); return; }
  245. if (Convert.ToDecimal(this.txtConfirmAmount.Text) > Convert.ToDecimal(this.txtCopeAmount.Text))
  246. { MessageBoxCustom.Show("收金额不能大于应付金额!"); return; }
  247. decimal decDelConfirmAmount = 0;
  248. decimal DelMemberDiscountAmount = 0;
  249. if (this.cmbPaymentMethod.Tag.ToString().Trim() == "BEBACCAFEGECFBJFD")
  250. {
  251. if (Convert.ToDecimal(this.txtAvailableAmount.Text) < Convert.ToDecimal(this.txtConfirmAmount.Text))
  252. { MessageBoxCustom.Show("储值卡可用金额不足,请先充值后再支付"); return; }
  253. if (this.decDiscount > 0)
  254. {
  255. decDelConfirmAmount = Convert.ToDecimal((Convert.ToDecimal(this.txtConfirmAmount.Text) * (this.decDiscount / 10)).ToString("0.00"));
  256. }
  257. else
  258. { decDelConfirmAmount = Convert.ToDecimal(this.txtConfirmAmount.Text); }
  259. DataTable dtMcPw = mcbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_Number = '" + this.htData["StrNumber"] + "'", ShowColumnName: "Mc_TraderPassword").Tables[0];
  260. if (dtMcPw.Rows.Count > 0)
  261. {
  262. LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.EnterPasswordSuperSmallForm Efrm = new SuperSmallForm.EnterPasswordSuperSmallForm();
  263. Efrm.Text = "请输入密码";
  264. Efrm.ShowDialog();
  265. if (Efrm.Pwd != "")
  266. {
  267. if (dtMcPw.Rows[0]["Mc_TraderPassword"].ToString().Trim() != LYFZ.Command.Command_MD5.md5(Efrm.Pwd))
  268. { MessageBoxCustom.Show("密码错误"); return; }
  269. }
  270. else
  271. { return; }
  272. }
  273. else
  274. { return; }
  275. }
  276. else
  277. { decDelConfirmAmount = Convert.ToDecimal(this.txtConfirmAmount.Text); }
  278. DelMemberDiscountAmount = Convert.ToDecimal(this.txtConfirmAmount.Text) - decDelConfirmAmount;
  279. model = new MemberPaymentModel();
  280. model.DelConfirmAmount = decDelConfirmAmount;
  281. model.StrPaymentMethod = this.cmbPaymentMethod.Tag.ToString().Trim();
  282. model.StrRemark = this.txtRemark.Text.Trim();
  283. model.DelMemberDiscount = this.decDiscount;
  284. model.DelMemberDiscountAmount = DelMemberDiscountAmount;
  285. model.StrOrderPerson = this.cmbtreevOrderPerson.Tag.ToString().Trim();
  286. model.CommissionRatio = "";
  287. if (this.listboxPerformance.Items.Count > 0 && this.currentPersonCommissionRatio != null)
  288. {
  289. model.StrOrderPerson = this.currentPersonCommissionRatio.ToOrderPersons();
  290. model.CommissionRatio = this.currentPersonCommissionRatio.ToString();
  291. }
  292. #region 会员有效期
  293. DateTime StrTime = SDateTime.Now;
  294. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  295. LYFZ.Model.Model_ErpMemberCardValidity modelValidity = null;
  296. if (this.chkValidity.Tag == null)
  297. {
  298. modelValidity = new Model.Model_ErpMemberCardValidity();
  299. modelValidity.Mcvy_Number = this.htData["StrNumber"].ToString().Trim();
  300. modelValidity.Mcvy_Type = (int)LYFZ.EnumPublic.MemberFunctionAttribute.服务;
  301. if (this.chkValidity.Checked)
  302. { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); }
  303. else
  304. { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpValidity.DateValue).AddDays(1).AddSeconds(-1); }
  305. modelValidity.Mcvy_CreateDatetime = StrTime;
  306. modelValidity.Mcvy_CreateName = StrUserID;
  307. clist.Add(mcvybll.GetAddCommandInfo(modelValidity));
  308. string StrLogTime = "";
  309. if (string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime)))
  310. { StrLogTime += "‘永久有效’"; }
  311. else
  312. { StrLogTime += "’" + LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime, "yyyy-MM-dd HH:mm:ss") + "’"; }
  313. clist.Add(LYFZ.BLL.OrderPayment_Member.GetValidityLogs("[服务新增]", this.txtMemberNumber.Text.Trim(), modelValidity.Mcvy_Type, StrLogTime));
  314. }
  315. else
  316. {
  317. modelValidity = mcvybll.GetModel(Convert.ToInt32(this.chkValidity.Tag));
  318. DateTime dtTime = modelValidity.Mcvy_ValidityTime;
  319. string StrLogTime = "";
  320. if (string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime)))
  321. { StrLogTime += "‘永久有效’"; }
  322. else
  323. { StrLogTime += "’" + LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime, "yyyy-MM-dd HH:mm:ss") + "’"; }
  324. if (this.chkValidity.Checked)
  325. { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); }
  326. else
  327. { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpValidity.DateValue).AddDays(1).AddSeconds(-1); }
  328. if (LYFZ.Command.Command_Validate.DateTimeToString(dtTime) != LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime))
  329. {
  330. modelValidity.Mcvy_UpdateDatetime = StrTime;
  331. modelValidity.Mcvy_UpdateName = StrUserID;
  332. clist.Add(mcvybll.GetUpdateCommandInfo(modelValidity));
  333. if (string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime)))
  334. { StrLogTime += "修改为‘永久有效’"; }
  335. else
  336. { StrLogTime += "修改为‘" + LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime, "yyyy-MM-dd HH:mm:ss") + "’"; }
  337. clist.Add(LYFZ.BLL.OrderPayment_Member.GetValidityLogs("[服务修改]", this.txtMemberNumber.Text.Trim(), modelValidity.Mcvy_Type, StrLogTime));
  338. }
  339. }
  340. #endregion
  341. this.IsSaveed = true;
  342. this.Close();
  343. }
  344. /// <summary>
  345. /// 取消
  346. /// </summary>
  347. /// <param name="sender"></param>
  348. /// <param name="e"></param>
  349. protected override void btnCancel_Click(object sender, EventArgs e)
  350. { this.Close(); }
  351. /// <summary>
  352. /// 充值
  353. /// </summary>
  354. /// <param name="sender"></param>
  355. /// <param name="e"></param>
  356. protected override void btnRecharge_Click(object sender, EventArgs e)
  357. {
  358. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MemberManage, CustomAttributes.OperatingAuthority.Member_Recharge))
  359. {
  360. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frmLog = new DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm("MemberManage", CustomAttributes.OperatingAuthority.Member_Recharge);
  361. if (frmLog.ShowDialog() == DialogResult.OK)
  362. {
  363. if (!LYFZ.BLL.BLL_ErpUser.GetRights(frmLog.CurrentAuthorizeUserRights.MemberManage, CustomAttributes.OperatingAuthority.Member_Recharge, frmLog.User_BelongRoles))
  364. {
  365. frmLog.SetAuthorizationResult(String.Format("授权失败,授权人没有'会员管理{0}'权限", LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm.ConvertEnumToDescription(CustomAttributes.OperatingAuthority.Member_Recharge).ToString()));
  366. return; }
  367. else {
  368. frmLog.SetAuthorizationResult();
  369. }
  370. }
  371. else
  372. { return; }
  373. }
  374. LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.GoldCardRechargeSuperSmallForm frm = new GoldCardRechargeSuperSmallForm();
  375. frm.StrNumber = this.htData["StrNumber"].ToString().Trim();
  376. frm.CardNumber = this.txtMemberNumber.Text.Trim();
  377. frm.CardName = this.txtName.Text.Trim();
  378. frm.CardType = this.txtName.Tag.ToString().Trim();
  379. frm.ShowDialog();
  380. if (frm.IsSaveed)
  381. { this.MemberPaymentSuperSmallForm_Shown(this, null); }
  382. }
  383. /// <summary>
  384. /// 设置
  385. /// </summary>
  386. /// <param name="sender"></param>
  387. /// <param name="e"></param>
  388. protected override void btnSet_Click(object sender, EventArgs e)
  389. {
  390. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  391. frm.TypeName = "BEBACCAFCCEAGAIHH";
  392. frm.Version = "Version";
  393. if (frm.ShowDialog() == DialogResult.OK)
  394. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_PaymentMethod(this.cmbPaymentMethod); }
  395. }
  396. /// <summary>
  397. /// 修改有效期
  398. /// </summary>
  399. /// <param name="sender"></param>
  400. /// <param name="e"></param>
  401. void btnUpdateValidity_Click(object sender, EventArgs e)
  402. {
  403. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MemberManage, CustomAttributes.OperatingAuthority.ValidityDateTime))
  404. {
  405. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm("MemberManage", CustomAttributes.OperatingAuthority.ValidityDateTime);
  406. if (frm.ShowDialog() == DialogResult.No)
  407. { return; }
  408. if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.MemberManage, CustomAttributes.OperatingAuthority.ValidityDateTime, frm.User_BelongRoles))
  409. {
  410. frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'会员管理{0}'权限", LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm.ConvertEnumToDescription(CustomAttributes.OperatingAuthority.ValidityDateTime).ToString()));
  411. return; }
  412. else {
  413. frm.SetAuthorizationResult();
  414. }
  415. }
  416. if (this.chkValidity.Checked)
  417. {
  418. this.chkValidity.Enabled = true;
  419. this.dtpValidity.Enabled = false;
  420. }
  421. else
  422. {
  423. this.chkValidity.Enabled = true;
  424. this.dtpValidity.Enabled = true;
  425. }
  426. }
  427. string StrValidityTime = "";
  428. /// <summary>
  429. /// 永久选择事件
  430. /// </summary>
  431. /// <param name="sender"></param>
  432. /// <param name="e"></param>
  433. void chkValidity_CheckedChanged(object sender, EventArgs e)
  434. {
  435. if (this.chkValidity.Checked)
  436. {
  437. this.StrValidityTime = this.dtpValidity.DateValue;
  438. this.dtpValidity.DateValue = "";
  439. this.dtpValidity.Enabled = false;
  440. }
  441. else
  442. {
  443. this.dtpValidity.Enabled = true;
  444. this.dtpValidity.DateValue = this.StrValidityTime;
  445. }
  446. }
  447. }
  448. public class MemberPaymentModel
  449. {
  450. private decimal _delConfirmAmount;
  451. /// <summary>
  452. /// 确认金额
  453. /// </summary>
  454. public decimal DelConfirmAmount
  455. {
  456. get { return _delConfirmAmount; }
  457. set { _delConfirmAmount = value; }
  458. }
  459. private string _strPaymentMethod;
  460. /// <summary>
  461. /// 支付方式
  462. /// </summary>
  463. public string StrPaymentMethod
  464. {
  465. get { return _strPaymentMethod; }
  466. set { _strPaymentMethod = value; }
  467. }
  468. private string _strRemark;
  469. /// <summary>
  470. /// 支付备注
  471. /// </summary>
  472. public string StrRemark
  473. {
  474. get { return _strRemark; }
  475. set { _strRemark = value; }
  476. }
  477. private decimal _delMemberDiscount;
  478. /// <summary>
  479. /// 优惠折扣
  480. /// </summary>
  481. public decimal DelMemberDiscount
  482. {
  483. get { return _delMemberDiscount; }
  484. set { _delMemberDiscount = value; }
  485. }
  486. private decimal _delMemberDiscountAmount;
  487. /// <summary>
  488. /// 优惠金额
  489. /// </summary>
  490. public decimal DelMemberDiscountAmount
  491. {
  492. get { return _delMemberDiscountAmount; }
  493. set { _delMemberDiscountAmount = value; }
  494. }
  495. private string _strOrderPerson;
  496. /// <summary>
  497. /// 接单人
  498. /// </summary>
  499. public string StrOrderPerson
  500. {
  501. get { return _strOrderPerson; }
  502. set { _strOrderPerson = value; }
  503. }
  504. string _CommissionRatio;
  505. public string CommissionRatio {
  506. get { return _CommissionRatio; }
  507. set { _CommissionRatio = value; }
  508. }
  509. }
  510. }