Beispiel #1
0
        public static AppraisalViewFormModel GetVehicleInformationFromStyleId(string vin, string styleId)
        {
            var autoService = new ChromeAutoService();
            var vehicleInfo = autoService.GetVehicleInformationFromVin(vin, Convert.ToInt32(styleId));
            var styleInfo   = autoService.GetStyleInformationFromStyleId(Convert.ToInt32(styleId));

            return(GetVehicleInfoFromChromeDecodeWithStyle(vehicleInfo, styleInfo));
        }
Beispiel #2
0
        public static AppraisalViewFormModel DecodeProcessingByVin(string vin)
        {
            var viewModel = new AppraisalViewFormModel();

            var autoService = new ChromeAutoService();

            VehicleDescription vehicleInfo = autoService.GetVehicleInformationFromVin(vin);

            if (vehicleInfo != null &&
                (vehicleInfo.responseStatus.responseCode == ResponseStatusResponseCode.Successful ||
                 vehicleInfo.responseStatus.responseCode == ResponseStatusResponseCode.ConditionallySuccessful))
            {
                if (vehicleInfo.style != null && vehicleInfo.style.Any())
                {
                    Style firstStyle = vehicleInfo.style.FirstOrDefault();
                    if (firstStyle != null)
                    {
                        bool existed;
                        viewModel.TrimList = SelectListHelper.InitalTrimList(viewModel, firstStyle.trim,
                                                                             vehicleInfo.style, firstStyle.id,
                                                                             out existed);
                        //SessionHandler.ChromeTrimList = viewModel.TrimList;
                        vehicleInfo = autoService.GetVehicleInformationFromVin(vin, firstStyle.id);
                        VehicleDescription styleInfo = autoService.GetStyleInformationFromStyleId(firstStyle.id);

                        viewModel = GetVehicleInfoFromChromeDecodeWithStyle(vehicleInfo, styleInfo);
                    }
                }
            }

            if (viewModel.IsTruck)
            {
                viewModel.TruckTypeList = SelectListHelper.InitalTruckTypeList();

                //viewModel.TruckCategoryList = SelectListHelper.InitalTruckCategoryList(SQLHelper.GetListOfTruckCategoryByTruckType(viewModel.TruckTypeList.First().Value));

                viewModel.TruckClassList = SelectListHelper.InitalTruckClassList();
            }

            return(viewModel);
        }