private void btnAdd_Click(object sender, EventArgs e) { //add brand into table if (textBrandName.Text != "") { if (textDescription.Text != "") { BrandBLL = BrandDAL.checkBrandAvailableOrNot(textBrandName.Text); if (textBrandName.Text != BrandBLL.Brand_Name) { BrandBLL.Brand_Name = textBrandName.Text; BrandBLL.Description = textDescription.Text; bool success = BrandDAL.Insert(BrandBLL); if (success == true) { MessageBox.Show("Brand Inserted Succesfully .!!"); clear(); DataTable dt = BrandDAL.Select(); dgvBrand.DataSource = dt; } else { MessageBox.Show("Failed to insert category :/ "); } } else { MessageBox.Show("Brand is Already Added in Database Please choose another Brand"); } } else { MessageBox.Show("Please Enter Description"); } } else { MessageBox.Show("Please Enter Brnad Name"); } }