public ActionResult CalisanDuzenle(int id)
        {
            calisanConcrete   = new CalisanConcrete();
            departmanConcrete = new DepartmanConcrete();

            ViewBag.DepartmanListesi = departmanConcrete._departmanRepository.GetAll();
            ViewBag.CalisanListesi   = calisanConcrete._calisanRepository.GetEntity().Where(x => x.CalisanID != id).ToList();

            return(View(calisanConcrete._calisanRepository.GetById(id)));
        }
예제 #2
0
        public ActionResult DepartmanSil(int id)
        {
            departmanConcrete = new DepartmanConcrete();

            departmanConcrete._departmanRepository.Delete(id);
            departmanConcrete._departmanUnitOfWork.SaveChanges();
            departmanConcrete._departmanUnitOfWork.Dispose();

            return(RedirectToAction("DepartmanIndex"));
        }
예제 #3
0
 public ActionResult DepartmanIndex()
 {
     if (Session["KullaniciAdi"] != null)
     {
         departmanConcrete = new DepartmanConcrete();
         return(View(departmanConcrete._departmanRepository.GetAll()));
     }
     else
     {
         return(RedirectToAction("Giris", "Yonetici"));
     }
 }
예제 #4
0
        public ActionResult DepartmanGuncelle(FormCollection frm)
        {
            departmanConcrete = new DepartmanConcrete();

            Departman departman = departmanConcrete._departmanRepository.GetById(Convert.ToInt32(frm["DepartmanID"]));

            departman.DepartmanAdi = frm["DepartmanAdi"];

            departmanConcrete._departmanUnitOfWork.SaveChanges();
            departmanConcrete._departmanUnitOfWork.Dispose();

            return(RedirectToAction("DepartmanIndex"));
        }
예제 #5
0
        public ActionResult DepartmanEkle(FormCollection frm)
        {
            //TODO: Aynı departman ismi varsa kayıt edilmediğine dair bilgi verilmeli...
            departmanConcrete = new DepartmanConcrete();

            Departman departman = departmanConcrete.GetByName(frm["name"]);

            if (departman == null)
            {
                departman = new Departman();
                departman.DepartmanAdi = frm["name"];
                departmanConcrete._departmanRepository.Insert(departman);
                departmanConcrete._departmanUnitOfWork.SaveChanges();
                departmanConcrete._departmanUnitOfWork.Dispose();
            }
            return(RedirectToAction("DepartmanIndex"));
        }
예제 #6
0
        public ActionResult DepartmanGuncelle(int id)
        {
            departmanConcrete = new DepartmanConcrete();

            return(View(departmanConcrete._departmanRepository.GetById(id)));
        }