コード例 #1
0
        private void FrmProductsAddLoad(object sender, EventArgs e)
        {
            var frmCategory = new FrmCategoryClass();

            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";

            if (Owner == null)
            {
                jsBarCodeBox1.Text = Barcode;
            }
        }
コード例 #2
0
        public FrmProductsEdit(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();

            var frmUnits = new frm_Units.frm_Units_Class();

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

            var frmCategory = new FrmCategoryClass();

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

            _relatedClass._PBarCode = pbarcode;
            _relatedClass._PID      = pid;
            // main fields
            jscTextBox1.Text           = pName;
            jscTextBox2.Text           = pPrice.ToString();
            jscTextBox3.Text           = pDiscount.ToString();
            jscTextBox4.Text           = pbPrice.ToString();
            jsBarCodeBox1.Text         = pbarcode;
            jscComboBox1.SelectedValue = pcid;
            jscComboBox3.SelectedValue = puid;
            jscTextBox7.Text           = pSize;

            // second fields
            jscTextBox5.Text    = pStock.ToString();
            jscTextBox6.Text    = pMin.ToString();
            jscTextBox8.Text    = pmanuf;
            jscTextBox10.Text   = pDesc;
            maskedTextBox1.Text = pExpDate.ToString();        //check this ***

            ActiveControl = jscTextBox2;
        }