Esempio n. 1
0
        public async Task <ActionResult> TwilioConfig()
        {
            using (TwilioConfigDataProvider dataProvider = new TwilioConfigDataProvider()) {
                Model model     = new Model {
                };
                TwilioData data = await dataProvider.GetItemAsync();

                if (data == null)
                {
                    throw new Error(this.__ResStr("notFound", "The TwilioProcessor settings could not be found"));
                }
                model.SetData(data);
                model.UpdateData(data);
                return(View(model));
            }
        }
Esempio n. 2
0
        public async Task <ActionResult> TwilioConfig_Partial(Model model)
        {
            using (TwilioConfigDataProvider configDP = new TwilioConfigDataProvider()) {
                TwilioData config = await configDP.GetItemAsync();// get the original item

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

                return(FormProcessed(model, this.__ResStr("okSaved", "TwilioProcessor settings saved"), NextPage: Manager.ReturnToUrl));
            }
        }