Ejemplo n.º 1
0
 public ActionResult Index()
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var calisanlar = session.Query <Models.Calisanlar>().ToList();
         return(View(calisanlar));
     }
 }
Ejemplo n.º 2
0
 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));
     }
 }
Ejemplo n.º 3
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));
     }
 }
Ejemplo n.º 4
0
 public ActionResult Index()
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var departmanlar = session.Query <Models.Departmanlar>().Fetch(x => x.Calisanlar).ToList();
         return(View(departmanlar));
     }
 }
Ejemplo n.º 5
0
 public ActionResult Create(Models.Calisanlar calisan)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         session.SaveOrUpdate(calisan);
         session.Flush();
     }
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 6
0
 public IList <int> departmanlariAl()
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var departmanListe = session.CreateSQLQuery("SELECT Departman_ID FROM Departmanlar").List <int>();
         session.Flush();
         return(departmanListe);
     }
 }
Ejemplo n.º 7
0
 public ActionResult Delete(int id)
 {
     using (var session = NhibernateHelper.OpenSession())
     {
         var calisan = session.Query <Models.Calisanlar>().FirstOrDefault(x => x.Personel_ID == id);
         session.Delete(calisan);
         session.Flush();
     }
     return(RedirectToAction("Index"));
 }
Ejemplo 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"));
 }
Ejemplo n.º 9
0
 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"));
 }