コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }