Exemplo n.º 1
0
 public IActionResult Add(RoleDto model)
 {
     if (ModelState.IsValid)
     {
         //更新数据库
         model.CreateTime = DateTime.Now.ToString();
         model.CreateUser = HttpContext.Session.GetString("CurrentUser");
         _roleAppService.AddDto(model);
         //重定向
         return(RedirectToAction("Index", "Role"));
     }
     return(View(model));
 }