518 lines
18 KiB
C#
518 lines
18 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using FileHelpers;
|
|
|
|
namespace BodyshopPartner.Utils
|
|
{
|
|
|
|
|
|
[FixedLengthRecord()]
|
|
public class ARMSRoDataModel
|
|
{
|
|
[FieldFixedLength(8)]
|
|
public string ShopShortName;
|
|
[FieldFixedLength(8)]
|
|
public int RO;
|
|
[FieldFixedLength(1)]
|
|
public String TransType;
|
|
|
|
|
|
[FieldFixedLength(35)]
|
|
public String ShopLongName;
|
|
[FieldFixedLength(5)]
|
|
public String EstimatorID;
|
|
[FieldFixedLength(35)]
|
|
public String EstimatorName;
|
|
[FieldFixedLength(5)]
|
|
public String BodymanID;
|
|
[FieldFixedLength(35)]
|
|
public String CustomerFirstName;
|
|
[FieldFixedLength(35)]
|
|
public String CustomerLastName;
|
|
[FieldFixedLength(40)]
|
|
public String CustomerStreet;
|
|
[FieldFixedLength(30)]
|
|
public String CustomerCity;
|
|
[FieldFixedLength(2)]
|
|
public String CustomerState;
|
|
[FieldFixedLength(11)]
|
|
public String CustomerZip;
|
|
[FieldFixedLength(10)]
|
|
public String CustomerPhone1;
|
|
[FieldFixedLength(10)]
|
|
public String CustomerPhone2;
|
|
[FieldFixedLength(35)]
|
|
public String CustomerSource;
|
|
[FieldFixedLength(1)]
|
|
public String RetWhslCustomer;
|
|
|
|
|
|
[FieldFixedLength(1)]
|
|
public String CatMFD;
|
|
|
|
|
|
|
|
|
|
[FieldFixedLength(2)]
|
|
public int Year;
|
|
[FieldFixedLength(20)]
|
|
public String Make;
|
|
[FieldFixedLength(50)]
|
|
public String Model;
|
|
[FieldFixedLength(25)]
|
|
public String VIN;
|
|
[FieldFixedLength(10)]
|
|
public String License;
|
|
[FieldFixedLength(6)]
|
|
public int MileageIn;
|
|
[FieldFixedLength(5)]
|
|
public String InsuranceCoCode;
|
|
[FieldFixedLength(35)]
|
|
public String CompanyName;
|
|
[FieldFixedLength(40)]
|
|
public String InsuranceAddress;
|
|
[FieldFixedLength(30)]
|
|
public String InsuranceCity;
|
|
[FieldFixedLength(2)]
|
|
public String InsuranceState;
|
|
[FieldFixedLength(11)]
|
|
public String InsuranceZip;
|
|
[FieldFixedLength(10)]
|
|
public String InsurancePhone;
|
|
[FieldFixedLength(10)]
|
|
public String InsuranceFax;
|
|
[FieldFixedLength(4)]
|
|
public String ClaimType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[FieldFixedLength(1)]
|
|
public String LossType;
|
|
|
|
|
|
|
|
|
|
|
|
[FieldFixedLength(30)]
|
|
public String Policy;
|
|
[FieldFixedLength(30)]
|
|
public String Claim;
|
|
[FieldFixedLength(35)]
|
|
public String InsuredLastName;
|
|
[FieldFixedLength(35)]
|
|
public String InsuredFirstName;
|
|
[FieldFixedLength(35)]
|
|
public String ClaimantLastName;
|
|
[FieldFixedLength(35)]
|
|
public String ClaimantFirstName;
|
|
[FieldFixedLength(25)]
|
|
public String Assignment;
|
|
[FieldFixedLength(35)]
|
|
public String InsuranceAgentLastName;
|
|
[FieldFixedLength(35)]
|
|
public String InsuranceAgentFirstName;
|
|
[FieldFixedLength(10)]
|
|
public String InsAgentPhone;
|
|
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? DateOpened;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? DateofLoss;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? AssignedDate;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? TeardownHold;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? CarinShop;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? EstComplete;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? PartsOrder;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? AsstoBody;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? AsstoMech;
|
|
[FieldFixedLength(8)]
|
|
public DateTime? AsstoPaint;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? AssntoDetail;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? CarComplete;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? PromiseDate;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? CustPickup;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? InsInspDate;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? DateClosed;
|
|
|
|
[FieldFixedLength(12)]
|
|
public Decimal? BodyRate;
|
|
[FieldFixedLength(12)]
|
|
public Decimal? RefinishRate;
|
|
[FieldFixedLength(12)]
|
|
public Decimal? MechanicalRate;
|
|
[FieldFixedLength(12)]
|
|
public Decimal? StructuralRate;
|
|
[FieldFixedLength(12)]
|
|
public Decimal? PMRate;
|
|
[FieldFixedLength(12)]
|
|
public Decimal? BMRate;
|
|
[FieldFixedLength(7)]
|
|
public Decimal? RetailWholesaleTaxRate;
|
|
[FieldFixedLength(12)]
|
|
public Decimal? StorageRateperDay;
|
|
[FieldFixedLength(3)]
|
|
public Decimal? DaysStored;
|
|
|
|
[FieldFixedLength(5)]
|
|
public Decimal? BodyHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? RefinishHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? MechanicalHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? StructuralHours;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? PartsTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SubletTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? BodyLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RefinishLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? MechanicalLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? StructuralLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? MiscellaneousChargeTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? PMTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? BMTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? MiscTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? TowingTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? StorageTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? DetailTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SalesTaxTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? GrossTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? DeductibleTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? DepreciationTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? Discount;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? CustomerPay;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? InsurancePay;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? Deposit;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? AmountDue;
|
|
|
|
[FieldFixedLength(5)]
|
|
public Decimal? SupplementBodyHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? SupplementRefinishHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? SupplementMechanicalHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? SupplementStructuralHours;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementPartsTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementSubletTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementBodyLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementRefinishLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementMechanicalLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementStructuralLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementMiscellaneousChargeTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementPMTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementBMTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementMiscTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementTowingTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementStorageTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementDetailTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementSalesTaxTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementGrossTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementDeductibleTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementDepreciationTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementDiscount;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementCustomerPay;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementInsurancePay;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementDeposit;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? SupplementAmountDue;
|
|
|
|
[FieldFixedLength(5)]
|
|
public Decimal? RevisedTotalsBodyHours;
|
|
|
|
[FieldFixedLength(5)]
|
|
public Decimal? RevisedTotalsRefinishHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? RevisedTotalsMechanicalHours;
|
|
[FieldFixedLength(5)]
|
|
public Decimal? RevisedTotalsStructuralHours;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsPartsTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsSubletTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsBodyLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsRefinishLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsMechanicalLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsStructuralLaborTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsMiscellaneousChargeTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsPMTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsBMTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsMiscTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsTowingTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsStorageTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsDetailTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsSalesTaxTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsGrossTotal;
|
|
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsDeductibleTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsDepreciationTotal;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsDiscount;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsCustomerPay;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsInsurancePay;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsDeposit;
|
|
[FieldFixedLength(12)]
|
|
[FieldConverter(typeof(MoneyConverter))]
|
|
public Decimal? RevisedTotalsAmountDue;
|
|
|
|
[FieldFixedLength(2)]
|
|
public int ProductionStatus;
|
|
|
|
[FieldFixedLength(20)]
|
|
public String StatusDescription;
|
|
|
|
[FieldFixedLength(20)]
|
|
public String Hub50Comment;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? Dateofchange;
|
|
[FieldFixedLength(20)]
|
|
public String BodyTechName;
|
|
[FieldFixedLength(1)]
|
|
public String TotalLossYN;
|
|
[FieldFixedLength(50)]
|
|
public String InScreenCommentsLine1;
|
|
[FieldFixedLength(50)]
|
|
public String InScreenCommentsLine2;
|
|
[FieldFixedLength(4)]
|
|
public string CustomerPhone2Extension;
|
|
[FieldFixedLength(10)]
|
|
public String CustomerPhone3;
|
|
[FieldFixedLength(4)]
|
|
public string CustomerPhone3Extension;
|
|
[FieldFixedLength(60)]
|
|
public String CustomerFileComments;
|
|
[FieldFixedLength(10)]
|
|
public String Vehiclecolor;
|
|
[FieldFixedLength(4)]
|
|
public int VehicleProductionDate;
|
|
[FieldFixedLength(10)]
|
|
public String VehiclePaintCode;
|
|
[FieldFixedLength(10)]
|
|
public String VehicleTrimCode;
|
|
[FieldFixedLength(10)]
|
|
public String VehicleBodyStyle;
|
|
[FieldFixedLength(25)]
|
|
public String InsideAdjuster;
|
|
[FieldFixedLength(25)]
|
|
public String OutsideAdjuster;
|
|
[FieldFixedLength(20)]
|
|
public String AssignmentCaller;
|
|
[FieldFixedLength(10)]
|
|
public String AssignmentDivision;
|
|
[FieldFixedLength(1)]
|
|
public String InsuredorClaimantFlag;
|
|
[FieldFixedLength(20)]
|
|
public String LocationofPrimaryImpact;
|
|
[FieldFixedLength(20)]
|
|
public String LocationofSecondaryImpact;
|
|
[FieldFixedLength(1)]
|
|
public String DrivableFlag;
|
|
[FieldFixedLength(5)]
|
|
public String PaintTechID;
|
|
[FieldFixedLength(35)]
|
|
public String PaintTechName;
|
|
[FieldFixedLength(80)]
|
|
public String CustomerEmail;
|
|
[FieldFixedLength(12)]
|
|
public Decimal? GSTTax;
|
|
[FieldFixedLength(3)]
|
|
public String RepairDelayStatusCode;
|
|
[FieldFixedLength(80)]
|
|
public String RepairDelaycomment;
|
|
[FieldFixedLength(3)]
|
|
public String ProductionStageCode;
|
|
[FieldFixedLength(80)]
|
|
public String ProductionStageComment;
|
|
[FieldFixedLength(8)]
|
|
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
|
|
public DateTime? Vehiclescheduledindate;
|
|
|
|
[FieldFixedLength(20)]
|
|
public int AlternateRO;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public class MoneyConverter : ConverterBase
|
|
{
|
|
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
public override object StringToField(string from)
|
|
{
|
|
return Convert.ToDecimal(Decimal.Parse(from) / 100);
|
|
}
|
|
|
|
public override string FieldToString(object fieldValue)
|
|
{
|
|
|
|
if (fieldValue == null) return "";
|
|
return ((Decimal)(fieldValue ?? 0)).ToString("#.##");
|
|
}
|
|
|
|
}; |