Exemplo n.º 1
0
 public ActionResult SaveInfoType(InfoType infoType)
 {
     if (ModelState.IsValid)
     {
         infoType.Id = Guid.NewGuid();
         repository.SaveInfoType(infoType);
         return Redirect("Index");
     }
     else
     {
         return View("EditinfoType", infoType);
     }
 }
Exemplo n.º 2
0
 public ActionResult SaveInfoType(InfoType infoType)
 {
     if (ModelState.IsValid)
     {
         using (var session = sessionFactory.OpenSession())
         using (var tx = session.BeginTransaction())
         {
             session.SaveOrUpdate(infoType);
             tx.Commit();
         }
         return Redirect("Index");
     }
     else
     {
         return View("EditinfoType", infoType);
     }
 }
Exemplo n.º 3
0
 public void SaveInfoType(InfoType infoType)
 {
     context.InfoType.Add(infoType);
     context.SaveChanges();
 }