Example #1
0
        public ActionResult UpdateIsVeren(IsVeren model)
        {
            IsVeren isveren = dbContext.IsVerenler.Where(x => x.Id == model.Id).FirstOrDefault();

            if (isveren != null)
            {
                isveren.Ad         = model.Ad;
                isveren.Soyad      = model.Soyad;
                isveren.SehirId    = model.SehirId;
                isveren.IlceId     = model.SehirId;
                isveren.MahalleId  = model.MahalleId;
                isveren.Adres      = model.Adres;
                isveren.Telefon1   = model.Telefon1;
                isveren.Telefon2   = model.Telefon2;
                isveren.Email      = model.Email;
                isveren.WebAdresi  = model.WebAdresi;
                isveren.FotografId = model.FotografId;

                int sonuc = dbContext.SaveChanges();

                if (sonuc > 0)
                {
                    ViewBag.Result = "Güncelleme işlemi başarılı.";
                    ViewBag.Status = "success";
                }
                else
                {
                    ViewBag.Result = "Güncelleme işlemi başarısız.";
                    ViewBag.Status = "danger";
                }
            }
            return(View(isveren));
        }
Example #2
0
 public ActionResult DeleteIsVerenn(int?id)
 {
     if (id != null)
     {
         IsVeren isveren = dbContext.IsVerenler.Where(x => x.Id == id).FirstOrDefault();
         dbContext.IsVerenler.Remove(isveren);
         dbContext.SaveChanges();
     }
     return(RedirectToAction("ListIsVeren", "IsVerenController"));
 }
Example #3
0
        public ActionResult UpdateIsVeren(int?id)
        {
            IsVeren isveren = null;

            if (id != null)
            {
                isveren = dbContext.IsVerenler.Where(x => x.Id == id).FirstOrDefault();
            }
            return(View(isveren));
        }
Example #4
0
 public ActionResult InsertIsVeren(IsVeren isveren)
 {
     dbContext.IsVerenler.Add(isveren);
     dbContext.SaveChanges();
     return(View());
 }