FrmSelectPreCategory.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.Web.UI.WebControls;
  9. using System.Windows.Forms;
  10. namespace LYFZ.Software.MainBusiness.InitialSet.WageSet
  11. {
  12. public partial class FrmSelectPreCategory : LYFZ.Software.UI.InitialSet.WageSet.FrmSelectPreCategory
  13. {
  14. public FrmSelectPreCategory()
  15. {
  16. this.FormClosed += FrmSelectPreCategory_FormClosed;
  17. }
  18. void FrmSelectPreCategory_FormClosed(object sender, FormClosedEventArgs e)
  19. {
  20. this.DialogResult = DialogResult.OK;
  21. //throw new NotImplementedException();
  22. }
  23. #region 加载
  24. protected override void FrmSelectPreCategory_Load(object sender, EventArgs e)
  25. {
  26. try
  27. {
  28. bind();
  29. }
  30. catch (Exception ex)
  31. {
  32. MessageBoxCustom.Show(ex.Message);
  33. }
  34. }
  35. /// <summary>
  36. /// 绑定提成点
  37. /// </summary>
  38. public void bind()
  39. {
  40. DataTable dt = new DataTable();
  41. #region 绑定提成点
  42. LYFZ.BLL.BLL_ErpSystemCategory SystemCategorybll = new BLL.BLL_ErpSystemCategory();
  43. DataTable dt2 = new DataTable();
  44. DataRow dr = dt.NewRow();
  45. dt2 = SystemCategorybll.GetList("Sc_ClassCode='BEBBAFACDCCFBJFI'").Tables[0];
  46. dt = SystemCategorybll.GetList("Sc_ClassParentID=" + dt2.Rows[0]["ID"] + "").Tables[0];
  47. cmbSc_ClassName.DataSource = dt;
  48. this.cmbSc_ClassName.ValueMember = "Sc_ClassCode";
  49. this.cmbSc_ClassName.DisplayMember = "Sc_ClassName";
  50. dr = dt.NewRow();
  51. dr["Sc_ClassCode"] = "-1";
  52. dr["Sc_ClassName"] = "";
  53. dt.Rows.InsertAt(dr, 0);
  54. this.cmbSc_ClassName.SelectedIndex = 0;
  55. #endregion
  56. }
  57. #endregion
  58. #region 设置
  59. protected override void btnSet_Click(object sender, EventArgs e)
  60. {
  61. try
  62. {
  63. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet();
  64. LYFZ.BLL.BLL_ErpSystemCategory bll = new BLL.BLL_ErpSystemCategory();
  65. DataTable dt = bll.GetList("Sc_ClassCode='BEBBAFACDCCFBJFI'").Tables[0];
  66. if (dt.Rows.Count > 0)
  67. {
  68. set.TypeName = dt.Rows[0]["Sc_ClassCode"].ToString();
  69. }
  70. set.Version = "Version";
  71. if (set.ShowDialog() == DialogResult.OK)
  72. {
  73. bind();
  74. }
  75. }
  76. catch (Exception ex)
  77. {
  78. MessageBoxCustom.Show(ex.Message);
  79. }
  80. }
  81. #endregion
  82. #region 确定
  83. protected override void btnOk_Click(object sender, EventArgs e)
  84. {
  85. try
  86. {
  87. if (string.IsNullOrEmpty(cmbSc_ClassName.Text))
  88. {
  89. MessageBoxCustom.Show("你选择前期类别!");
  90. return;
  91. }
  92. LYFZ.Software.MainBusiness.InitialSet.WageSet.FrmPhaseCommissionScheme set = new FrmPhaseCommissionScheme();
  93. set.Wcs_Type = "提成点";
  94. set.Wcs_TypeName = cmbSc_ClassName.Text;
  95. set.Wcs_TypeCode = cmbSc_ClassName.SelectedValue.ToString();
  96. set.ShowDialog();
  97. }
  98. catch (Exception ex)
  99. {
  100. MessageBoxCustom.Show(ex.Message);
  101. }
  102. }
  103. #endregion
  104. #region 关闭
  105. protected override void btnClose_Click(object sender, EventArgs e)
  106. {
  107. this.DialogResult = DialogResult.OK;
  108. this.Close();
  109. }
  110. #endregion
  111. }
  112. }