public ActionResult Delete(int id) { PersonelRepository personelRepository = new PersonelRepository(); PersonelViewModel model = new PersonelViewModel(); Personell personel = personelRepository.FirstOrDefault(x => x.PersonellId == id); personelRepository.Delete(personel); personelRepository.Save(); return(RedirectToAction("List", "Home")); }
public ActionResult Update(PersonelViewModel model, int id) { PersonelRepository personelRepository = new PersonelRepository(); Personell personel = personelRepository.FirstOrDefault(x => x.PersonellId == id); personel.Ad = model.Ad; personel.Soyad = personel.Soyad; personel.Departman = personel.Departman; personel.İzinGunu = personel.İzinGunu; personelRepository.Edit(personel); personelRepository.Save(); return(RedirectToAction("List", "Home", model)); }
public ActionResult Edit(int id) { PersonelRepository personelRepository = new PersonelRepository(); PersonelViewModel model = new PersonelViewModel(); Personell personel = personelRepository.FirstOrDefault(x => x.PersonellId == id); model.Ad = personel.Ad; model.Soyad = personel.Soyad; model.Departman = personel.Departman.Value; model.İzinGunu = personel.İzinGunu.Value; model.PersonellId = id; return(View(model)); }
public ActionResult DetayList(int id) { PersonelRepository personelRepository = new PersonelRepository(); PersonelViewModel model = new PersonelViewModel(); Personell personel = personelRepository.FirstOrDefault(x => x.PersonellId == id); DepartmanEnum departmanEnum = (DepartmanEnum)personel.Departman; model.DepartmanAd = EnumerationHelper.GetDescription <DepartmanEnum>(departmanEnum); model.Ad = personel.Ad; model.Soyad = personel.Soyad; model.Departman = personel.Departman.Value; model.İzinGunu = personel.İzinGunu.Value; model.PersonellId = id; return(View(model)); }