private void btnSave_Click(object sender, EventArgs e) { DAL.clsCompany cp = new DAL.clsCompany(); int er = 0; er += txtName.txtValidate(); er += txtContactPerson.txtValidate(); er += txtContact.txtValidate(); er += txtAddress.txtValidate(); if (er == 0) { cp.Name = txtName.txtTextValue; cp.ContactPerson = txtContactPerson.txtTextValue; cp.Contact = txtContact.txtTextValue; cp.Email = txtEmail.txtTextValue; cp.Address = txtAddress.txtTextValue; cp.CreateDateTime = dptDateTime.Value; if (cp.Insert()) { MessageBox.Show("Company Is registered!!"); txtName.txtTextValue = ""; txtContactPerson.txtTextValue = ""; txtContact.txtTextValue = ""; txtEmail.txtTextValue = ""; txtAddress.txtTextValue = ""; txtName.Focus(); } else { MessageBox.Show(cp.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.clsCompany cp = new DAL.clsCompany(); cp.Name = txtSearch.Text; dgvData.DataSource = cp.Select().Tables[0]; }