示例#1
0
 public ActionResult Edit(Organisator organisator)
 {
     if (ModelState.IsValid)
     {
         dm.Organisator_Edit(organisator);
         dm.Save();
         return RedirectToAction("Index");
     }
     return View(organisator);
 }
示例#2
0
        public ActionResult Create(Organisator organisator)
        {
            if (ModelState.IsValid)
            {
                organisator.ID = Guid.NewGuid();
                dm.Organisator_Create(organisator);
                dm.Save();
                return RedirectToAction("Index");
            }

            return View(organisator);
        }
示例#3
0
 public ActionResult DeleteConfirmed(Organisator organistor)
 {
     dm.Organisator_Delete(organistor);
     return RedirectToAction("Index");
 }
示例#4
0
 public Organisator Organisator_Edit(Organisator obj)
 {
     db.Entry(obj).State = EntityState.Modified;
     db.SaveChanges();
     obj = db.Organisators.SingleOrDefault(o => o.ID == obj.ID);
     return obj;
 }
示例#5
0
 public Organisator Organisator_Delete(Organisator obj)
 {
     Organisator organisator = db.Organisators.SingleOrDefault(o => o.ID == obj.ID);
     db.Organisators.Remove(organisator);
     db.SaveChanges();
     return organisator;
 }
示例#6
0
 public Organisator Organisator_Create(Organisator obj)
 {
     obj.ID = Guid.NewGuid();
     db.Organisators.Add(obj);
     db.SaveChanges();
     obj = db.Organisators.FirstOrDefault(o => o.ID == obj.ID);
     return obj;
 }