Example #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Description,ImageId")] AMUserType UserT)
 {
     if (!ModelState.IsValid)
     {
         return(View(UserT));
     }
     if (DMLObj.UserTypeEditById(UserT))
     {
         return(RedirectToAction("Index", "SysAdmin"));
     }
     return(View(UserT));
 }
Example #2
0
        public ActionResult Delete([Bind(Include = "Id,Name,Description,ImageId")] AMUserType UserTObj)
        {
            int CurrentId = 0;

            Int32.TryParse(UserTObj.Id.ToString(), out CurrentId);
            if (CurrentId == 0)
            {
                return(View("Error"));
            }
            if (!DMLObj.UserTypeHasUser(CurrentId) && DMLObj.DeleteUserTypeById(CurrentId))
            {
                return(RedirectToAction("Index", "SysAdmin"));
            }
            return(View("Error"));
        }
Example #3
0
        public ActionResult Add([Bind(Include = "Name,Description,ImageId")] AMUserType UserT)
        {
            if (!ModelState.IsValid)
            {
                return(View(UserT));
            }
            bool resAdd     = false;
            var  addedUserT = DMLObj.AddNewUserType(UserT, out resAdd);

            if (resAdd)
            {
                return(RedirectToAction("Index", "SysAdmin"));
            }
            return(View(UserT));
        }