public ActionResult DeleteConfirmed(int id) { Sifari sifari = db.Sifaris.Find(id); db.Sifaris.Remove(sifari); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Join(int?Id) { var qosulan = Convert.ToInt32(Session["id"]); Sifari sifr = db.Sifaris.Find(Id); sifr.sifaris_goturen_id = qosulan; db.SaveChanges(); return(View("Index")); }
// GET: Sifarisler/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Sifari sifari = db.Sifaris.Find(id); if (sifari == null) { return(HttpNotFound()); } return(View(sifari)); }
public ActionResult Edit(int id, string unvan, string telefon) { Sifari sfr = db.Sifaris.Find(id); sfr.sifaris_mehsul_adi = unvan; sfr.sifarisci_telefon = telefon; db.SaveChanges(); return(Redirect("/Home/Index")); }
public ActionResult Edit([Bind(Include = "sifaris_id,sifarisci_ad_soyad,sifarisci_telefon,sifarisci_mehsulun_id,sifarisci_unvani,sifaris_tarixi,sifaris_sayi,sifaris_novu_id,sifaris_erteleme_tarix,sifaris_goturen_id,sifaris_mehsul_adi,sifaris_qeyd")] Sifari sifari) { if (ModelState.IsValid) { var tarix = DateTime.Now; sifari.sifaris_tarixi = tarix; db.Entry(sifari).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.sifaris_goturen_id = new SelectList(db.Istifadecis, "user_id", "user_name", sifari.sifaris_goturen_id); ViewBag.sifarisci_mehsulun_id = new SelectList(db.Mehsuls, "mehsul_id", "mehsulun_adi", sifari.sifarisci_mehsulun_id); ViewBag.sifaris_novu_id = new SelectList(db.SifarisNovus, "sifaris_type_id", "sifaris_type", sifari.sifaris_novu_id); return(View(sifari)); }
public ActionResult Datagonder(FormCollection frm) { Sifari sfrs = new Sifari(); sfrs.sifarisci_ad_soyad = frm["sifarisci_ad_soyad"]; sfrs.sifarisci_telefon = frm["sifarisci_telefon"]; sfrs.sifarisci_unvani = frm["mehsulun_adi"]; sfrs.sifaris_novu_id = 9; sfrs.sifaris_tarixi = DateTime.Now; db.Sifaris.Add(sfrs); db.SaveChanges(); return(View("Index")); }
// GET: Sifarisler/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Sifari sifari = db.Sifaris.Find(id); if (sifari == null) { return(HttpNotFound()); } ViewBag.sifaris_goturen_id = new SelectList(db.Istifadecis, "user_id", "user_name", sifari.sifaris_goturen_id); ViewBag.sifarisci_mehsulun_id = new SelectList(db.Mehsuls, "mehsul_id", "mehsulun_adi", sifari.sifarisci_mehsulun_id); ViewBag.sifaris_novu_id = new SelectList(db.SifarisNovus, "sifaris_type_id", "sifaris_type", sifari.sifaris_novu_id); return(View(sifari)); }