ServicePaymentSuperSmallForm.cs 6.0 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.CameraControlBook.SuperSmallForm
  10. {
  11. public partial class ServicePaymentSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.ServicePaymentSuperSmallForm
  12. {
  13. public ServicePaymentSuperSmallForm()
  14. {
  15. this.btnSelect2.Click += btnSelect2_Click;
  16. this.btnSet2.Click += btnSet2_Click;
  17. }
  18. public string StrServerText = "";
  19. public decimal IntAmount = 0;
  20. public decimal OutAmount = 0;
  21. public string OutRemark = "";
  22. public string OutName = "";
  23. public string SaleMan = "";
  24. public string TwoSaleCategory = "";
  25. public bool IsSave = false;
  26. /// <summary>
  27. /// 窗体加载事件
  28. /// </summary>
  29. /// <param name="sender"></param>
  30. /// <param name="e"></param>
  31. protected override void ServicePaymentSuperSmallForm_Load(object sender, EventArgs e)
  32. {
  33. this.txtName.Text = this.StrServerText.Trim();
  34. this.BindPay_TwoPinsCategory();
  35. if (this.IntAmount > 0)
  36. { this.txtAmount.Text = this.IntAmount.ToString().Trim(); }
  37. }
  38. /// <summary>
  39. /// 输入事件
  40. /// </summary>
  41. /// <param name="sender"></param>
  42. /// <param name="e"></param>
  43. protected override void txtAmount_KeyPress(object sender, KeyPressEventArgs e)
  44. {
  45. if (Convert.ToString(e.KeyChar) == ".")
  46. { }
  47. else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  48. { e.Handled = true; }
  49. }
  50. /// <summary>
  51. /// 确定
  52. /// </summary>
  53. /// <param name="sender"></param>
  54. /// <param name="e"></param>
  55. protected override void btnOK_Click(object sender, EventArgs e)
  56. {
  57. if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
  58. {
  59. if (!string.IsNullOrEmpty(this.txtAmount.Text.Trim()))
  60. {
  61. if (!string.IsNullOrEmpty(this.txtPay_OpenSingle.Text.Trim()))
  62. {
  63. if (!string.IsNullOrEmpty(this.cmbPay_TwoPinsCategory.Text.Trim()))
  64. {
  65. if (LYFZ.Command.Command_Validate.IsNumeric(this.txtAmount.Text.Trim()))
  66. {
  67. this.TwoSaleCategory = this.cmbPay_TwoPinsCategory.SelectedValue.ToString();
  68. this.SaleMan = this.txtPay_OpenSingle.Tag.ToString().Trim();
  69. this.OutName = this.txtName.Text.Trim();
  70. this.OutAmount = Convert.ToDecimal(this.txtAmount.Text.Trim());
  71. this.OutRemark = this.txtRemark.Text.Trim();
  72. this.IsSave = true;
  73. this.Close();
  74. }
  75. }
  76. else
  77. { MessageBoxCustom.Show("二销类别不能为空"); }
  78. }
  79. else
  80. { MessageBoxCustom.Show("销售人员不能为空"); }
  81. }
  82. else
  83. { MessageBoxCustom.Show("收款金额不能为空"); }
  84. }
  85. else
  86. { MessageBoxCustom.Show("收款项目不能为空"); }
  87. }
  88. /// <summary>
  89. /// 取消
  90. /// </summary>
  91. /// <param name="sender"></param>
  92. /// <param name="e"></param>
  93. protected override void btnCancel_Click(object sender, EventArgs e)
  94. { this.Close(); }
  95. /// <summary>
  96. /// 选择接单人
  97. /// </summary>
  98. /// <param name="sender"></param>
  99. /// <param name="e"></param>
  100. void btnSelect2_Click(object sender, EventArgs e)
  101. {
  102. LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmSelectPayOpenSingle set = new FinancialManagement.OrdersReceivables.FrmSelectPayOpenSingle();
  103. set.ShowDialog();
  104. if (!string.IsNullOrEmpty(set.Str1))
  105. {
  106. this.txtPay_OpenSingle.Text = set.Str1;
  107. this.txtPay_OpenSingle.Tag = set.Str2;
  108. }
  109. }
  110. /// <summary>
  111. /// 设置
  112. /// </summary>
  113. /// <param name="sender"></param>
  114. /// <param name="e"></param>
  115. void btnSet2_Click(object sender, EventArgs e)
  116. {
  117. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet();
  118. set.TypeName = "BEBACDAJDFDDEACGJ";
  119. set.Version = "Version";
  120. if (set.ShowDialog() == DialogResult.OK)
  121. { this.BindPay_TwoPinsCategory(); }
  122. }
  123. /// <summary>
  124. /// 绑定二销类别
  125. /// </summary>
  126. public void BindPay_TwoPinsCategory()
  127. {
  128. DataTable dt = new DataTable();
  129. LYFZ.BLL.BLL_ErpSystemCategory SystemCategorybll = new BLL.BLL_ErpSystemCategory();
  130. DataTable dt2 = new DataTable();
  131. dt2 = new DataTable();
  132. dt2 = SystemCategorybll.GetList("Sc_ClassCode='BEBACDAJDFDDEACGJ'").Tables[0];
  133. dt = SystemCategorybll.GetList("Sc_ClassParentID=" + dt2.Rows[0]["ID"] + "and Sc_ClassCode!='BEBCADBFBCDFBGJHC' and Sc_ClassCode!='BEBCADBFBDDEGGABF' and Sc_ClassCode!='BEBCBFBICGDHCGBEJ' and Sc_ClassCode!='BEBCABBAAICBDHDHI' and Sc_ClassCode!='BEBCABBAAICJAAGDG' and Sc_ClassCode!='BEBCBFBICFCECBHFF' ").Tables[0];
  134. this.cmbPay_TwoPinsCategory.DataSource = dt;
  135. this.cmbPay_TwoPinsCategory.ValueMember = "Sc_ClassCode";
  136. this.cmbPay_TwoPinsCategory.DisplayMember = "Sc_ClassName";
  137. DataRow dr = dt.NewRow();
  138. dr["Sc_ClassCode"] = "-1";
  139. dr["Sc_ClassName"] = "";
  140. dt.Rows.InsertAt(dr, 0);
  141. this.cmbPay_TwoPinsCategory.SelectedIndex = 0;
  142. }
  143. }
  144. }