private void btnGuncelle_Click(object sender, EventArgs e)
 {
     guncelle.CalisanAdi    = textBox1.Text;
     guncelle.CalisanSoyadi = textBox2.Text;
     cr.Update(guncelle);
     Getir();
     Temizle();
 }
 public bool UpdateCalisan(Calisan entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new CalisanRepository())
         {
             isSuccess = repo.Update(entity);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:CalisanBusiness::UpdateCalisan::Error occured.", ex);
     }
 }
Exemple #3
0
        public ActionResult Edit(Calisan model)
        {
            int     ID          = Convert.ToInt32(RouteData.Values["id"]);
            int     DepartmanId = Convert.ToInt32(Request["DepartmanID"]);
            Calisan calisan     = CalisanRepository.FirstOrDefault(x => x.Id == ID);

            calisan.Ad                = Request["Ad"].ToString();
            calisan.Soyad             = Request["Soyad"].ToString();
            calisan.Telefon           = model.Telefon;
            calisan.DepartmanId       = DepartmanId;
            calisan.YoneticiBilgisiId = model.YoneticiBilgisiId;

            try
            {
                CalisanRepository.Update(calisan);
                CalisanRepository.Save();
                return(RedirectToAction("Listele"));
            }
            catch (Exception)
            {
                return(View(model));
            }
        }