private void btnSave_Click(object sender, EventArgs e) { int er = 0; if (txtName.Text == "") { er++; ep.SetError(txtName, "Required"); } if (er > 0) { return; } DAL.Brand brand = new DAL.Brand(); brand.Name = txtName.Text; brand.Description = txtDescription.Text; if (brand.Insert()) { MessageBox.Show("Data Saved"); MyControls.Helper.clear(this); txtName.Focus(); } else { MessageBox.Show(brand.Error); } }
private void frmProductNew_Load(object sender, EventArgs e) { DAL.Brand b = new DAL.Brand(); DAL.Category c = new DAL.Category(); cmbBrand.Source(b.Select()); cmbCategory.Source(c.Select()); MyControls.Helper.Numeric(txtDiscount); }
private void frmProduct_Load(object sender, EventArgs e) { DAL.Brand b = new DAL.Brand(); cmbBrand.DataSource = b.Select().Tables[0]; cmbBrand.DisplayMember = "name"; cmbBrand.ValueMember = "id"; cmbBrand.SelectedValue = -1; DAL.Category c = new DAL.Category(); cmbCategory.DataSource = c.Select().Tables[0]; cmbCategory.DisplayMember = "name"; cmbCategory.ValueMember = "id"; cmbCategory.SelectedValue = -1; }
private void btnSearch_Click(object sender, EventArgs e) { DAL.Brand brand = new DAL.Brand(); dgvData.DataSource = brand.Select().Tables[0]; }