Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,Adi,Soyadi,KullaniciAdi,Email,Sifre,Telefon,EklenmeTarihi")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Ejemplo n.º 2
0
 public ActionResult Edit(Entities.Admin admin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(admin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(admin));
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Id,UstKategoriId,KategoriAdi,KategoriAciklamasi")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public ActionResult Duzenle(Musteri mus)
 {
     using (UrunContext ctx = new UrunContext())
     {
         ctx.Entry(mus).State = EntityState.Modified;
         int sonuc = ctx.SaveChanges();
         if (sonuc > 0)
         {
             return RedirectToAction("Index");
         }
         return View();
     }
 }
Ejemplo n.º 5
0
 public ActionResult Edit(Slider slider, HttpPostedFileBase Resim)
 {
     if (ModelState.IsValid)
     {
         string directory = Server.MapPath("~/Img/Slider/");
         if (Resim != null && Resim.ContentLength > 0)
         {
             var fileName = Path.GetFileName(Resim.FileName);
             Resim.SaveAs(Path.Combine(directory, fileName));
             slider.Resim = Resim.FileName;
         }
         db.Entry(slider).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(slider));
 }
Ejemplo n.º 6
0
 public ActionResult Edit(Product product, HttpPostedFileBase UrunResmi)
 {
     if (ModelState.IsValid)
     {
         string directory = Server.MapPath("~/Img/Product/");
         if (UrunResmi != null && UrunResmi.ContentLength > 0)
         {
             var fileName = Path.GetFileName(UrunResmi.FileName);
             UrunResmi.SaveAs(Path.Combine(directory, fileName));
             product.UrunResmi = UrunResmi.FileName;
         }
         if (product.UrunStok < 0)
         {
             product.UrunStok = 0;
         }
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(db.Category, "Id", "KategoriAdi", product.CategoryId);
     return(View(product));
 }