Exemplo n.º 1
0
        public static AppraisalInfoViewModel ConvertToAppraisalViewModel(this whitmanenterpriseappraisal drRow, string defaultStockImageUrl)
        {
            string imagesNum = GetImageNum(drRow.CarImageUrl, drRow.DefaultImageUrl, defaultStockImageUrl);

            return(new AppraisalInfoViewModel
            {
                Days = (drRow.AppraisalDate == null) ? 0 : DateTime.Now.Subtract((DateTime)drRow.AppraisalDate).Days,
                ExteriorColor = drRow.ExteriorColor,
                imagesNum = imagesNum,
                Make = drRow.Make,
                Mileage = drRow.Mileage,
                Model = drRow.Model,
                ModelYear = drRow.ModelYear.ToString(),
                SalePrice = drRow.SalePrice,
                StockNumber = drRow.StockNumber,
                Vin = drRow.VINNumber
            });
        }
Exemplo n.º 2
0
        public static AppraisalViewFormModel ConvertToAppraisalViewFormModel(this whitmanenterpriseappraisal row)
        {
            var appraisalTmp = new AppraisalViewFormModel
            {
                AppraisalID         = row.idAppraisal,
                Make                = row.Make,
                ModelYear           = row.ModelYear.GetValueOrDefault(),
                AppraisalModel      = row.Model,
                Trim                = row.Trim,
                VinNumber           = row.VINNumber,
                StockNumber         = row.StockNumber,
                ACV                 = row.ACV,
                CarImagesUrl        = row.DefaultImageUrl,
                DefaultImageUrl     = row.DefaultImageUrl,
                ExteriorColor       = row.ExteriorColor,
                AppraisalDate       = row.AppraisalDate.Value.ToShortDateString(),
                AppraisalGenerateId = row.AppraisalID,
            };

            return(appraisalTmp);
        }
        public AppraisalViewFormModel(whitmanenterpriseappraisal row)
        {
            VinGenie            = row.VinGenie;
            AppraisalID         = row.idAppraisal;
            AppraisalGenerateId = row.idAppraisal.ToString();
            Notes                      = row.Note;
            ModelYear                  = row.ModelYear.GetValueOrDefault();
            Make                       = row.Make ?? string.Empty;
            AppraisalModel             = row.Model ?? string.Empty;
            SelectedTrim               = row.Trim ?? string.Empty;
            Trim                       = row.Trim ?? string.Empty;
            VinNumber                  = row.VINNumber ?? string.Empty;
            StockNumber                = row.StockNumber ?? string.Empty;
            SalePrice                  = row.SalePrice ?? string.Empty;
            MSRP                       = row.MSRP ?? string.Empty;
            Mileage                    = row.Mileage ?? "0";
            Title                      = ModelYear + " " + Make + " " + AppraisalModel + (!String.IsNullOrEmpty(SelectedTrim) ? " " + SelectedTrim : "");
            SelectedCylinder           = row.Cylinders ?? string.Empty;
            SelectedExteriorColorValue = row.ExteriorColor ?? string.Empty;
            SelectedExteriorColorCode  = row.ColorCode ?? string.Empty;
            ExteriorColor              = row.ExteriorColor ?? string.Empty;
            InteriorColor              = row.InteriorColor ?? string.Empty;
            SelectedInteriorColor      = row.InteriorColor ?? string.Empty;
            SelectedBodyType           = row.BodyType ?? string.Empty;
            EngineType                 = row.EngineType ?? string.Empty;
            SelectedDriveTrain         = row.DriveTrain ?? string.Empty;
            SelectedFuel               = row.FuelType ?? string.Empty;
            SelectedTranmission        = row.Tranmission ?? string.Empty;
            Door                       = row.Doors ?? string.Empty;
            SelectedLiters             = row.Liters ?? string.Empty;
            SelectedFactoryOptions     = row.CarsOptions ?? string.Empty;
            SelectedPackageOptions     = row.CarsPackages ?? string.Empty;
            Descriptions               = row.Descriptions ?? string.Empty;
            Notes                      = row.Note ?? string.Empty;
            DealerCost                 = row.DealerCost ?? string.Empty;
            DefaultImageUrl            = row.DefaultImageUrl ?? string.Empty;
            PhotoUrl                   = row.PhotoUrl;
            DateOfAppraisal            = row.AppraisalDate != null?row.AppraisalDate.GetValueOrDefault() : DateTime.Now;

            CustomerFirstName = row.FirstName ?? string.Empty;
            CustomerLastName  = row.LastName ?? string.Empty;
            CustomerAddress   = row.Address ?? string.Empty;
            CustomerCity      = row.City ?? string.Empty;
            CustomerState     = row.State ?? string.Empty;
            CustomerZipCode   = row.ZipCode ?? string.Empty;
            CustomerEmail     = row.Email ?? string.Empty;
            AppraisalBy       = row.AppraisalBy ?? string.Empty;
            AppraisalType     = row.AppraisalType ?? string.Empty;
            ChromeModelId     = row.ChromeModelId ?? string.Empty;
            ChromeStyleId     = row.ChromeStyleId ?? string.Empty;
            StandardOptions   = row.StandardOptions ?? string.Empty;
            IsCertified       = row.Certified.GetValueOrDefault();
            VehicleType       = row.VehicleType;
            TruckCategory     = row.TruckCategory;
            TruckType         = row.TruckType;
            TruckClass        = row.TruckClass;
            ACV = row.ACV;

            if (row.KBBTrimId != null)
            {
                KbbTrimId = row.KBBTrimId.Value;
            }
            KbbOptionsId = row.KBBOptionsId;
        }
Exemplo n.º 4
0
 public static AppraisalViewFormModel GetAppraisalModel(whitmanenterpriseappraisal apprasial)
 {
     return(apprasial == null ? new AppraisalViewFormModel() : new AppraisalViewFormModel(apprasial));
 }