public ActionResult DeleteConfirmed(int id) { T_Trucks t_trucks = db.T_Trucks.Find(id); db.T_Trucks.Remove(t_trucks); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Truck/Details/5 public ActionResult Details(int id = 0) { T_Trucks t_trucks = db.T_Trucks.Find(id); if (t_trucks == null) { return(HttpNotFound()); } return(View(t_trucks)); }
public ActionResult Create(T_Trucks t_trucks) { if (ModelState.IsValid) { db.T_Trucks.Add(t_trucks); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StateID = new SelectList(db.T_State, "StateID", "StateName"); return(View(t_trucks)); }
public ActionResult Edit(T_Trucks t_trucks) { if (ModelState.IsValid) { db.Entry(t_trucks).State = System.Data.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StateID = new SelectList(db.T_State, "StateID", "StateName", t_trucks.StateID); return(View(t_trucks)); }
// // GET: /Truck/Edit/5 public ActionResult Edit(int id = 0) { T_Trucks t_trucks = db.T_Trucks.Find(id); ViewBag.StateID = new SelectList(db.T_State, "StateID", "StateName", t_trucks.StateID); if (t_trucks == null) { return(HttpNotFound()); } return(View(t_trucks)); }
public string getTruckOwnerName(int TruckID) { int Tr = TruckID; if (Tr != null) { T_Trucks tr = db.T_Trucks.Find(TruckID); return(tr.OwnerFullName); } else { return(""); } //tr.OwnerFullName; }