Ejemplo n.º 1
0
        public async Task<ActionResult> AddEdit(int? id)
        {
            var model = new RoleAddEditModel();
            this.ViewBag.Title = "添加角色";

            if (id != null)
            {
                var role = await this.PostAsync<RoleDTO>(this.GetAPIAddress("/api/console/Role/GetRole"), new
                {
                    id = id.Value,
                    query = new string[] { "Modules" }
                });

                this.ViewBag.Title = string.Format("编辑角色 - {0}", role.Name);

                model.Id = role.Id;
                model.Name = role.Name;
                model.ModuleIds = role.Modules.Select(m => m.Id);
            }

            return View(model);
        }
Ejemplo n.º 2
0
 public JsonResult AddEdit(RoleAddEditModel model)
 {
     return Json(null);
 }