Exemple #1
0
        public ActionResult Edit(int id, UserAccessViewModel objEntity)
        {
            var objUserAccessRepository = new UserAccessRepository();

            if (ModelState.IsValid)
            {
                // objEntity.Name = objEntity.Name.Trim();

                objEntity.UserAccessId = (Int16)id;


                objEntity = objUserAccessRepository.Update(RoleFlags.UpdateByID.GetHashCode(), objEntity);
                if (objEntity.Result == ResultFlags.Success.GetHashCode())
                {
                    this.Flash("success", "UserAccess Details updated successfully");
                    //reload all new setting
                    MenuHelpers.SetMenuByRoleMaster();
                    MenuHelpers.SetMenuByRoleMain();
                    return(RedirectToAction("Index"));
                }
                else if (objEntity.Result == ResultFlags.Failure.GetHashCode())
                {
                    this.Flash("error", "UserAccess Details failed to Update");
                }
            }


            return(View(objEntity));
        }