public frm_Products_Edit(int PID, string PName, int PUID, int PCID, string PDesc, string Pbarcode, string Pmanuf, int PStock, int PSold, int PMin, int PBPrice, int PPrice, int PDiscount, DateTime PExpDate, string PSize)
        {
            InitializeComponent();

            frm_Units.frm_Units_Class frmUnits = new frm_Units.frm_Units_Class();
            jscComboBox3.DataSource    = frmUnits.DBSelect();
            jscComboBox3.DisplayMember = "ProductsUnit";
            jscComboBox3.ValueMember   = "ProductsUnitID";

            frm_Category_Class frmCategory = new frm_Category_Class();

            jscComboBox1.DataSource    = frmCategory.DBSelect();
            jscComboBox1.DisplayMember = "ProductCategory";
            jscComboBox1.ValueMember   = "ProductCategoryID";

            this.RelatedClass._PBarCode = Pbarcode;
            this.RelatedClass._PID      = PID;
            // main fields
            jscTextBox1.Text           = PName;
            jscTextBox2.Text           = PPrice.ToString();
            jscTextBox3.Text           = PDiscount.ToString();
            jscTextBox4.Text           = PBPrice.ToString();
            jsBarCodeBox1.Text         = Pbarcode.ToString();
            jscComboBox1.SelectedValue = PCID;
            jscComboBox3.SelectedValue = PUID;
            jscTextBox7.Text           = PSize;

            // second fields
            jscTextBox5.Text    = PStock.ToString();
            jscTextBox6.Text    = PMin.ToString();
            jscTextBox8.Text    = Pmanuf.ToString();
            jscTextBox10.Text   = PDesc.ToString();
            maskedTextBox1.Text = PExpDate.ToString();        //check this ***
        }
예제 #2
0
        private void FrmProductsAddLoad(object sender, EventArgs e)
        {
            var frmCategory = new frm_Category_Class();

            jscComboBox1.DataSource    = frmCategory.DBSelect();
            jscComboBox1.DisplayMember = "ProductCategory";
            jscComboBox1.ValueMember   = "ProductCategoryID";

            var frmUnits = new frm_Units.frm_Units_Class();

            jscComboBox3.DataSource    = frmUnits.DBSelect();
            jscComboBox3.DisplayMember = "ProductsUnit";
            jscComboBox3.ValueMember   = "ProductsUnitID";
        }