Exemple #1
0
        public ActionResult Create(Section section)
        {
            if (ModelState.IsValid)
            {
                _work.Section.Insert(section);
                _work.Save();
                return RedirectToAction("Index");
            }

            return View(section);
        }
Exemple #2
0
 public ActionResult Edit(Section section)
 {
     if (ModelState.IsValid)
     {
         Section sec = _work.Section.GetById(section.sec_id);
         sec.sec_name = section.sec_name;
         _work.Save();
         return RedirectToAction("Index");
     }
     ViewBag.batch_id = new SelectList(_work.Batch.GetAll(), "batch_id", "batch_name");
     return View(section);
 }