示例#1
0
        public async Task <ActionResult> AuditConfig()
        {
            using (AuditConfigDataProvider dataProvider = new AuditConfigDataProvider()) {
                Model model          = new Model {
                };
                AuditConfigData data = await dataProvider.GetItemAsync();

                if (data == null)
                {
                    throw new Error(this.__ResStr("notFound", "The audit settings could not be found"));
                }
                model.SetData(data);
                return(View(model));
            }
        }
示例#2
0
        public async Task <ActionResult> AuditConfig_Partial(Model model)
        {
            using (AuditConfigDataProvider dataProvider = new AuditConfigDataProvider()) {
                AuditConfigData 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", "Audit settings saved"), NextPage: Manager.ReturnToUrl));
            }
        }