Esempio n. 1
0
 public ActionResult Create(Congregation model)
 {
     if (ModelState.IsValid)
     {
         dataContext.Create<Congregation>(model);
         Success("Your information was saved!");
         return RedirectToAction("Index");
     }
     Error("there were some errors in your form.");
     return View(model);
 }
Esempio n. 2
0
 public ActionResult Edit(Congregation model, int id)
 {
     if(ModelState.IsValid)
     {
         //_models.Remove(_models.Get(id));
         //model.Id = id;
         //_models.Add(model);
         var oldModel = dataContext.ExecuteStoredProcedure<Congregation>("api_Example_GetSingleCongregation", new { CongregationID = id }).SingleOrDefault();
         dataContext.Update<Congregation>(oldModel, model);
         Success("The model was updated!");
         return RedirectToAction("index");
     }
     return View("Create", model);
 }