public IHttpActionResult GetRoleByID(int RoleId) { var role = _RoleService.GetRole(RoleId); Mapper.CreateMap <CommunicationApp.Entity.Role, CommunicationApp.Models.RoleModel>(); CommunicationApp.Models.RoleModel rolemodel = Mapper.Map <CommunicationApp.Entity.Role, CommunicationApp.Models.RoleModel>(role); return(Json(rolemodel)); }
public ActionResult Details(int Id) { UserPermissionAction("role", RoleAction.detail.ToString()); //Check User Permission CheckPermission(); Role role = _RoleService.GetRole(Id); Mapper.CreateMap <CommunicationApp.Entity.Role, CommunicationApp.Models.RoleModel>(); CommunicationApp.Models.RoleModel rolemodel = Mapper.Map <CommunicationApp.Entity.Role, CommunicationApp.Models.RoleModel>(role); return(View(rolemodel)); }
public ActionResult Edit(int id) { UserPermissionAction("role", RoleAction.edit.ToString()); //Check User Permission CheckPermission(); if (id <= 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Role role = _RoleService.GetRole(id); Mapper.CreateMap <CommunicationApp.Entity.Role, CommunicationApp.Models.RoleModel>(); CommunicationApp.Models.RoleModel rolemodel = Mapper.Map <CommunicationApp.Entity.Role, CommunicationApp.Models.RoleModel>(role); ViewBag.RoleType = new SelectList(_RoleService.GetRoles(), "RoleId", "RoleType", role.RoleId); ViewBag.Rolelist = new SelectList(_RoleService.GetRoles(), "RoleId", "RoleType", role.RoleId); //ViewBag.Citylist = new SelectList(_CityService.GetCities(), "CityID", "CityName", company.CityID); return(View(rolemodel)); }