示例#1
0
        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"));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
        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));
        }