private void frm_import_excel_Load(object sender, EventArgs e) { System.Data.DataTable tb; 材质类别表DAL dal = new 材质类别表DAL(); if (_isSale) { tb = dal.GetDataTableForSale(); } else { tb = dal.GetDataTable(); } clsItem mycls1; foreach (DataRow myrow in tb.Rows) { mycls1 = new clsItem(); mycls1.name = myrow["材质名称"].ToString(); mycls1.value = myrow["材质类别"].ToString(); cmb_type.Items.Add(mycls1); } cmb_type.ValueMember = "value"; cmb_type.DisplayMember = "name"; Text = "数据导入 部门:" + deptname + " 部门代码:" + deptcode; }
private void frm_otherCost_Load(object sender, EventArgs e) { this.Text = "其它费用导入"; dal.材质类别表DAL dal = new 材质类别表DAL(); System.Data.DataTable tb = dal.GetDataTableForSale(); clsItem mycls1; foreach (DataRow myrow in tb.Rows) { mycls1 = new clsItem(); mycls1.name = myrow["材质名称"].ToString(); mycls1.value = myrow["材质类别"].ToString(); cmb_type.Items.Add(mycls1); } cmb_type.ValueMember = "value"; cmb_type.DisplayMember = "name"; Text = "销售部门数据导入"; //dal.OtherCostDal dal = new OtherCostDal(); //this.FormBorderStyle = FormBorderStyle.Fixed3D; //SqlDataReader dr = dal.getOtherCostName(); //while (dr.Read()) //{ // cmb_type.Items.Add(dr.GetString(0)); //} }