public ActionResult Edit(Guid id) { CommonRoleInfo entity = CommonRoleInfoService.GetModel(id); var model = Mapper.Map <CommonRoleInfoDTO>(entity); return(View(model)); }
public ActionResult Authorization(Guid userId) { ViewBag.userId = userId; var roles = CommonRoleInfoService.GetModels(); var urs = CommonUserRoleService.GetModels("userid=@userid", new Dictionary <string, object>() { { "@userid", userId } }); ViewBag.roles = roles; ViewBag.urs = urs; return(View()); }
public ActionResult Index(int?page) { int p = page ?? 1; int total = 0; var models = CommonRoleInfoService.GetModels(p, 5, string.Empty, "CreateDate", null); PageModel pm = Kernel.CreatePageModel(5, p, models.TotalCount); var dtos = Mapper.Map <List <CommonRoleInfoDTO> >(models.Models); ViewBag.PM = pm; if (dtos == null) { dtos = new List <CommonRoleInfoDTO>(); } return(View(dtos)); }
public ActionResult Create(CommonRoleInfoDTO model) { try { var entity = Mapper.Map <CommonRoleInfo>(model); entity.Id = Guid.NewGuid(); entity.CreateDate = DateTime.Now; entity.ModifyDate = null; CommonRoleInfoService.Add(entity); return(View("jump")); } catch { return(View()); } }
public ActionResult Edit(CommonRoleInfoDTO model) { try { var entity = CommonRoleInfoService.GetModel(model.Id); entity.Code = model.Code; entity.IsEnable = model.IsEnable; entity.IsSysDefault = model.IsSysDefault; entity.ModifyDate = DateTime.Now; entity.Name = model.Name; CommonRoleInfoService.Modify(entity); return(View("jump")); } catch { return(View()); } }
public ActionResult Delete(Guid id) { CommonRoleInfoService.Delete(id); return(RedirectToAction("Index")); }