public ActionResult <RefProductCategories> editRefProductCategories([FromBody] RefProductCategories RPC, string id) { bool boolAdd = _resRefProductCategories.EditRefProductCategories(id, RPC); if (boolAdd) { return(Ok(boolAdd)); } return(Ok(_errorEdit)); }
public ActionResult <RefProductCategories> createRefProductCategories([FromBody] RefProductCategories RPC) { bool boolAdd = _resRefProductCategories.CreateRefProductCategories(RPC); if (boolAdd) { return(Ok(boolAdd)); } return(Ok(_errorAdd)); }
public bool CreateRefProductCategories(RefProductCategories RPC) { try { var addCustome = db.RefProductCategories.Add(RPC); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool EditRefProductCategories(string id, RefProductCategories RPC) { var findIdRefProductCategories = db.RefProductCategories.Find(id); if (findIdRefProductCategories != null) { findIdRefProductCategories.ProductCategoryDescription = RPC.ProductCategoryDescription; db.SaveChanges(); return(true); } else { return(false); } }