Beispiel #1
0
        public PackageCodeGetResponse PackageCodeGet(PackageCodeGetRequest request)
        {
            PackageCodeGetResponse response = new PackageCodeGetResponse();

            //DMS information set by dealer information
            string proxypath = string.Format("{0}.{1}.{2}",
                request.TransactionHeader.DocumentVersion,
                request.TransactionHeader.DMSCode,
                request.TransactionHeader.DMSVersion);

            switch (proxypath)
            {
                case "v2.WA.v2":
                    {
                        WA.v2.ProxyService proxyservice = new WA.v2.ProxyService();
                        response = proxyservice.PackageCodeGet(request);
                    }
                    break;
                case "v2.1C.v8241":
                    {
                        _1C.v8241.ProxyService proxyservice = new _1C.v8241.ProxyService();
                        response = proxyservice.PackageCodeGet(request);
                    }
                    break;
                default: response.TransactionHeader = request.TransactionHeader; response.Errors = new List<Error>() { new Error() { Code = ResponseCode.WA_NoMatchedProxy, Message = ResponseMessage.NoMatchedProxy } };
                    break;
            }

            return response;
        }
        public PackageCodeGetResponse PackageCodeGet(PackageCodeGetRequest request)
        {
            PackageCodeGetResponse response = new PackageCodeGetResponse();

            try
            {
                //Request body-header object validation
                response.Errors = GetErrorDataListFromRequestTransactionHeader(request.TransactionHeader);
                if (response.Errors != null)
                {
                    response.TransactionHeader = new Data.v2.Common.Common.TransactionHeader();
                    return response;
                }
                response.Errors = GetErrorDataListFromRequest(request.PackageCodeGet);
                if (response.Errors != null)
                {
                    response.TransactionHeader = request.TransactionHeader;
                    return response;
                }

                using (PackageCode_Biz biz = new PackageCode_Biz())
                {
                    response = biz.PackageCodeGet(request);
                }
            }
            catch (Exception ex)
            {
                response.Errors = GetErrorDataListFromException(ex);
                WA.Standard.IF.Logger.Log.Log.RootLogger.ErrorFormat("PackageCodeGetResponse Error {0}: ", ex);
            }

            return response;
        }
Beispiel #3
0
        public PackageCodeGetResponse PackageCodeGet(PackageCodeGetRequest request)
        {
            PackageCodeGetResponse response = new PackageCodeGetResponse();

            try
            {
                WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "WA PackageCodeGetRequest XML", request);

                //Request body-header object validation
                response.Errors = GetErrorDataListFromRequestTransactionHeader(request.TransactionHeader);
                if (response.Errors != null)
                {
                    response.TransactionHeader = new Data.v2.Common.Common.TransactionHeader();
                }
                response.Errors = GetErrorDataListFromRequest(request.PackageCodeGet);
                if (response.Errors != null)
                {
                    response.TransactionHeader = request.TransactionHeader;
                }

                if (response.Errors == null)
                {
                    using (PackageCode_Biz biz = new PackageCode_Biz())
                    {
                        response = biz.PackageCodeGet(request);
                    }

                    WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "WA PackageCodeGetResponse XML", response);
                }
            }
            catch (Exception ex)
            {
                response.Errors = GetErrorDataListFromException(ex);
                WA.Standard.IF.Logger.Log.Log.SaveErrorLog(null, "PackageCodeGet", request, ex.Message, ex);
            }

            return response;
        }
Beispiel #4
0
        public PackageCodeGetResponse PackageCodeGet(PackageCodeGetRequest request)
        {
            PackageCodeGetResponse response = new PackageCodeGetResponse();

            if (WA.Standard.IF.Logger.Log.Log.RunningMode.Equals(WA.Standard.IF.Data.v2.Common.Common.RunningMode.Mapper))
            {
                #region For Mapper Process
                WA.Standard.IF.Proxy.v2.Common.PackageCode_Proxy proxy = new Proxy.v2.Common.PackageCode_Proxy();
                response = proxy.PackageCodeGet(request);
                #endregion
            }
            else if (WA.Standard.IF.Logger.Log.Log.RunningMode.Equals(WA.Standard.IF.Data.v2.Common.Common.RunningMode.XMLDMS))
            {
                response.TransactionHeader = request.TransactionHeader;

                #region For XML Process
                List<PackageCode> PackageCodes = Util.DataHelper.GetListByElementName<PackageCode>(System.Web.HttpContext.Current.Server.MapPath("/v2/Repository/PackageCodes.xml"), "PackageCode");

                if (PackageCodes != null && PackageCodes.Count > 0)
                {
                    List<PackageCode> resultlist = PackageCodes
                       .Where(item =>
                       (string.IsNullOrEmpty(request.PackageCodeGet.Category) || true)
                       && (string.IsNullOrEmpty(request.PackageCodeGet.Code) || item.Code.Contains(request.PackageCodeGet.Code))
                       && (string.IsNullOrEmpty(request.PackageCodeGet.Description) || item.Description.Contains(request.PackageCodeGet.Description))
                       && (string.IsNullOrEmpty(request.PackageCodeGet.Engine) || request.PackageCodeGet.Engine == item.Engine)
                       && (string.IsNullOrEmpty(request.PackageCodeGet.Make) || request.PackageCodeGet.Make == item.Make)
                       && (string.IsNullOrEmpty(request.PackageCodeGet.Mileage) || request.PackageCodeGet.Mileage == item.Mileage)
                       && (string.IsNullOrEmpty(request.PackageCodeGet.Model) || request.PackageCodeGet.Model == item.Model)
                       && (string.IsNullOrEmpty(request.PackageCodeGet.Year) || request.PackageCodeGet.Year == item.Year)
                       && (request.PackageCodeGet.LastModifiedDateTimeFromUTC == null || request.PackageCodeGet.LastModifiedDateTimeFromUTC <= item.ManagementFields.LastModifiedDateTimeUTC)
                       && (request.PackageCodeGet.LastModifiedDateTimeToUTC == null || request.PackageCodeGet.LastModifiedDateTimeToUTC >= item.ManagementFields.LastModifiedDateTimeUTC)
                       ).ToList<PackageCode>();

                    response.PackageCodes = resultlist;

                    if (resultlist.Count > 0)
                        response.ResultMessage = GetResultMessageData(ResponseCode.Success, ResponseMessage.Success);
                    else
                        response.ResultMessage = GetResultMessageData(ResponseCode.NoResult, ResponseMessage.NoResult);
                }
                else
                {
                    response.ResultMessage = GetResultMessageData(ResponseCode.NoResult, ResponseMessage.NoResult);
                }
                #endregion
            }
            else if (WA.Standard.IF.Logger.Log.Log.RunningMode.Equals(WA.Standard.IF.Data.v2.Common.Common.RunningMode.DBDMS))
            {
                #region For DB Process

                /*
                DataSet resultDS = new DataSet();
                using (PackageCode_Dac dac = new PackageCode_Dac())
                {
                    resultDS = dac.SelectPackageCode(request.TransactionHeader.CountryID
                                                        , request.TransactionHeader.DistributorID
                                                        , request.TransactionHeader.GroupID
                                                        , request.TransactionHeader.DealerID
                                                        , request.TransactionHeader.Language
                                                        , request.PackageCodeGet
                        );

                }

                if (resultDS.Tables != null && resultDS.Tables.Count > 0)
                {
                    #region PackageCodes
                    List<PackageCode> PackageCodes = null;
                    PackageCodes = resultDS.Tables[0].AsEnumerable()
                        .Select(row =>
                    new PackageCode
                    {
                        Code = Util.DataHelper.ConvertObjectToString(row["DMSPackageCodeNo"]),
                        DefLinePaymentMethod = Util.DataHelper.ConvertObjectToString(row["DefLinePaymentMethod"]),
                        Description = Util.DataHelper.ConvertObjectToString(row["Description"]),
                        DisplayPackageCode = Util.DataHelper.ConvertObjectToString(row["DisplayPackageCode"]),
                        DisplayOperationDescription = Util.DataHelper.ConvertObjectToString(row["DisplayOperationDescription"]),
                        Engine = Util.DataHelper.ConvertObjectToString(row["Engine"]),
                        EstimatedHours = Util.DataHelper.ConvertObjectToDouble(row["EstimatedHours"]),
                        Make = Util.DataHelper.ConvertObjectToString(row["Make"]),
                        Mileage = Util.DataHelper.ConvertObjectToString(row["Mileage"]),
                        Model = Util.DataHelper.ConvertObjectToString(row["Model"]),
                        Period = Util.DataHelper.ConvertObjectToString(row["Period"]),
                        Year = Util.DataHelper.ConvertObjectToString(row["Year"]),
                        PriceType = new PriceType()
                        {
                            DiscountPrice = Util.DataHelper.ConvertObjectToDouble(row["DiscountPrice"]),
                            DiscountRate = Util.DataHelper.ConvertObjectToDouble(row["DiscountRate"]),
                            TotalPrice = Util.DataHelper.ConvertObjectToDouble(row["TotalPrice"]),
                            TotalPriceIncludeTax = Util.DataHelper.ConvertObjectToDouble(row["TotalPriceIncludeTax"]),
                            UnitPrice = Util.DataHelper.ConvertObjectToDouble(row["UnitPrice"])
                        },
                        ManagementFields = new ManagementFields()
                        {
                            CreateDateTimeUTC = Util.DataHelper.ConvertObjectToDateTime(row["CreateDateTimeUTC"]),
                            LastModifiedDateTimeUTC = Util.DataHelper.ConvertObjectToDateTime(row["LastModifiedDateTimeUTC"])
                        },
                        OPCodes = new List<Data.v2.Common.OPCode.OPCode>(),
                    }).ToList();
                    #endregion

                    if (PackageCodes != null && PackageCodes.Count > 0 && resultDS.Tables.Count > 1 && resultDS.Tables[1].Rows.Count > 0)
                    {
                        foreach (PackageCode packagecode in PackageCodes)
                        {
                            #region OPCodes
                            List<WA.Standard.IF.Data.v2.Common.OPCode.OPCode> OPCodes = null;
                            OPCodes = resultDS.Tables[1].AsEnumerable()
                            .Where(row => Util.DataHelper.ConvertObjectToString(row["DMSPackageCodeNo"]) == packagecode.DMSPackageCodeNo)
                                .Select(row =>
                            new WA.Standard.IF.Data.v2.Common.OPCode.OPCode
                            {
                                DMSOPCodeNo = Util.DataHelper.ConvertObjectToString(row["DMSOPCodeNo"]),
                                Code = Util.DataHelper.ConvertObjectToString(row["Code"]),
                                CorrectionLOP = Util.DataHelper.ConvertObjectToString(row["CorrectionLOP"]),
                                CPSIND = Util.DataHelper.ConvertObjectToString(row["CPSIND"]),
                                DefLinePaymentMethod = Util.DataHelper.ConvertObjectToString(row["DefLinePaymentMethod"]),
                                Description = Util.DataHelper.ConvertObjectToString(row["Description"]),
                                DisplayOPCode = Util.DataHelper.ConvertObjectToString(row["DisplayOPCode"]),
                                DisplayOPDescription = Util.DataHelper.ConvertObjectToString(row["DisplayOPDescription"]),
                                Engine = Util.DataHelper.ConvertObjectToString(row["Engine"]),
                                EstimatedHours = Util.DataHelper.ConvertObjectToDouble(row["EstimatedHours"]),
                                HazardMaterialCharge = Util.DataHelper.ConvertObjectToDouble(row["HazardMaterialCharge"]),
                                Make = Util.DataHelper.ConvertObjectToString(row["Make"]),
                                Mileage = Util.DataHelper.ConvertObjectToString(row["Mileage"]),
                                Model = Util.DataHelper.ConvertObjectToString(row["Model"]),
                                Period = Util.DataHelper.ConvertObjectToString(row["Period"]),
                                PredefinedCauseDescription = Util.DataHelper.ConvertObjectToString(row["PredefinedCauseDescription"]),
                                SkillLevel = Util.DataHelper.ConvertObjectToString(row["SkillLevel"]),
                                Year = Util.DataHelper.ConvertObjectToString(row["Year"]),
                                PriceType = new PriceType()
                                {
                                    DiscountPrice = Util.DataHelper.ConvertObjectToDouble(row["DiscountPrice"]),
                                    DiscountRate = Util.DataHelper.ConvertObjectToDouble(row["DiscountRate"]),
                                    TotalPrice = Util.DataHelper.ConvertObjectToDouble(row["TotalPrice"]),
                                    TotalPriceIncludeTax = Util.DataHelper.ConvertObjectToDouble(row["TotalPriceIncludeTax"]),
                                    UnitPrice = Util.DataHelper.ConvertObjectToDouble(row["UnitPrice"])
                                },
                                Parts = new List<Data.v2.Common.Part.Part>(),
                            }).ToList();
                            #endregion

                            if (OPCodes != null && OPCodes.Count > 0 && resultDS.Tables.Count > 2 && resultDS.Tables[1].Rows.Count > 0)
                            {
                                foreach (WA.Standard.IF.Data.v2.Common.OPCode.OPCode opcode in OPCodes)
                                {
                                    #region Parts
                                    List<WA.Standard.IF.Data.v2.Common.Part.Part> Parts = null;
                                    Parts = resultDS.Tables[2].AsEnumerable()
                                        .Where(row => Util.DataHelper.ConvertObjectToString(row["DMSOPCodeNo"]) == opcode.DMSOPCodeNo)
                                        .Select(row =>
                                    new WA.Standard.IF.Data.v2.Common.Part.Part
                                    {
                                        DisplayPartNumber = Util.DataHelper.ConvertObjectToString(row["DisplayPartNumber"]),
                                        DisplayRemarks = Util.DataHelper.ConvertObjectToString(row["DisplayRemarks"]),
                                        Manufacturer = Util.DataHelper.ConvertObjectToString(row["Manufacturer"]),
                                        PartDescription = Util.DataHelper.ConvertObjectToString(row["PartDescription"]),
                                        PartNumber = Util.DataHelper.ConvertObjectToString(row["PartNumber"]),
                                        PartStatus = Util.DataHelper.ConvertObjectToString(row["PartStatus"]),
                                        PartType = Util.DataHelper.ConvertObjectToString(row["PartType"]),
                                        Quantity = Util.DataHelper.ConvertObjectToDouble(row["Quantity"]),
                                        QuantityOnHand = Util.DataHelper.ConvertObjectToDouble(row["QuantityOnHand"]),
                                        Remarks = Util.DataHelper.ConvertObjectToString(row["Remarks"]),
                                        ServiceType = Util.DataHelper.ConvertObjectToString(row["ServiceType"]),
                                        StockQuantity = Util.DataHelper.ConvertObjectToDouble(row["StockQuantity"]),
                                        StockStatus = Util.DataHelper.ConvertObjectToString(row["StockStatus"]),
                                        UnitOfMeasure = Util.DataHelper.ConvertObjectToString(row["UnitOfMeasure"]),
                                        PriceType = new PriceType()
                                        {
                                            DiscountPrice = Util.DataHelper.ConvertObjectToDouble(row["DiscountPrice"]),
                                            DiscountRate = Util.DataHelper.ConvertObjectToDouble(row["DiscountRate"]),
                                            TotalPrice = Util.DataHelper.ConvertObjectToDouble(row["TotalPrice"]),
                                            TotalPriceIncludeTax = Util.DataHelper.ConvertObjectToDouble(row["TotalPriceIncludeTax"]),
                                            UnitPrice = Util.DataHelper.ConvertObjectToDouble(row["UnitPrice"])
                                        },
                                    }).ToList();
                                    if (Parts != null && Parts.Count > 0)
                                        opcode.Parts = Parts;
                                    #endregion
                                }

                                packagecode.OPCodes = OPCodes;
                            }
                        }

                        response.ResultMessage = GetResultMessageData(PredefinedCode._SuccessDone, PredefinedMessage._SuccessDone);
                        response.PackageCodes = PackageCodes;
                    }
                }
                else
                {
                    response.ResultMessage = GetResultMessageData(PredefinedCode._SuccessNoResult, PredefinedMessage._SuccessNoResult);
                }
                */
                #endregion
            }

            return response;
        }
        public PackageCodeGetResponse PackageCodeGet(PackageCodeGetRequest request)
        {
            PackageCodeGetResponse response = new PackageCodeGetResponse();

            //DMS information set by dealer information
            string proxypath = string.Format("{0}.{1}.{2}.{3}",
                request.TransactionHeader.DocumentVersion,
                request.TransactionHeader.DistributorID,
                request.TransactionHeader.DMSCode,
                request.TransactionHeader.DMSVersion);

            switch (proxypath)
            {
                case "v2.Common.WA.v2":
                    {
                        #region v2.Common.WA.v2 - RTR (Proxy Class Dll Name : _WA.Mapper.v2)

                        #region PackageCodeGet Request Set

                        //Create proxy credential
                        NetworkCredential proxycredential = new NetworkCredential(request.TransactionHeader.Username, request.TransactionHeader.Password);

                        //Create proxy web service from dms web service with credential
                        _WA.Mapper.v2.PackageCode.PackageCode proxyws = new _WA.Mapper.v2.PackageCode.PackageCode(request.TransactionHeader.DMSServerUrl);
                        proxyws.Credentials = proxycredential;

                        //Create proxy request with packagecodeget and transaction
                        _WA.Mapper.v2.PackageCode.PackageCodeGetRequest proxyrequest = new _WA.Mapper.v2.PackageCode.PackageCodeGetRequest();

                        //Create proxy transaction
                        _WA.Mapper.v2.PackageCode.TransactionHeader proxytransactionheader = new _WA.Mapper.v2.PackageCode.TransactionHeader();
                        if (request.TransactionHeader != null)
                        {
                            #region//TransactionHeader Set
                            proxytransactionheader.CountryID = request.TransactionHeader.CountryID;
                            proxytransactionheader.DealerID = request.TransactionHeader.DealerID;
                            proxytransactionheader.DistributorID = request.TransactionHeader.DistributorID;
                            proxytransactionheader.DMSCode = request.TransactionHeader.DMSCode;
                            proxytransactionheader.DMSServerUrl = request.TransactionHeader.DMSServerUrl;
                            proxytransactionheader.DMSVersion = request.TransactionHeader.DMSVersion;
                            proxytransactionheader.DocumentVersion = request.TransactionHeader.DocumentVersion;
                            proxytransactionheader.GroupID = request.TransactionHeader.GroupID;
                            proxytransactionheader.IneterfaceID = request.TransactionHeader.IneterfaceID;
                            proxytransactionheader.Password = request.TransactionHeader.Password;
                            proxytransactionheader.PollingToken = request.TransactionHeader.PollingToken;
                            proxytransactionheader.RequestPollingToken = request.TransactionHeader.RequestPollingToken;
                            proxytransactionheader.RequestType = request.TransactionHeader.RequestType;
                            proxytransactionheader.TransactionId = request.TransactionHeader.TransactionId;
                            proxytransactionheader.TransactionDateTimeLocal = request.TransactionHeader.TransactionDateTimeLocal;
                            proxytransactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeUTC;
                            proxytransactionheader.TransactionType = request.TransactionHeader.TransactionType;
                            proxytransactionheader.Username = request.TransactionHeader.Username;
                            proxytransactionheader.VenderTrackingCode = request.TransactionHeader.VenderTrackingCode;
                            proxyrequest.TransactionHeader = proxytransactionheader;
                            #endregion
                        }

                        //Create proxy packagecodeget
                        _WA.Mapper.v2.PackageCode.PackageCodeGet proxypackagecodeget = new _WA.Mapper.v2.PackageCode.PackageCodeGet();
                        if (request.PackageCodeGet != null)
                        {
                            #region//PackageCodeGet Set
                            proxypackagecodeget.Category = request.PackageCodeGet.Category;
                            proxypackagecodeget.Code = request.PackageCodeGet.Code;
                            proxypackagecodeget.Description = request.PackageCodeGet.Description;
                            proxypackagecodeget.Engine = request.PackageCodeGet.Engine;
                            proxypackagecodeget.LastModifiedDateTimeFromUTC = request.PackageCodeGet.LastModifiedDateTimeFromUTC;
                            proxypackagecodeget.LastModifiedDateTimeToUTC = request.PackageCodeGet.LastModifiedDateTimeToUTC;
                            proxypackagecodeget.Make = request.PackageCodeGet.Make;
                            proxypackagecodeget.Mileage = request.PackageCodeGet.Mileage;
                            proxypackagecodeget.Model = request.PackageCodeGet.Model;
                            proxypackagecodeget.Year = request.PackageCodeGet.Year;
                            proxyrequest.PackageCodeGet = proxypackagecodeget;
                            #endregion
                        }
                        #endregion

                        //Run proxy web method with proxy request
                        _WA.Mapper.v2.PackageCode.PackageCodeGetResponse proxyresponse = proxyws.PackageCodeGet(proxyrequest);

                        //Mapping with Standard Interface Specification Object
                        if (proxyresponse != null)
                        {
                            if (proxyresponse.TransactionHeader != null)
                            {
                                #region//TransactionHeader Set
                                TransactionHeader transactionheader = new TransactionHeader();
                                transactionheader.CountryID = proxyresponse.TransactionHeader.CountryID;
                                transactionheader.DealerID = proxyresponse.TransactionHeader.DealerID;
                                transactionheader.DistributorID = proxyresponse.TransactionHeader.DistributorID;
                                transactionheader.DMSCode = proxyresponse.TransactionHeader.DMSCode;
                                transactionheader.DMSServerUrl = proxyresponse.TransactionHeader.DMSServerUrl;
                                transactionheader.DMSVersion = proxyresponse.TransactionHeader.DMSVersion;
                                transactionheader.DocumentVersion = proxyresponse.TransactionHeader.DocumentVersion;
                                transactionheader.GroupID = proxyresponse.TransactionHeader.GroupID;
                                transactionheader.IneterfaceID = proxyresponse.TransactionHeader.IneterfaceID;
                                transactionheader.Password = proxyresponse.TransactionHeader.Password;
                                transactionheader.PollingToken = proxyresponse.TransactionHeader.PollingToken;
                                transactionheader.RequestPollingToken = proxyresponse.TransactionHeader.RequestPollingToken;
                                transactionheader.RequestType = proxyresponse.TransactionHeader.RequestType;
                                transactionheader.TransactionId = proxyresponse.TransactionHeader.TransactionId;
                                transactionheader.TransactionDateTimeLocal = proxyresponse.TransactionHeader.TransactionDateTimeLocal;
                                transactionheader.TransactionDateTimeUTC = proxyresponse.TransactionHeader.TransactionDateTimeUTC;
                                transactionheader.TransactionType = proxyresponse.TransactionHeader.TransactionType;
                                transactionheader.Username = proxyresponse.TransactionHeader.Username;
                                transactionheader.VenderTrackingCode = proxyresponse.TransactionHeader.VenderTrackingCode;
                                response.TransactionHeader = transactionheader;
                                #endregion
                            }

                            //ResultMessage Set
                            if (proxyresponse.ResultMessage != null)
                            {
                                response.ResultMessage = GetResultMessageData(proxyresponse.ResultMessage.Code, proxyresponse.ResultMessage.Message);
                            }

                            if (proxyresponse.Errors != null)
                            {
                                //Error List Set
                                foreach (_WA.Mapper.v2.PackageCode.Error proxyerror in proxyresponse.Errors)
                                {
                                    if (response.Errors != null)
                                        response.Errors.Add(GetErrorData(proxyerror.Code, proxyerror.Message));
                                    else
                                        response.Errors = GetErrorDataList(proxyerror.Code, proxyerror.Message);
                                }
                            }
                            else
                            {
                                #region //PackageCodeGetResponse Set

                                if (proxyresponse.PackageCodes != null && proxyresponse.PackageCodes.Length > 0)
                                {
                                    #region//PackageCodesGetResponse Set
                                    response.PackageCodes = new List<PackageCode>();
                                    foreach (_WA.Mapper.v2.PackageCode.PackageCode1 proxypackagecode in proxyresponse.PackageCodes)
                                    {
                                        #region //PackageCodes Header
                                        PackageCode packagecode = new PackageCode();
                                        packagecode.Code = proxypackagecode.Code;
                                        packagecode.DefLinePaymentMethod = proxypackagecode.DefLinePaymentMethod;
                                        packagecode.Description = proxypackagecode.Description;
                                        packagecode.DisplayPackageCode = proxypackagecode.DisplayPackageCode;
                                        packagecode.DisplayOperationDescription = proxypackagecode.DisplayOperationDescription;
                                        packagecode.Engine = proxypackagecode.Engine;
                                        packagecode.EstimatedHours = proxypackagecode.EstimatedHours;
                                        packagecode.Make = proxypackagecode.Make;
                                        packagecode.Mileage = proxypackagecode.Mileage;
                                        packagecode.Model = proxypackagecode.Model;
                                        packagecode.Period = proxypackagecode.Period;
                                        packagecode.Year = proxypackagecode.Year;
                                        #endregion

                                        #region //PackageCodes ManagementFields
                                        if (proxypackagecode.ManagementFields != null)
                                        {
                                            ManagementFields managementfields = new ManagementFields();
                                            managementfields.LastModifiedDateTimeUTC = proxypackagecode.ManagementFields.CreateDateTimeUTC;
                                            managementfields.LastModifiedDateTimeUTC = proxypackagecode.ManagementFields.LastModifiedDateTimeUTC;
                                            packagecode.ManagementFields = managementfields;
                                        }
                                        #endregion

                                        #region //PackageCodes PriceType
                                        if (proxypackagecode.PriceType != null)
                                        {
                                            PriceType pricetype = new PriceType();
                                            pricetype.DiscountPrice = proxypackagecode.PriceType.DiscountPrice;
                                            pricetype.DiscountRate = proxypackagecode.PriceType.DiscountRate;
                                            pricetype.TotalPrice = proxypackagecode.PriceType.TotalPrice;
                                            pricetype.TotalPriceIncludeTax = proxypackagecode.PriceType.TotalPriceIncludeTax;
                                            pricetype.UnitPrice = proxypackagecode.PriceType.UnitPrice;
                                            packagecode.PriceType = pricetype;
                                        }
                                        #endregion

                                        if (proxypackagecode.OPCodes != null && proxypackagecode.OPCodes.Length > 0)
                                        {
                                            #region//PackageCodes OPCode
                                            packagecode.OPCodes = new List<Data.v2.Common.PackageCode.OPCode>();
                                            foreach (_WA.Mapper.v2.PackageCode.OPCode proxyopcode in proxypackagecode.OPCodes)
                                            {
                                                #region //PackageCodes OPCode Header
                                                Data.v2.Common.PackageCode.OPCode opcode = new Data.v2.Common.PackageCode.OPCode();
                                                opcode.Code = proxyopcode.Code;
                                                opcode.CorrectionLOP = proxyopcode.CorrectionLOP;
                                                opcode.CPSIND = proxyopcode.CPSIND;
                                                opcode.DefLinePaymentMethod = proxyopcode.DefLinePaymentMethod;
                                                opcode.Description = proxyopcode.Description;
                                                opcode.DisplayOPCode = proxyopcode.DisplayOPCode;
                                                opcode.DisplayOPDescription = proxyopcode.DisplayOPDescription;
                                                opcode.Engine = proxyopcode.Engine;
                                                opcode.EstimatedHours = proxyopcode.EstimatedHours;
                                                opcode.HazardMaterialCharge = proxyopcode.HazardMaterialCharge;
                                                opcode.Make = proxyopcode.Make;
                                                opcode.Mileage = proxyopcode.Mileage;
                                                opcode.Model = proxyopcode.Model;
                                                opcode.Period = proxyopcode.Period;
                                                opcode.PredefinedCauseDescription = proxyopcode.PredefinedCauseDescription;
                                                opcode.SkillLevel = proxyopcode.SkillLevel;
                                                opcode.Year = proxyopcode.Year;
                                                #endregion

                                                #region //PackageCodes OPCode PriceType
                                                if (proxyopcode.PriceType != null)
                                                {
                                                    PriceType pricetype = new PriceType();
                                                    pricetype.DiscountPrice = proxyopcode.PriceType.DiscountPrice;
                                                    pricetype.DiscountRate = proxyopcode.PriceType.DiscountRate;
                                                    pricetype.TotalPrice = proxyopcode.PriceType.TotalPrice;
                                                    pricetype.TotalPriceIncludeTax = proxyopcode.PriceType.TotalPriceIncludeTax;
                                                    pricetype.UnitPrice = proxyopcode.PriceType.UnitPrice;
                                                    opcode.PriceType = pricetype;
                                                }
                                                #endregion

                                                #region //PackageCodes OPCode Parts
                                                if (proxyopcode.Parts != null && proxyopcode.Parts.Length > 0)
                                                {
                                                    opcode.Parts = new List<Data.v2.Common.PackageCode.Part>();
                                                    foreach (_WA.Mapper.v2.PackageCode.Part proxypart in proxyopcode.Parts)
                                                    {
                                                        #region //PackageCodes OPCode Part Header
                                                        Data.v2.Common.PackageCode.Part part = new Data.v2.Common.PackageCode.Part();
                                                        part.DisplayPartNumber = proxypart.DisplayPartNumber;
                                                        part.PartDescription = proxypart.PartDescription;
                                                        part.PartNumber = proxypart.PartNumber;
                                                        part.PartType = proxypart.PartType;
                                                        part.Quantity = proxypart.Quantity;
                                                        part.ServiceType = proxypart.ServiceType;
                                                        part.StockQuantity = proxypart.StockQuantity;
                                                        part.StockStatus = proxypart.StockStatus;
                                                        part.UnitOfMeasure = proxypart.UnitOfMeasure;
                                                        #endregion

                                                        #region //PackageCodes OPCode Part PriceType
                                                        if (proxypart.PriceType != null)
                                                        {
                                                            PriceType pricetype = new PriceType();
                                                            pricetype.DiscountPrice = proxypart.PriceType.DiscountPrice;
                                                            pricetype.DiscountRate = proxypart.PriceType.DiscountRate;
                                                            pricetype.TotalPrice = proxypart.PriceType.TotalPrice;
                                                            pricetype.TotalPriceIncludeTax = proxypart.PriceType.TotalPriceIncludeTax;
                                                            pricetype.UnitPrice = proxypart.PriceType.UnitPrice;
                                                            part.PriceType = pricetype;
                                                        }
                                                        #endregion

                                                        opcode.Parts.Add(part);
                                                    }
                                                }
                                                #endregion

                                                packagecode.OPCodes.Add(opcode);
                                            }
                                            #endregion
                                        }
                                        response.PackageCodes.Add(packagecode);
                                    }
                                    #endregion
                                }
                                else
                                {
                                    response.ResultMessage = GetResultMessageData(ResponseCode.NoResult, ResponseMessage.NoResult);
                                }
                                #endregion
                            }
                        }
                        else
                        {
                            if (response.Errors != null)
                                response.Errors.Add(GetErrorData(ResponseCode.Fail, ResponseMessage.Fail));
                            else
                                response.Errors = GetErrorDataList(ResponseCode.Fail, ResponseMessage.Fail);
                        }
                        #endregion
                    }
                    break;
                case "v2.HMCIS.1C.v4":
                    {
                        #region v2.HMCIS.1C.v4 - RTR (Proxy Class Dll Name : _1C.v4)

                        #region PackageCodeGet Request Set

                        //Create proxy credential
                        NetworkCredential proxycredential = new NetworkCredential(request.TransactionHeader.Username, request.TransactionHeader.Password);

                        //Create proxy web service from dms web service with credential
                        _1C.v4.PackageCode.PackageCode proxyws = new _1C.v4.PackageCode.PackageCode(request.TransactionHeader.DMSServerUrl);
                        proxyws.Credentials = proxycredential;

                        //Create proxy request with packagecodeget and transaction
                        _1C.v4.PackageCode.PackageCodeGetRequest proxyrequest = new _1C.v4.PackageCode.PackageCodeGetRequest();

                        //Create proxy transaction
                        _1C.v4.PackageCode.TransactionHeader proxytransactionheader = new _1C.v4.PackageCode.TransactionHeader();
                        if (request.TransactionHeader != null)
                        {
                            #region//TransactionHeader Set
                            proxytransactionheader.CountryID = request.TransactionHeader.CountryID;
                            proxytransactionheader.DealerID = request.TransactionHeader.DealerID;
                            proxytransactionheader.DistributorID = request.TransactionHeader.DistributorID;
                            proxytransactionheader.DMSCode = request.TransactionHeader.DMSCode;
                            proxytransactionheader.DMSServerUrl = request.TransactionHeader.DMSServerUrl;
                            proxytransactionheader.DMSVersion = request.TransactionHeader.DMSVersion;
                            proxytransactionheader.DocumentVersion = request.TransactionHeader.DocumentVersion;
                            proxytransactionheader.GroupID = request.TransactionHeader.GroupID;
                            proxytransactionheader.IneterfaceID = request.TransactionHeader.IneterfaceID;
                            proxytransactionheader.Password = request.TransactionHeader.Password;
                            proxytransactionheader.PollingToken = request.TransactionHeader.PollingToken;
                            proxytransactionheader.RequestPollingToken = request.TransactionHeader.RequestPollingToken;
                            proxytransactionheader.RequestType = request.TransactionHeader.RequestType;
                            proxytransactionheader.TransactionId = request.TransactionHeader.TransactionId;
                            proxytransactionheader.TransactionDateTimeLocal = request.TransactionHeader.TransactionDateTimeLocal;
                            proxytransactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeUTC;
                            proxytransactionheader.TransactionType = request.TransactionHeader.TransactionType;
                            proxytransactionheader.Username = request.TransactionHeader.Username;
                            proxytransactionheader.VenderTrackingCode = request.TransactionHeader.VenderTrackingCode;
                            proxyrequest.TransactionHeader = proxytransactionheader;
                            #endregion
                        }

                        //Create proxy packagecodeget
                        _1C.v4.PackageCode.PackageCodeGet proxypackagecodeget = new _1C.v4.PackageCode.PackageCodeGet();
                        if (request.PackageCodeGet != null)
                        {
                            #region//PackageCodeGet Set
                            proxypackagecodeget.Category = request.PackageCodeGet.Category;
                            proxypackagecodeget.Code = request.PackageCodeGet.Code;
                            proxypackagecodeget.Description = request.PackageCodeGet.Description;
                            proxypackagecodeget.Engine = request.PackageCodeGet.Engine;
                            proxypackagecodeget.LastModifiedDateTimeFromUTC = request.PackageCodeGet.LastModifiedDateTimeFromUTC;
                            proxypackagecodeget.LastModifiedDateTimeToUTC = request.PackageCodeGet.LastModifiedDateTimeToUTC;
                            proxypackagecodeget.Make = request.PackageCodeGet.Make;
                            proxypackagecodeget.Mileage = request.PackageCodeGet.Mileage;
                            proxypackagecodeget.Model = request.PackageCodeGet.Model;
                            proxypackagecodeget.Year = request.PackageCodeGet.Year;
                            proxyrequest.PackageCodeGet = proxypackagecodeget;
                            #endregion
                        }
                        #endregion

                        //Run proxy web method with proxy request
                        _1C.v4.PackageCode.PackageCodeGetResponse proxyresponse = proxyws.PackageCodeGet(proxyrequest);

                        //Mapping with Standard Interface Specification Object
                        if (proxyresponse != null)
                        {
                            if (proxyresponse.TransactionHeader != null)
                            {
                                #region//TransactionHeader Set
                                TransactionHeader transactionheader = new TransactionHeader();
                                transactionheader.CountryID = proxyresponse.TransactionHeader.CountryID;
                                transactionheader.DealerID = proxyresponse.TransactionHeader.DealerID;
                                transactionheader.DistributorID = proxyresponse.TransactionHeader.DistributorID;
                                transactionheader.DMSCode = proxyresponse.TransactionHeader.DMSCode;
                                transactionheader.DMSServerUrl = proxyresponse.TransactionHeader.DMSServerUrl;
                                transactionheader.DMSVersion = proxyresponse.TransactionHeader.DMSVersion;
                                transactionheader.DocumentVersion = proxyresponse.TransactionHeader.DocumentVersion;
                                transactionheader.GroupID = proxyresponse.TransactionHeader.GroupID;
                                transactionheader.IneterfaceID = proxyresponse.TransactionHeader.IneterfaceID;
                                transactionheader.Password = proxyresponse.TransactionHeader.Password;
                                transactionheader.PollingToken = proxyresponse.TransactionHeader.PollingToken;
                                transactionheader.RequestPollingToken = proxyresponse.TransactionHeader.RequestPollingToken;
                                transactionheader.RequestType = proxyresponse.TransactionHeader.RequestType;
                                transactionheader.TransactionId = proxyresponse.TransactionHeader.TransactionId;
                                transactionheader.TransactionDateTimeLocal = proxyresponse.TransactionHeader.TransactionDateTimeLocal;
                                transactionheader.TransactionDateTimeUTC = proxyresponse.TransactionHeader.TransactionDateTimeUTC;
                                transactionheader.TransactionType = proxyresponse.TransactionHeader.TransactionType;
                                transactionheader.Username = proxyresponse.TransactionHeader.Username;
                                transactionheader.VenderTrackingCode = proxyresponse.TransactionHeader.VenderTrackingCode;
                                response.TransactionHeader = transactionheader;
                                #endregion
                            }

                            //ResultMessage Set
                            if (proxyresponse.ResultMessage != null)
                            {
                                response.ResultMessage = GetResultMessageData(proxyresponse.ResultMessage.Code, proxyresponse.ResultMessage.Message);
                            }

                            if (proxyresponse.Errors != null)
                            {
                                //Error List Set
                                foreach (_1C.v4.PackageCode.Error proxyerror in proxyresponse.Errors)
                                {
                                    if (response.Errors != null)
                                        response.Errors.Add(GetErrorData(proxyerror.Code, proxyerror.Message));
                                    else
                                        response.Errors = GetErrorDataList(proxyerror.Code, proxyerror.Message);
                                }
                            }
                            else
                            {
                                #region //OPCodeGetResponse Set

                                if (proxyresponse.PackageCodes != null && proxyresponse.PackageCodes.Length > 0)
                                {
                                    #region//PackageCodesGetResponse Set
                                    response.PackageCodes = new List<PackageCode>();
                                    foreach (_1C.v4.PackageCode.PackageCode1 proxypackagecode in proxyresponse.PackageCodes)
                                    {
                                        #region //PackageCodes Header
                                        PackageCode packagecode = new PackageCode();
                                        packagecode.Code = proxypackagecode.Code;
                                        packagecode.DefLinePaymentMethod = proxypackagecode.DefLinePaymentMethod;
                                        packagecode.Description = proxypackagecode.Description;
                                        packagecode.DisplayPackageCode = proxypackagecode.DisplayPackageCode;
                                        packagecode.DisplayOperationDescription = proxypackagecode.DisplayOperationDescription;
                                        packagecode.Engine = proxypackagecode.Engine;
                                        packagecode.EstimatedHours = proxypackagecode.EstimatedHours;
                                        packagecode.Make = proxypackagecode.Make;
                                        packagecode.Mileage = proxypackagecode.Mileage;
                                        packagecode.Model = proxypackagecode.Model;
                                        packagecode.Period = proxypackagecode.Period;
                                        packagecode.Year = proxypackagecode.Year;
                                        #endregion

                                        #region //PackageCodes ManagementFields
                                        if (proxypackagecode.ManagementFields != null)
                                        {
                                            ManagementFields managementfields = new ManagementFields();
                                            managementfields.LastModifiedDateTimeUTC = proxypackagecode.ManagementFields.CreateDateTimeUTC;
                                            managementfields.LastModifiedDateTimeUTC = proxypackagecode.ManagementFields.LastModifiedDateTimeUTC;
                                            packagecode.ManagementFields = managementfields;
                                        }
                                        #endregion

                                        #region //PackageCodes PriceType
                                        if (proxypackagecode.PriceType != null)
                                        {
                                            PriceType pricetype = new PriceType();
                                            pricetype.DiscountPrice = proxypackagecode.PriceType.DiscountPrice;
                                            pricetype.DiscountRate = proxypackagecode.PriceType.DiscountRate;
                                            pricetype.TotalPrice = proxypackagecode.PriceType.TotalPrice;
                                            pricetype.TotalPriceIncludeTax = proxypackagecode.PriceType.TotalPriceIncludeTax;
                                            pricetype.UnitPrice = proxypackagecode.PriceType.UnitPrice;
                                            packagecode.PriceType = pricetype;
                                        }
                                        #endregion

                                        if (proxypackagecode.OPCodes != null && proxypackagecode.OPCodes.Length > 0)
                                        {
                                            #region//PackageCodes OPCode
                                            packagecode.OPCodes = new List<Data.v2.Common.PackageCode.OPCode>();
                                            foreach (_1C.v4.PackageCode.OPCode proxyopcode in proxypackagecode.OPCodes)
                                            {
                                                #region //PackageCodes OPCode Header
                                                Data.v2.Common.PackageCode.OPCode opcode = new Data.v2.Common.PackageCode.OPCode();
                                                opcode.Code = proxyopcode.Code;
                                                opcode.CorrectionLOP = proxyopcode.CorrectionLOP;
                                                opcode.CPSIND = proxyopcode.CPSIND;
                                                opcode.DefLinePaymentMethod = proxyopcode.DefLinePaymentMethod;
                                                opcode.Description = proxyopcode.Description;
                                                opcode.DisplayOPCode = proxyopcode.DisplayOPCode;
                                                opcode.DisplayOPDescription = proxyopcode.DisplayOPDescription;
                                                opcode.Engine = proxyopcode.Engine;
                                                opcode.EstimatedHours = proxyopcode.EstimatedHours;
                                                opcode.HazardMaterialCharge = proxyopcode.HazardMaterialCharge;
                                                opcode.Make = proxyopcode.Make;
                                                opcode.Mileage = proxyopcode.Mileage;
                                                opcode.Model = proxyopcode.Model;
                                                opcode.Period = proxyopcode.Period;
                                                opcode.PredefinedCauseDescription = proxyopcode.PredefinedCauseDescription;
                                                opcode.SkillLevel = proxyopcode.SkillLevel;
                                                opcode.Year = proxyopcode.Year;
                                                #endregion

                                                #region //PackageCodes OPCode PriceType
                                                if (proxyopcode.PriceType != null)
                                                {
                                                    PriceType pricetype = new PriceType();
                                                    pricetype.DiscountPrice = proxyopcode.PriceType.DiscountPrice;
                                                    pricetype.DiscountRate = proxyopcode.PriceType.DiscountRate;
                                                    pricetype.TotalPrice = proxyopcode.PriceType.TotalPrice;
                                                    pricetype.TotalPriceIncludeTax = proxyopcode.PriceType.TotalPriceIncludeTax;
                                                    pricetype.UnitPrice = proxyopcode.PriceType.UnitPrice;
                                                    opcode.PriceType = pricetype;
                                                }
                                                #endregion

                                                #region //PackageCodes OPCode Parts
                                                if (proxyopcode.Parts != null && proxyopcode.Parts.Length > 0)
                                                {
                                                    opcode.Parts = new List<Data.v2.Common.PackageCode.Part>();
                                                    foreach (_1C.v4.PackageCode.Part proxypart in proxyopcode.Parts)
                                                    {
                                                        #region //PackageCodes OPCode Part Header
                                                        Data.v2.Common.PackageCode.Part part = new Data.v2.Common.PackageCode.Part();
                                                        part.DisplayPartNumber = proxypart.DisplayPartNumber;
                                                        part.PartDescription = proxypart.PartDescription;
                                                        part.PartNumber = proxypart.PartNumber;
                                                        part.PartType = proxypart.PartType;
                                                        part.Quantity = proxypart.Quantity;
                                                        part.ServiceType = proxypart.ServiceType;
                                                        part.StockQuantity = proxypart.StockQuantity;
                                                        part.StockStatus = proxypart.StockStatus;
                                                        part.UnitOfMeasure = proxypart.UnitOfMeasure;
                                                        #endregion

                                                        #region //PackageCodes OPCode Part PriceType
                                                        if (proxypart.PriceType != null)
                                                        {
                                                            PriceType pricetype = new PriceType();
                                                            pricetype.DiscountPrice = proxypart.PriceType.DiscountPrice;
                                                            pricetype.DiscountRate = proxypart.PriceType.DiscountRate;
                                                            pricetype.TotalPrice = proxypart.PriceType.TotalPrice;
                                                            pricetype.TotalPriceIncludeTax = proxypart.PriceType.TotalPriceIncludeTax;
                                                            pricetype.UnitPrice = proxypart.PriceType.UnitPrice;
                                                            part.PriceType = pricetype;
                                                        }
                                                        #endregion

                                                        opcode.Parts.Add(part);
                                                    }
                                                }
                                                #endregion

                                                packagecode.OPCodes.Add(opcode);
                                            }
                                            #endregion
                                        }
                                        response.PackageCodes.Add(packagecode);
                                    }
                                    #endregion
                                }
                                else
                                {
                                    response.ResultMessage = GetResultMessageData(ResponseCode.NoResult, ResponseMessage.NoResult);
                                }
                                #endregion
                            }
                        }
                        else
                        {
                            if (response.Errors != null)
                                response.Errors.Add(GetErrorData(ResponseCode.Fail, ResponseMessage.Fail));
                            else
                                response.Errors = GetErrorDataList(ResponseCode.Fail, ResponseMessage.Fail);
                        }
                        #endregion
                    }
                    break;
                default: response.Errors = new List<Error>() { new Error() { Code = ResponseCode.NoMatchedProxy, Message = ResponseMessage.NoMatchedProxy } };
                    break;
            }

            return response;
        }