public ActionResult Edit([Bind(Include = "Id,Email,PhoneNumber")] AspNetUser pERDORUE) { if (ModelState.IsValid) { var perdoruesEkzistues = db.AspNetUsers.FirstOrDefault(p => p.Id == pERDORUE.Id); if (perdoruesEkzistues != null) { perdoruesEkzistues.Email = pERDORUE.Email; // perdoruesEkzistues.mbiemri = pERDORUE.mbiemri; perdoruesEkzistues.PhoneNumber = pERDORUE.PhoneNumber; //perdoruesEkzistues.aktiv = pERDORUE.aktiv; // perdoruesEkzistues.rol_id = pERDORUE.rol_id; // perdoruesEkzistues.modifikimPerdoruesi = DateTime.Now; db.Entry(perdoruesEkzistues).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } else { ViewBag.ErrorMessage = "Perdoruesi i kerkuar nuk ekziston!"; // ViewBag.rol_id = new SelectList(db.ROLIs, "rol_id", "emri", pERDORUE.rol_id); return(View(pERDORUE)); } } //ViewBag.rol_id = new SelectList(db.ROLIs, "rol_id", "emri", pERDORUE.rol_id); return(View(pERDORUE)); }
public ActionResult Edit([Bind(Include = "kategori_id,emri")] KATEGORI kATEGORI) { if (ModelState.IsValid) { db.Entry(kATEGORI).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(kATEGORI)); }
public ActionResult Edit([Bind(Include = "porosi_id,adresa_id,datetime_Porosi,status_porosie,klient_id,pergjegjes_id,data_Modifikimit")] POROSI pOROSI) { if (ModelState.IsValid) { db.Entry(pOROSI).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.adresa_id = new SelectList(db.ADRESAs, "adrese_id", "rruga", pOROSI.adresa_id); ViewBag.klient_id = new SelectList(db.AspNetUsers, "Id", "Email", pOROSI.klient_id); ViewBag.pergjegjes_id = new SelectList(db.AspNetUsers, "Id", "Email", pOROSI.pergjegjes_id); return(View(pOROSI)); }
public ActionResult Edit([Bind(Include = "gatim_id,emriGatimit,pershkrimi,cmimi,disponueshmeria,foto,datakrijimit,datamodifikimit,createdBy,modifiedBy,kategori_id")] GATIM gATIM) { if (ModelState.IsValid) { db.Entry(gATIM).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.createdBy = new SelectList(db.AspNetUsers, "Id", "Email", gATIM.createdBy); ViewBag.modifiedBy = new SelectList(db.AspNetUsers, "Id", "Email", gATIM.modifiedBy); ViewBag.kategori_id = new SelectList(db.KATEGORIs, "kategori_id", "emri", gATIM.kategori_id); return(View(gATIM)); }