コード例 #1
0
        public ActionResult CheckIn(Vehicle vehicle, string vehicleType)
        {
            switch (vehicleType)
            {
            case "Car":
                vehicle.VehicleType.Category = Category.Car;
                break;

            case "MC":
                vehicle.VehicleType.Category = Category.Mc;
                break;

            case "Bus":
                vehicle.VehicleType.Category = Category.Bus;
                break;

            case "Truck":
                vehicle.VehicleType.Category = Category.Truck;
                break;

            case "Other":
                vehicle.VehicleType.Category = Category.Other;
                break;

            default:
                return(RedirectToAction("Index"));
            }

            garage.Add(vehicle);
            return(RedirectToAction("Create"));
        }
コード例 #2
0
 public bool Add(GarageSaleTO newBranch)
 {
     try
     {
         IGarageRepository repo = new GarageRepository(this.UserId);
         return(repo.Add(newBranch));
     }
     catch (Exception ex)
     {
         throw new GarageSaleException("GarageSaleAddError", ex);
     }
 }