Esempio n. 1
0
    public static void FillPath(string[] path, CarIndex ind, string path_value, string exception_msg)
    {
        if ((int)ind > Enum.GetNames(ind.GetType()).Length)
        {
            throw new Exception(exception_msg);
        }

        path[(int)ind] = path_value;
    }
Esempio n. 2
0
        //Car Home Funtions
        public ActionResult CarHome(int?carID)
        {
            Car car = db.Car.Find(carID);

            if (car == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new CarIndex();

            viewModel.ID          = car.ID;
            viewModel.Description = car.Description;
            return(View(viewModel));
        }