Beispiel #1
0
        public ActionResult Update(string categoryNO, string categoryName, int isService)
        {
            Category category = _categoryBLL.GetCategoryByCategoryNo(categoryNO);

            if (category == null)
            {
                return(Json("False", JsonRequestBehavior.AllowGet));
            }
            else if (string.IsNullOrEmpty(categoryName))
            {
                return(Json("False", JsonRequestBehavior.AllowGet));
            }
            else
            {
                category.Name      = categoryName;
                category.IsService = isService == 1 ? true : false;
                if (_categoryBLL.Save(category))
                {
                    return(Json("True", JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json("False", JsonRequestBehavior.AllowGet));
                }
            }
        }