예제 #1
0
        public async Task<ActionResult> Create(RoleCreateModel model)
        {
            var role = new Role();


            if (!TryUpdateModel(role, model))
            {
                return Template(model.CreateTemplate(ControllerContext));
            }
            var db = MaintDbContext;

            db.Roles.Add(role);
            await db.SaveChangesAsync();
            await SetFlashAsync(new FlashMessage
            {
                Text = MaintCultureTextResources.SuccessToSave,
                MessageType = FlashMessageType.Success,
            });
            return Create();
        }
예제 #2
0
 public ActionResult Create()
 {
     RoleCreateModel model = new RoleCreateModel();
     return Template(model.CreateTemplate(ControllerContext));
 }