Ejemplo n.º 1
0
        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;
            }
        }