// GET: POROSIs/Edit/5 public ActionResult Edit(int?id) { try { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } POROSI pOROSI = db.POROSIs.Find(id); if (pOROSI == null) { return(HttpNotFound()); } ViewBag.adresa_id = new SelectList(db.ADRESAs, "adrese_id", "rruga", pOROSI.adresa_id); ViewBag.klient_id = new SelectList(db.PERDORUES, "perdorues_id", "emri", pOROSI.klient_id); ViewBag.pergjegjes_id = new SelectList(db.PERDORUES, "perdorues_id", "emri", pOROSI.pergjegjes_id); return(View(pOROSI)); } catch (Exception ex) { logger.Error(ex); ViewBag.ErrorMessage = "Ndodhi një problem gjatë përpunimit të të dhenave. Ju lutem kontaktoni me administratorin!"; return(View()); } }
public ActionResult DeleteConfirmed(int id) { POROSI pOROSI = db.POROSIs.Find(id); db.POROSIs.Remove(pOROSI); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// GET: POROSIs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } POROSI pOROSI = db.POROSIs.Find(id); if (pOROSI == null) { return(HttpNotFound()); } return(View(pOROSI)); }
public ActionResult DeleteConfirmed(int id) { try { POROSI pOROSI = db.POROSIs.Find(id); db.POROSIs.Remove(pOROSI); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { logger.Error(ex); ViewBag.ErrorMessage = "Ndodhi një problem gjatë përpunimit të të dhenave. Ju lutem kontaktoni me administratorin!"; return(View()); } }
// GET: POROSIs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } POROSI pOROSI = db.POROSIs.Find(id); if (pOROSI == null) { return(HttpNotFound()); } 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)); }
// GET: POROSIs/Details/5 public ActionResult Details(int?id) { try { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } POROSI pOROSI = db.POROSIs.Find(id); if (pOROSI == null) { return(HttpNotFound()); } return(View(pOROSI)); } catch (Exception ex) { logger.Error(ex); ViewBag.ErrorMessage = "Ndodhi një problem gjatë përpunimit të të dhenave. Ju lutem kontaktoni me administratorin!"; return(View()); } }
public ActionResult Edit([Bind(Include = "porosi_id,adresa_id,datetime_Porosi,status_porosie,klient_id,pergjegjes_id,data_Modifikimit")] POROSI pOROSI) { try { 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.PERDORUES, "perdorues_id", "emri", pOROSI.klient_id); ViewBag.pergjegjes_id = new SelectList(db.PERDORUES, "perdorues_id", "emri", pOROSI.pergjegjes_id); return(View(pOROSI)); } catch (Exception ex) { logger.Error(ex); ViewBag.ErrorMessage = "Ndodhi një problem gjatë përpunimit të të dhenave. Ju lutem kontaktoni me administratorin!"; return(View()); } }