private void btnSave_Click(object sender, EventArgs e) { DAL.clsGroup gr = new DAL.clsGroup(); int er = 0; er += txtName.txtValidate(); if (er == 0) { gr.Name = txtName.txtTextValue; gr.Description = txtDescription.txtTextValue; if (gr.Insert()) { MessageBox.Show("Group Inserted !!"); txtName.txtTextValue = ""; txtDescription.txtTextValue = ""; txtName.Focus(); } else { MessageBox.Show(gr.Error); } } }
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()); }
private void btnSearch_Click(object sender, EventArgs e) { DAL.clsGroup gr = new DAL.clsGroup(); gr.Name = txtSearch.Text; dgvData.DataSource = gr.Select().Tables[0]; }