using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.Windows.Forms; namespace LYFZ.Software.MainBusiness.InitialSet.WageSet { public partial class FrmSelectLateCategory : LYFZ.Software.UI.InitialSet.WageSet.FrmSelectLateCategory { public FrmSelectLateCategory() { } #region 加载 protected override void FrmSelectLateCategory_Load(object sender, EventArgs e) { try { bind(); } catch (Exception ex) { MessageBoxCustom.Show(ex.Message); } } /// /// 绑定二销类别 /// public void bind() { DataTable dt = new DataTable(); #region 获取二销类别 LYFZ.BLL.BLL_ErpSystemCategory SystemCategorybll = new BLL.BLL_ErpSystemCategory(); DataTable dt2 = new DataTable(); dt2 = new DataTable(); dt2 = SystemCategorybll.GetList("Sc_ClassCode='BEBACDAJDFDDEACGJ'").Tables[0]; dt = SystemCategorybll.GetList("Sc_ClassParentID=" + dt2.Rows[0]["ID"] + "").Tables[0]; cmbSc_ClassName.DataSource = dt; this.cmbSc_ClassName.ValueMember = "Sc_ClassCode"; this.cmbSc_ClassName.DisplayMember = "Sc_ClassName"; DataRow dr = dt.NewRow(); dr["Sc_ClassCode"] = "-1"; dr["Sc_ClassName"] = ""; dt.Rows.InsertAt(dr, 0); this.cmbSc_ClassName.SelectedIndex = 0; //if (dt.Rows.Count > 0) //{ // cmbSc_ClassName.Items.Add(new ListItem("", "-1")); // for (int i = 0; i < dt.Rows.Count; i++) // { // this.cmbSc_ClassName.Items.Add(new ListItem(dt.Rows[i]["Sc_ClassName"].ToString().Trim(), dt.Rows[i]["Sc_ClassCode"].ToString().Trim())); // } //} //if (dt.Rows.Count == 0) //{ // cmbSc_ClassName.Items.Add(new ListItem("", "-1")); //} //cmbSc_ClassName.Items.Add(new ListItem("选片二销", "0")); //cmbSc_ClassName.Items.Add(new ListItem("化妆二销", "1")); //cmbSc_ClassName.Items.Add(new ListItem("摄影二销", "2")); //cmbSc_ClassName.Items.Add(new ListItem("摄影选片二销", "3")); //cmbSc_ClassName.Items.Add(new ListItem("化妆选片二销", "4")); //this.cmbSc_ClassName.SelectedIndex = 0; #endregion } #endregion #region 设置 protected override void btnSet_Click(object sender, EventArgs e) { try { LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet(); LYFZ.BLL.BLL_ErpSystemCategory bll = new BLL.BLL_ErpSystemCategory(); DataTable dt = bll.GetList("Sc_ClassCode='BEBACDAJDFDDEACGJ'").Tables[0]; if (dt.Rows.Count > 0) { set.TypeName = dt.Rows[0]["Sc_ClassCode"].ToString(); } set.Version = "Version"; if (set.ShowDialog() == DialogResult.OK) { bind(); } } catch (Exception ex) { MessageBoxCustom.Show(ex.Message); } } #endregion #region 确定 protected override void btnOk_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(cmbSc_ClassName.Text)) { MessageBoxCustom.Show("你选择二销类别!"); return; } //MessageBoxCustom.Show(((ListItem)cmbSc_ClassName.SelectedItem).Value.ToString()); LYFZ.Software.MainBusiness.InitialSet.WageSet.FrmPhaseCommissionScheme set = new FrmPhaseCommissionScheme(); set.Wcs_Type = "后期方案"; set.Wcs_TypeName = cmbSc_ClassName.Text; set.Wcs_TypeCode = cmbSc_ClassName.SelectedValue.ToString(); set.ShowDialog(); } catch (Exception ex) { MessageBoxCustom.Show(ex.Message); } } #endregion #region 关闭 protected override void btnClose_Click(object sender, EventArgs e) { this.Close(); } #endregion } }