FrmSelectLateCategory.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 FrmSelectLateCategory : LYFZ.Software.UI.InitialSet.WageSet.FrmSelectLateCategory
  13. {
  14. public FrmSelectLateCategory()
  15. {
  16. }
  17. #region 加载
  18. protected override void FrmSelectLateCategory_Load(object sender, EventArgs e)
  19. {
  20. try
  21. {
  22. bind();
  23. }
  24. catch (Exception ex)
  25. {
  26. MessageBoxCustom.Show(ex.Message);
  27. }
  28. }
  29. /// <summary>
  30. /// 绑定二销类别
  31. /// </summary>
  32. public void bind()
  33. {
  34. DataTable dt = new DataTable();
  35. #region 获取二销类别
  36. LYFZ.BLL.BLL_ErpSystemCategory SystemCategorybll = new BLL.BLL_ErpSystemCategory();
  37. DataTable dt2 = new DataTable();
  38. dt2 = new DataTable();
  39. dt2 = SystemCategorybll.GetList("Sc_ClassCode='BEBACDAJDFDDEACGJ'").Tables[0];
  40. dt = SystemCategorybll.GetList("Sc_ClassParentID=" + dt2.Rows[0]["ID"] + "").Tables[0];
  41. cmbSc_ClassName.DataSource = dt;
  42. this.cmbSc_ClassName.ValueMember = "Sc_ClassCode";
  43. this.cmbSc_ClassName.DisplayMember = "Sc_ClassName";
  44. DataRow dr = dt.NewRow();
  45. dr["Sc_ClassCode"] = "-1";
  46. dr["Sc_ClassName"] = "";
  47. dt.Rows.InsertAt(dr, 0);
  48. this.cmbSc_ClassName.SelectedIndex = 0;
  49. //if (dt.Rows.Count > 0)
  50. //{
  51. // cmbSc_ClassName.Items.Add(new ListItem("", "-1"));
  52. // for (int i = 0; i < dt.Rows.Count; i++)
  53. // {
  54. // this.cmbSc_ClassName.Items.Add(new ListItem(dt.Rows[i]["Sc_ClassName"].ToString().Trim(), dt.Rows[i]["Sc_ClassCode"].ToString().Trim()));
  55. // }
  56. //}
  57. //if (dt.Rows.Count == 0)
  58. //{
  59. // cmbSc_ClassName.Items.Add(new ListItem("", "-1"));
  60. //}
  61. //cmbSc_ClassName.Items.Add(new ListItem("选片二销", "0"));
  62. //cmbSc_ClassName.Items.Add(new ListItem("化妆二销", "1"));
  63. //cmbSc_ClassName.Items.Add(new ListItem("摄影二销", "2"));
  64. //cmbSc_ClassName.Items.Add(new ListItem("摄影选片二销", "3"));
  65. //cmbSc_ClassName.Items.Add(new ListItem("化妆选片二销", "4"));
  66. //this.cmbSc_ClassName.SelectedIndex = 0;
  67. #endregion
  68. }
  69. #endregion
  70. #region 设置
  71. protected override void btnSet_Click(object sender, EventArgs e)
  72. {
  73. try
  74. {
  75. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet();
  76. LYFZ.BLL.BLL_ErpSystemCategory bll = new BLL.BLL_ErpSystemCategory();
  77. DataTable dt = bll.GetList("Sc_ClassCode='BEBACDAJDFDDEACGJ'").Tables[0];
  78. if (dt.Rows.Count > 0)
  79. {
  80. set.TypeName = dt.Rows[0]["Sc_ClassCode"].ToString();
  81. }
  82. set.Version = "Version";
  83. if (set.ShowDialog() == DialogResult.OK)
  84. {
  85. bind();
  86. }
  87. }
  88. catch (Exception ex)
  89. {
  90. MessageBoxCustom.Show(ex.Message);
  91. }
  92. }
  93. #endregion
  94. #region 确定
  95. protected override void btnOk_Click(object sender, EventArgs e)
  96. {
  97. try
  98. {
  99. if (string.IsNullOrEmpty(cmbSc_ClassName.Text))
  100. {
  101. MessageBoxCustom.Show("你选择二销类别!");
  102. return;
  103. }
  104. //MessageBoxCustom.Show(((ListItem)cmbSc_ClassName.SelectedItem).Value.ToString());
  105. LYFZ.Software.MainBusiness.InitialSet.WageSet.FrmPhaseCommissionScheme set = new FrmPhaseCommissionScheme();
  106. set.Wcs_Type = "后期方案";
  107. set.Wcs_TypeName = cmbSc_ClassName.Text;
  108. set.Wcs_TypeCode = cmbSc_ClassName.SelectedValue.ToString();
  109. set.ShowDialog();
  110. }
  111. catch (Exception ex)
  112. {
  113. MessageBoxCustom.Show(ex.Message);
  114. }
  115. }
  116. #endregion
  117. #region 关闭
  118. protected override void btnClose_Click(object sender, EventArgs e)
  119. {
  120. this.Close();
  121. }
  122. #endregion
  123. }
  124. }