Exemplo n.º 1
0
        public ActionResult Save()
        {
            Role role = new Role();

            try
            {
                string stated = Request.Form["stated"];
                role.Id         = Convert.ToInt32(Request.Form["Id"]);
                role.roleName   = Request.Form["roleName"];
                role.roleRemark = Request.Form["roleRemark"];

                RoleBLL rbll = new RoleBLL();
                if (stated == "add")
                {
                    if (rbll.AddEntity(role))
                    {
                        return(Content("{'success':'ok'}"));
                    }
                }
                else if (stated == "update")
                {
                    if (rbll.ModifyEntity(role))
                    {
                        return(Content("{'success':'ok'}"));
                    }
                }
            }
            catch { }
            return(Content("{}"));
        }