Exemplo n.º 1
0
 public bool DeleteRole(Role entity)
 {
     if (entity == null) return false;
     _unitOfWork.RoleRepository.Delete(entity);
     _unitOfWork.Save();
     return true;
 }
Exemplo n.º 2
0
        public ActionResult Create(Role role)
        {
            if (ModelState.IsValid)//testing(role))//
            {
                _roleService.AddRole(role);
                return Json(new { success = true });
            }

            ViewBag.UserProfileID = new SelectList(_roleService.GetAllRole(), "RoleID", "RoleID", role.RoleID);
            return PartialView(BindRoleModel(role));
        }
Exemplo n.º 3
0
 private RoleModel BindRoleModel(Role role)
 {
     RoleModel roleModel = new RoleModel
                               {
                                   Description = role.Description,
                                   Name = role.Name,
                                   RoleID = role.RoleID,
                                   SortOrder = role.SortOrder
                               };
     return roleModel;
 }
Exemplo n.º 4
0
 public bool testing(Role role)
 {
     return TryValidateModel(role);
 }
Exemplo n.º 5
0
        public ActionResult Edit(Role role)
        {
            if (ModelState.IsValid)
            {
                _roleService.EditRole(role);

                return Json(new { success = true });
            }
            ViewBag.UserProfileID = new SelectList(_roleService.GetAllRole(), "RoleID", "RoleID", role.RoleID);
            return PartialView("Edit", role);
        }
Exemplo n.º 6
0
Arquivo: Role.cs Projeto: FishAbe/cats
 public static void AddRole(Role role)
 {
     //CTSContext entities = new CTSContext();
     //entities.Roles.Add(role);
     //entities.SaveChanges();
 }
Exemplo n.º 7
0
 public bool EditRole(Role entity)
 {
     _unitOfWork.RoleRepository.Edit(entity);
     _unitOfWork.Save();
     return true;
 }
Exemplo n.º 8
0
 public bool AddRole(Role entity)
 {
     _unitOfWork.RoleRepository.Add(entity);
     _unitOfWork.Save();
     return true;
 }