Esempio n. 1
0
 public ActionResult Edit(int id)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var departman = session.Query <Models.Departmanlar>().FirstOrDefault(x => x.Departman_ID == id);
         return(View(departman));
     }
 }
Esempio n. 2
0
 public ActionResult Index()
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var departmanlar = session.Query <Models.Departmanlar>().Fetch(x => x.Calisanlar).ToList();
         return(View(departmanlar));
     }
 }
 public ActionResult Edit(int id)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var calisan = session.Query <Models.Calisanlar>().FirstOrDefault(x => x.Personel_ID == id);
         return(View(calisan));
     }
 }
 public ActionResult Index()
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var calisanlar = session.Query <Models.Calisanlar>().ToList();
         return(View(calisanlar));
     }
 }
Esempio n. 5
0
 public ActionResult Create(Models.Departmanlar departman)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         session.SaveOrUpdate(departman);
         session.Flush();
     }
     return(RedirectToAction("Index"));
 }
 public IList <int> departmanlariAl()
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var departmanListe = session.CreateSQLQuery("SELECT Departman_ID FROM Departmanlar").List <int>();
         session.Flush();
         return(departmanListe);
     }
 }
Esempio n. 7
0
 public ActionResult Delete(int id)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var departman = session.Query <Models.Departmanlar>().FirstOrDefault(x => x.Departman_ID == id);
         session.Delete(departman);
         session.Flush();
     }
     return(RedirectToAction("Index"));
 }
Esempio n. 8
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"));
 }
 public ActionResult Edit(int id, Models.Calisanlar calisan)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var yeniCalisan = session.Query <Models.Calisanlar>().FirstOrDefault(x => x.Personel_ID == id);
         yeniCalisan.Ad_Soyad  = calisan.Ad_Soyad;
         yeniCalisan.TC_Kimlik = calisan.TC_Kimlik;
         yeniCalisan.Unvan     = calisan.Unvan;
         session.SaveOrUpdate(yeniCalisan);
         session.Flush();
     }
     return(RedirectToAction("Index"));
 }