Exemplo n.º 1
0
 internal static BllRole ToBllRole(RoleModel rolemodel)
 {
     if (rolemodel!=null) return new BllRole()
     {
         Id = rolemodel.Id,
         Name = rolemodel.Name,
         Description = rolemodel.Description
     };
     return null;
 }
Exemplo n.º 2
0
 public ActionResult UpdateRole(RoleModel rolemodel)
 {
     if (ModelState.IsValid)
     {
         if (adminservice.RoleExists(rolemodel.Name))
         {
             adminservice.UpdateRoleForUser(Maper.ToBllRole(rolemodel));
         }
         else Response.StatusCode = 400;
     }
     else ModelState.AddModelError("", "Неправильный ввод данных");
     var roles = adminservice.GetAllRoles();
     return View("_ShowAllRoles", roles.Select(role => Maper.ToRoleModel(role)));
 }