예제 #1
0
 public ActionResult Edit([Bind(Include = "ID,UseSyncromatics")] AppSettings appSettings)
 {
     if (ModelState.IsValid)
     {
         using (var db = new TrolleyTrackerContext())
         {
             db.Entry(appSettings).State = EntityState.Modified;
             db.SaveChanges();
             AppSettingsInterface.UpdateSettings(appSettings);
             return(RedirectToAction("Index"));
         }
     }
     return(View(appSettings));
 }
예제 #2
0
        public ActionResult Create([Bind(Include = "ID,UseSyncromatics")] AppSettings appSettings)
        {
            if (ModelState.IsValid)
            {
                using (var db = new TrolleyTrackerContext())
                {
                    db.AppSettings.Add(appSettings);
                    db.SaveChanges();
                }
                AppSettingsInterface.UpdateSettings(appSettings);
                return(RedirectToAction("Index"));
            }

            return(View(appSettings));
        }