示例#1
0
 public ActionResult AddFromTxt(TxtFile model)
 {
     if (ModelState.IsValid)
     {
         using (var db = new DomainContext())
         {
             var result = db.Auditories.AddListFromTxt(model.Txt);
             db.SaveChanges();
             ViewBag.Result = result;
             return View();
         }
     }
     return View(model);
 }
示例#2
0
        public ActionResult Create(Lector lector)
        {
            if (ModelState.IsValid)
            {
                using (var db = new DomainContext())
                {
                    db.Lectors.Add(lector);
                    db.SaveChanges();
                    return RedirectToAction("Index");
                }
            }

            return View(lector);
        }
示例#3
0
 public ActionResult DeleteConfirmed(int id)
 {
     using (var db = new DomainContext())
     {
         db.Lectors.Remove(id);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
 }