コード例 #1
0
        public void ItemsLoad()
        {
            cmbUnit.Properties.Items.Clear();
            cmbBrand_name.Properties.Items.Clear();
            cmbItem_category.Properties.Items.Clear();

            ProductData Prod = new ProductData();

            Prod.FnConn();
            txtProduct_code.Text = "ID-C:000000" + (Convert.ToInt16(Prod.GetMaxValue()) + 1);
            Prod.FnTrans();

            //Combobox UM
            CreateUMData UM = new CreateUMData();

            UM.FnConn();
            DataTable dtUM = UM.FillData();

            UM.FnTrans();

            foreach (DataRow dr in dtUM.Rows)
            {
                cmbUnit.Properties.Items.Add(dr["unitName"] + "");
            }

            //Combobox Brand
            NewBrandData NewBrand = new NewBrandData();

            NewBrand.FnConn();
            DataTable dtBrand = NewBrand.FillData();

            NewBrand.FnTrans();

            foreach (DataRow dr in dtBrand.Rows)
            {
                cmbBrand_name.Properties.Items.Add(dr["brandName"] + "");
            }

            //Combobox Category
            CategoryData Cat = new CategoryData();

            Cat.FnConn();
            DataTable dtCat = Cat.FillData();

            Cat.FnTrans();

            foreach (DataRow dr in dtCat.Rows)
            {
                cmbItem_category.Properties.Items.Add(dr["category"] + "");
            }
        }