public async Task <ActionResult> Config_Partial(Model model) { using (ConfigDataProvider dataProvider = new ConfigDataProvider()) { ConfigData 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); return(FormProcessed(model, this.__ResStr("okSaved", "Messenger Settings saved"))); } }
public async Task <ActionResult> Config_Partial(Model model) { using (ConfigDataProvider configDP = new ConfigDataProvider()) { ConfigData data = await configDP.GetItemAsync();// get the original item if (data == null) { throw new Error(this.__ResStr("alreadyDeleted", "The currency converter configuration has been removed and can no longer be updated.")); } 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 configDP.UpdateConfigAsync(data); // save updated item return(FormProcessed(model, this.__ResStr("okSaved", "Currency converter configuration saved"))); } }