Ejemplo n.º 1
0
 public ActionResult Create(Models.Departmanlar departman)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         session.SaveOrUpdate(departman);
         session.Flush();
     }
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 2
0
 public ActionResult Edit(int id, Models.Departmanlar departman)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var yeniDepartman = session.Query <Models.Departmanlar>().FirstOrDefault(x => x.Departman_ID == id);
         yeniDepartman.Departman_Ad = departman.Departman_Ad;
         yeniDepartman.Telefon      = departman.Telefon;
         session.SaveOrUpdate(yeniDepartman);
         session.Flush();
     }
     return(RedirectToAction("Index"));
 }