Exemple #1
0
 public ActionResult UpdateProductType(ZZ_Category item)
 {
     BS.UpdateProductType(item);
     return(new JsonResult()
     {
         Data = "OK"
     });
 }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }