Exemplo n.º 1
0
        public async Task <ActionResult> LoginConfig_Partial(Model model)
        {
            using (LoginConfigDataProvider dataProvider = new LoginConfigDataProvider()) {
                LoginConfigData data = await dataProvider.GetItemAsync();// get the original item

                if (!ModelState.IsValid)
                {
                    return(PartialView(model));
                }
                data = model.GetData(data); // merge new data into original
                model.SetData(data);        // and all the data back into model for final display
                await dataProvider.UpdateConfigAsync(data);

                Manager.Need2FAState = null;// we may have changed two-step auth settings, so re-evaluate
                return(FormProcessed(model, this.__ResStr("okSaved", "Configuration settings saved")));
            }
        }