public HttpResponseMessage UpdateVehicle(string vehicleNumber, VehicleModel vehicleModel) { try { if (vehicleModel == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Data is null.")); } if (!ModelState.IsValid) { Errors errors = ErrorsHelper.GetErrors(ModelState); return(Request.CreateResponse(HttpStatusCode.BadRequest, errors)); } vehicleModel.vehicleNumber = vehicleNumber; VehicleModel updatedVehicle = vehicleRepository.UpdateVehicle(vehicleModel); return(Request.CreateResponse(HttpStatusCode.OK, updatedVehicle)); } catch (Exception ex) { Errors errors = ErrorsHelper.GetErrors(ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, errors)); } }
static public OleDbCommand AddVehicle(VehicleModel vehicleModel) { return(CreateOleDbCommand(vehicleModel, queryVehiclesPost)); }
static public OleDbCommand UpdateVehicle(VehicleModel vehicleModel) { return(CreateOleDbCommand(vehicleModel, queryVehiclesUpdate)); }
public ThreeObjectsModel(PersonModel person2, VehicleModel vehicle2, ApprovalModel approval2) { personModel = person2; vehicleModel = vehicle2; approvalModel = approval2; }