Пример #1
0
        public ActionResult Contact(feedback obj)

        {
            if (ModelState.IsValid)
            {
                db.feedbacks.Add(obj);
                db.SaveChanges();
                ViewBag.Msg = "Feedback submitted succesfully";
                return(RedirectToAction("Contact"));
            }

            return(View(obj));
        }
Пример #2
0
 public ActionResult EditProfile([Bind(Include = "driver_id,first_name,last_name,address,postal_code,city,province,corporation,phone,dob,nationality,gender,pp_number,license_number,license_expiry,medical_date,rate,rate_team")] table_driver table_driver)
 {
     if (ModelState.IsValid)
     {
         db.Entry(table_driver).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("UserProfile"));
     }
     return(View(table_driver));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "unit_number,plate_number,registration,vin_number,make,year,weight,status,owner_company,driver,last_location,last_trip")] truck truck)
        {
            List <SelectListItem> statusList = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "Company", Value = "PICK"
                },
                new SelectListItem()
                {
                    Text = "Owner Operator", Value = "DROP"
                }
            };

            truck.statusList = statusList;
            if (ModelState.IsValid)
            {
                db.trucks.Add(truck);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(truck));
        }
        public ActionResult Create([Bind(Include = "driver_id,first_name,last_name,address,postal_code,city,province,corporation,phone,dob,nationality,gender,pp_number,license_number,license_expiry,medical_date,rate,rate_team")] table_driver table_driver)
        {
            if (ModelState.IsValid)
            {
                db.table_driver.Add(table_driver);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(table_driver));
        }