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 FrmSelectPreCategory : LYFZ.Software.UI.InitialSet.WageSet.FrmSelectPreCategory { public FrmSelectPreCategory() { this.FormClosed += FrmSelectPreCategory_FormClosed; } void FrmSelectPreCategory_FormClosed(object sender, FormClosedEventArgs e) { this.DialogResult = DialogResult.OK; //throw new NotImplementedException(); } #region 加载 protected override void FrmSelectPreCategory_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(); DataRow dr = dt.NewRow(); dt2 = SystemCategorybll.GetList("Sc_ClassCode='BEBBAFACDCCFBJFI'").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"; dr = dt.NewRow(); dr["Sc_ClassCode"] = "-1"; dr["Sc_ClassName"] = ""; dt.Rows.InsertAt(dr, 0); 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='BEBBAFACDCCFBJFI'").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; } 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.DialogResult = DialogResult.OK; this.Close(); } #endregion } }