Esempio n. 1
0
        //第一级
        private void cmbMetalFirst_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbMetalFirst.SelectedValue.ToString().Length > 5)
            {
                return;
            }

            string strWhere = "level1_id = 5 and level2_id = " + this.cmbMetalFirst.SelectedValue;

            Material.BLL.level3          lev3 = new Material.BLL.level3();
            List <Material.Model.level3> list = lev3.GetModelList(strWhere);

            cmbMetalSecond.DataSource    = list;
            cmbMetalSecond.DisplayMember = "name";
            cmbMetalSecond.ValueMember   = "id3";
            cmbMetalSecond.Text          = "";

            this.txtMetalCode.Text = "";
            this.txtMetalCode.Text = "5." + this.txtMetalCode.Text + this.cmbMetalFirst.SelectedValue + "."
                                     + this.txtMetalGBCode.Text + "."
                                     + this.txtMentalLwsize.Text + "."
                                     + this.txtMentalLength.Text + "."
                                     + this.txtMentalStrength.Text + "."
                                     + this.txtMentalMaterial.Text;
        }
        //一级
        private void cmbLineFirst_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbLineFirst.SelectedValue.ToString().Length > 5)
            {
                return;
            }

            string strWhere = "level1_id = 4 and level2_id = " + this.cmbLineFirst.SelectedValue;

            Material.BLL.level3          lev3 = new Material.BLL.level3();
            List <Material.Model.level3> list = lev3.GetModelList(strWhere);

            cmbLineSecond.DataSource    = list;
            cmbLineSecond.DisplayMember = "name";
            cmbLineSecond.ValueMember   = "id3";
            cmbLineSecond.Text          = "";

            this.txtLineCode.Text = "";
            this.txtLineCode.Text = "4." + this.txtLineCode.Text + this.cmbLineFirst.SelectedValue + "."
                                    + this.cmbLineColorAndIO.Text + "."
                                    + this.cmbLineComIO.Text + "."
                                    + this.txtLineSquDivLen.Text + "."
                                    + this.txtLineSerialNum.Text + "."
                                    + this.txtLineCode.Text;
        }
Esempio n. 3
0
        private void searchLevelSecond(string codeFirst, string codeSecond)
        {
            string strWhere = "level1_id = 6 and level2_id = " + codeFirst + " and id3 = " + codeSecond;

            Material.BLL.level3          lev3 = new Material.BLL.level3();
            List <Material.Model.level3> list = lev3.GetModelList(strWhere);

            if (1 == list.Count)
            {
                Form1 frmMain = Application.OpenForms["Form1"] as Form1;
                frmMain.setSearchLabel2("二级子类:" + list[0].name);
            }
        }
        private void cmbStdFirst_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbStdFirst.SelectedValue.ToString().Length > 5)
            {
                return;
            }

            string strWhere = "level1_id = 2 and level2_id = " + this.cmbStdFirst.SelectedValue;

            Material.BLL.level3          lev3 = new Material.BLL.level3();
            List <Material.Model.level3> list = lev3.GetModelList(strWhere);

            cmbStdSecond.DataSource    = list;
            cmbStdSecond.DisplayMember = "name";
            cmbStdSecond.ValueMember   = "id3";
            cmbStdSecond.Text          = "";

            this.txtStdCode.Text = "";
            this.txtStdCode.Text = "2." + this.cmbStdFirst.SelectedValue + "."
                                   + string.Join("", strArrayStd) + "."
                                   + this.txtStdSerialNum.Text;
        }