Esempio n. 1
0
 public ActionResult Modify(ExternalModel model)
 {
     if (ModelState.IsValid)
     {
         SaveChangesToExternalWebService(model);
         return Json(new {  message = MessageCode.modified, code = StatusCode.modified, content = model.SystemCode });
     }
     return RedirectToAction("Index");
 }
Esempio n. 2
0
 private List<ExternalModel> GetAllExternalWebService(Config config)
 {
     List<ExternalModel> list = new List<ExternalModel>();
     foreach (ExternalWebServiceElement element in config.ExternalWebService)
     {
         ExternalModel externalWebService = new ExternalModel();
         externalWebService.Description = element.Description;
         externalWebService.Name = element.Name;
         externalWebService.SystemCode = element.SystemCode;
         externalWebService.URL = element.URL;
         list.Add(externalWebService);
     }
     return list;
 }
Esempio n. 3
0
 private ExternalModel GetExternalWebServiceByName(Config config, string systemCode)
 {
     ExternalModel external = new ExternalModel();
     if (!string.IsNullOrEmpty(systemCode))
     {
         ExternalWebServiceElement element = config.ExternalWebService.OfType<ExternalWebServiceElement>().Where<ExternalWebServiceElement>(x => x.SystemCode.Equals(systemCode)).FirstOrDefault<ExternalWebServiceElement>();
         if (element != null)
         {
             external.Description = element.Description;
             external.Name = element.Name;
             external.SystemCode = element.SystemCode;
             external.URL = element.URL;
         }
     }
     return external;
 }
Esempio n. 4
0
        private void SaveChangesToExternalWebService(ExternalModel model)
        {
            if (model != null)
            {

                ExternalWebServiceElement element = this.config.ExternalWebService.OfType<ExternalWebServiceElement>().Where<ExternalWebServiceElement>(x => x.SystemCode.Equals(model.SystemCode)).First<ExternalWebServiceElement>();
                element.SystemCode = model.SystemCode;
                element.URL = model.URL;
                element.Name = model.Name;
                element.Description = model.Description;
                this.configuration.Save();
            }
        }
Esempio n. 5
0
 public ActionResult Modify(string id)
 {
     ExternalModel model = new ExternalModel();
     model = GetExternalWebServiceByName(this.config, id);
     return View(model);
 }