Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            DAL.clsDiscount ds = new DAL.clsDiscount();
            int             er = 0;

            er += txtDiscount.txtValidate();
            er += txtPersentage.txtValidate();

            if (er == 0)
            {
                ds.Name = txtDiscount.txtTextValue;
                //ds.Persentage = txtPersentage.txtDoubleValue;
                ds.Persentage = txtPersentage.txtFloatValue;
                //ds.Persentage = txtPersentage.txtPersentValue;

                if (ds.Insert())
                {
                    MessageBox.Show("Discount type Inserted !!");
                    txtDiscount.txtTextValue   = "";
                    txtPersentage.txtTextValue = "";
                    txtDiscount.Focus();
                }
                else
                {
                    MessageBox.Show(ds.Error);
                }
            }
        }
Beispiel #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());
        }
Beispiel #3
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     DAL.clsDiscount ds = new DAL.clsDiscount();
     dgvData.DataSource = ds.Select().Tables[0];
 }