public ActionResult Create(AccountGroup category)
        {
            var result = category;

            if (ModelState.IsValid)
            {
                category.IsDefault = false;
                result             = service.Save(category);
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public ActionResult Create(AccountGroup category)
        {
            var result = category;

            if (ModelState.IsValid)
            {
                if (string.IsNullOrEmpty(category.AccountGroupName))
                {
                    return(Json("Please input a valid name", JsonRequestBehavior.AllowGet));
                }
                if (category.GroupUnder < 0)
                {
                    return(Json("Please select accounting Head", JsonRequestBehavior.AllowGet));
                }
                category.IsDefault = false;
                result             = service.Save(category);
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }