Exemplo n.º 1
0
        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"));
        }
Exemplo n.º 2
0
        //
        // 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));
        }
Exemplo n.º 3
0
 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));
 }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        //
        // 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));
        }
Exemplo n.º 6
0
        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;
        }