public JsonResult AddUpd(Model.ProductCategory pcategory) { string strResult = "FAIL"; if (pcategory.CategoryName != null) { MoyeBuy.Com.BLL.ProductCategory category = new BLL.ProductCategory(); if (category.AddUpdateProductCatgory(pcategory)) { strResult = "SUCCESS"; } } return(Json(strResult)); }
public JsonResult Del(string strCategoryID) { string strResult = "FAIL"; if (strCategoryID != "") { MoyeBuy.Com.BLL.ProductCategory category = new BLL.ProductCategory(); if (category.DelProductCatgory(strCategoryID)) { strResult = "SUCCESS"; } } return(Json(strResult)); }
private void SaveButton_Click(object sender, EventArgs e) { string code = codeTextBox.Text.Trim(); string name = nameTextBox.Text.Trim(); if (!CheckValidation(code, name)) { MessageBox.Show("Invalid Inputs"); } Models.ProductCategory productCategory = new Models.ProductCategory(); productCategory.Code = code; productCategory.CategoryName = name; BLL.ProductCategory _productCategory = new BLL.ProductCategory(); if (!_productCategory.AddProductCategory(productCategory)) { return; } DisplayProductCategories(); }
private void DisplayProductCategories() { BLL.ProductCategory _productCategory = new BLL.ProductCategory(); categoriesDataGridView.DataSource = _productCategory.GetProductCategories(); }