public ActionResult UpdateProductType(ZZ_Category item) { BS.UpdateProductType(item); return(new JsonResult() { Data = "OK" }); }
public bool AddProductType(ZZ_Category item) { var r = true; using (var uow = GetUnitOfWork()) { var maxCategoryId = uow.Repository <ZZ_Category>().Query().Get().Select(x => x.CategoryId).OrderByDescending(x => x).FirstOrDefault(); maxCategoryId += 1; item.CategoryId = maxCategoryId; uow.Repository <ZZ_Category>().Insert(item); uow.Save(); } return(r); }
public bool UpdateProductType(ZZ_Category item) { var result = true; using (var uow = GetUnitOfWork()) { var order = uow.Repository <ZZ_Category>().Find(item.CategoryId); if (order != null) { order.Name = item.Name; order.Description = item.Description; order.UnitPrice = item.UnitPrice; uow.Repository <ZZ_Category>().Update(order); uow.Save(); } else { return(false); } } return(result); }