Example #1
0
 public ActionResult Edit(SpaceModel data)
 {
     bool result = repository.Edit(data);
     if (result == false)
         return View(data);
     return RedirectToAction("Index", "Home");
 }
Example #2
0
 public bool Add(SpaceModel data)
 {
     using (var DB = new MainContext())
     {
         DB.Spaces.Add(data);
         DB.SaveChanges();
         return true;
     }
     return false;
 }
Example #3
0
 public bool Edit(SpaceModel data)
 {
     using (var DB = new MainContext())
     {
         DB.Spaces.Attach(data);
         DB.Entry(data).State = System.Data.Entity.EntityState.Modified;
         DB.SaveChanges();
         return true;
     }
     return false;
 }