Пример #1
0
 public ActionResult CreateRanks(DIC_CHAIRS rank)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var s = rank.DCH_NAME;
             if ((from c in ctx.DIC_CHAIRS where c.DCH_NAME == s select c).Any()) { }
             else
             {
                 ctx.DIC_CHAIRS.Add(rank);
                 ctx.SaveChanges();
             }
             return RedirectToAction("AllChairs");
         }
     }
     catch
     {
         return RedirectToAction("Problem");
     }
     return View();
 }
Пример #2
0
 public ActionResult Create()
 {
     DIC_CHAIRS rank = new DIC_CHAIRS();
     return View(rank);
 }