示例#1
0
        // GET: /RoleDetail/Details/5
        public ActionResult Details(int id)
        {
            UserPermissionAction("RoleDetail", RoleAction.detail.ToString());
            CheckPermission();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RoleDetail roeldetails = _RoleDetailService.GetRoleDetail(id);

            Mapper.CreateMap <EveryWhereCars.Entity.RoleDetail, EveryWhereCars.Models.RoleDetailModel>();

            EveryWhereCars.Models.RoleDetailModel roledetailmodel = Mapper.Map <EveryWhereCars.Entity.RoleDetail, EveryWhereCars.Models.RoleDetailModel>(roeldetails);
            RoleModel rolemodel = new RoleModel();

            rolemodel.RoleName   = _RoleService.GetRole(roledetailmodel.RoleId).RoleName;
            roledetailmodel.Role = rolemodel;
            FormModel formmodel = new FormModel();

            formmodel.FormName   = _FormService.GetForm(roledetailmodel.FormId).FormName;
            roledetailmodel.form = formmodel;
            if (roledetailmodel == null)
            {
                return(HttpNotFound());
            }
            return(View(roledetailmodel));
        }
示例#2
0
        // GET: /RoleDetail/Edit/5
        public ActionResult Edit(int id)
        {
            UserPermissionAction("RoleDetail", RoleAction.edit.ToString());
            CheckPermission();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RoleDetail roeldetails = _RoleDetailService.GetRoleDetail(id);

            Mapper.CreateMap <EveryWhereCars.Entity.RoleDetail, EveryWhereCars.Models.RoleDetailModel>();
            EveryWhereCars.Models.RoleDetailModel roledetailmodel = Mapper.Map <EveryWhereCars.Entity.RoleDetail, EveryWhereCars.Models.RoleDetailModel>(roeldetails);
            if (roledetailmodel == null)
            {
                return(HttpNotFound());
            }

            ViewBag.FormId = new SelectList(_FormService.GetForms(), "FormId", "FormName", roledetailmodel.FormId);
            ViewBag.RoleId = new SelectList(_RoleService.GetRoles(), "RoleId", "RoleName", roledetailmodel.RoleId);
            return(View(roledetailmodel));
        }