public ActionResult AddRequest(ConstructorRequest cq) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.ConstructorRequests.Add(cq); db.SaveChanges(); } // TODO: Add insert logic here return(RedirectToAction("getConRequest")); } catch { return(View()); } }
public ActionResult UpdateRequest(int id, ConstructorRequest cq) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.Entry(cq).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } // TODO: Add update logic here return(RedirectToAction("getConRequest")); } catch { return(View()); } }
public ActionResult DeleteRequest(int id, FormCollection collection) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { ConstructorRequest cq = db.ConstructorRequests.Where(x => x.ConstructorRequestId == id).FirstOrDefault(); db.ConstructorRequests.Remove(cq); db.SaveChanges(); } // TODO: Add delete logic here return(RedirectToAction("getConRequest")); } catch { return(View()); } }