private void frFinishedMeasure_Load(object sender, EventArgs e) { dtMea = bllMea.GetAllList().Tables[0]; comboBox1.DataSource = dtMea.Copy(); comboBox2.DataSource = dtMea.Copy(); comboBox3.DataSource = dtMea.Copy(); dtOT = bllOT.GetTypeList("成品单位").Tables[0]; if (dtOT.Rows.Count == 0) { Hownet.Model.OtherType modOT = new Hownet.Model.OtherType(); modOT.A = 1; modOT.Name = "成品单位"; modOT.TypeID = 0; modOT.Value = "0"; int _id = bllOT.Add(modOT); modOT.TypeID = _id; modOT.Name = "默认单位"; modOT.Value = "1"; bllOT.Add(modOT); modOT.TypeID = _id; modOT.Name = "仓储单位"; bllOT.Add(modOT); modOT.TypeID = _id; modOT.Name = "仓储换算"; bllOT.Add(modOT); modOT.TypeID = _id; modOT.Name = "车间单位"; bllOT.Add(modOT); modOT.TypeID = _id; modOT.Name = "车间换算"; bllOT.Add(modOT); dtOT = bllOT.GetTypeList("成品单位").Tables[0]; } li = bllOT.DataTableToList(dtOT); comboBox1.SelectedValue = Convert.ToInt32(dtOT.Select("(Name='默认单位')")[0]["Value"]); comboBox2.SelectedValue = Convert.ToInt32(dtOT.Select("(Name='车间单位')")[0]["Value"]); comboBox3.SelectedValue = Convert.ToInt32(dtOT.Select("(Name='仓储单位')")[0]["Value"]); textBox1.Text = dtOT.Select("(Name='车间换算')")[0]["Value"].ToString(); textBox2.Text = dtOT.Select("(Name='仓储换算')")[0]["Value"].ToString(); if (bllPA.GetAllList().Tables[0].Rows.Count > 0) { comboBox1.Enabled = comboBox2.Enabled = comboBox3.Enabled = false; } }
public static void SetCate() { Hownet.BLL.OtherType bllOT = new Hownet.BLL.OtherType(); List <Hownet.Model.OtherType> list = bllOT.DataTableToList(bllOT.GetTypeList("伙食扣费").Tables[0]); for (int i = 0; i < list.Count; i++) { if (list[i].Name == "就餐成功") { 就餐成功 = list[i].Value; } else if (list[i].Name == "重复就餐") { 重复就餐 = list[i].Value; } else if (list[i].Name == "未订吃饭") { 未订吃饭 = list[i].Value; } } }