示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            DAL.clsUnit u  = new DAL.clsUnit();
            int         er = 0;

            er += txtName.txtValidate();
            er += txtDescription.txtValidate();
            er += txtPrimaryQty.txtValidate();

            if (er == 0)
            {
                u.Name        = txtName.txtTextValue;
                u.Description = txtDescription.txtTextValue;
                u.PrimaryQty  = txtPrimaryQty.txtIntValue;

                if (u.Insert())
                {
                    MessageBox.Show("New Unit Inserted !!");
                    txtName.txtTextValue        = "";
                    txtDescription.txtTextValue = "";
                    txtPrimaryQty.txtTextValue  = "";
                    txtName.Focus();
                }

                else
                {
                    MessageBox.Show(u.Error);
                }
            }
        }
示例#2
0
        private void frmProductNew_Load(object sender, EventArgs e)
        {
            DAL.clsCategory ctg = new DAL.clsCategory();
            cmbCategoryId.setDataSource(ctg.Select());

            DAL.clsCompany cp = new DAL.clsCompany();
            cmbCompanyId.setDataSource(cp.Select());

            DAL.clsDiscount ds = new DAL.clsDiscount();
            cmbDiscountId.setDataSource(ds.Select());

            DAL.clsGroup gr = new DAL.clsGroup();
            cmbGroupId.setDataSource(gr.Select());

            DAL.clsPower pr = new DAL.clsPower();
            cmbPowerId.setDataSource(pr.Select());

            DAL.clsSaleStatus st = new DAL.clsSaleStatus();
            cmbSaleStatusId.setDataSource(st.Select());

            DAL.clsUnit u = new DAL.clsUnit();
            cmbUnitId.setDataSource(u.Select());
        }
示例#3
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     DAL.clsUnit u = new DAL.clsUnit();
     dgvData.DataSource = u.Select().Tables[0];
 }