public RepairOrderGetResponse RepairOrderGet(RepairOrderGetRequest request)
        {
            RepairOrderGetResponse response = new RepairOrderGetResponse();

            //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 - Standard (Proxy Class Dll Name : _WA.Mapper.v2)

                        #region RepairOrderGet 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.RepairOrder.RepairOrder proxyws = new _WA.Mapper.v2.RepairOrder.RepairOrder(request.TransactionHeader.DMSServerUrl);
                        proxyws.Credentials = proxycredential;

                        //Create proxy request with repairorderget and transaction
                        _WA.Mapper.v2.RepairOrder.RepairOrderGetRequest proxyrequest = new _WA.Mapper.v2.RepairOrder.RepairOrderGetRequest();

                        //Create proxy transaction
                        _WA.Mapper.v2.RepairOrder.TransactionHeader proxytransactionheader = new _WA.Mapper.v2.RepairOrder.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 repairorderget
                        _WA.Mapper.v2.RepairOrder.RepairOrderGet proxyrepairorderget = new _WA.Mapper.v2.RepairOrder.RepairOrderGet();
                        if (request.RepairOrderGet != null)
                        {
                            #region//RepairOrderGet Set
                            proxyrepairorderget.OpenDateTimeFromLocal = request.RepairOrderGet.OpenDateTimeFromLocal;
                            proxyrepairorderget.OpenDateTimeToLocal = request.RepairOrderGet.OpenDateTimeToLocal;
                            proxyrepairorderget.DMSROID = request.RepairOrderGet.DMSROID;
                            proxyrepairorderget.DMSRONo = request.RepairOrderGet.DMSRONo;
                            proxyrepairorderget.DMSAppointmentID = request.RepairOrderGet.DMSAppointmentID;
                            proxyrepairorderget.DMSAppointmentNo = request.RepairOrderGet.DMSAppointmentNo;
                            proxyrepairorderget.DMSROStatus = request.RepairOrderGet.DMSROStatus;
                            proxyrepairorderget.LastModifiedDateTimeFromUTC = request.RepairOrderGet.LastModifiedDateTimeFromUTC;
                            proxyrepairorderget.LastModifiedDateTimeToUTC = request.RepairOrderGet.LastModifiedDateTimeToUTC;
                            proxyrepairorderget.SAEmployeeID = request.RepairOrderGet.SAEmployeeID;
                            proxyrepairorderget.SAEmployeeName = request.RepairOrderGet.SAEmployeeName;
                            proxyrepairorderget.TCEmployeeID = request.RepairOrderGet.TCEmployeeID;
                            proxyrepairorderget.TCEmployeeName = request.RepairOrderGet.TCEmployeeName;
                            if (request.RepairOrderGet.Customer != null)
                            {
                                _WA.Mapper.v2.RepairOrder.Customer proxycustomer = new _WA.Mapper.v2.RepairOrder.Customer();
                                proxycustomer.DMSCustomerNo = request.RepairOrderGet.Customer.DMSCustomerNo;
                                proxycustomer.LastName = request.RepairOrderGet.Customer.LastName;

                                if (request.RepairOrderGet.Customer.Contacts != null && request.RepairOrderGet.Customer.Contacts.Count > 0)
                                {
                                    int cnt = 0;
                                    proxycustomer.Contacts = new _WA.Mapper.v2.RepairOrder.Contact[request.RepairOrderGet.Customer.Contacts.Count];
                                    foreach (WA.Standard.IF.Data.v2.Common.RepairOrder.Contact contact in request.RepairOrderGet.Customer.Contacts)
                                    {
                                        _WA.Mapper.v2.RepairOrder.Contact proxycontact = new _WA.Mapper.v2.RepairOrder.Contact();
                                        proxycontact.ContactType = contact.ContactType;
                                        proxycontact.ContactValue = contact.ContactValue;
                                        proxycustomer.Contacts[cnt] = proxycontact;
                                        cnt++;
                                    }
                                }
                                proxyrepairorderget.Customer = proxycustomer;
                            }
                            proxyrequest.RepairOrderGet = proxyrepairorderget;
                            #endregion
                        }

                        #endregion

                        //Run proxy web method with proxy request
                        _WA.Mapper.v2.RepairOrder.RepairOrderGetResponse proxyresponse = proxyws.RepairOrderGet(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.RepairOrder.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//RepairOrderGetResponse Set

                                if (proxyresponse.RepairOrderDocuments != null && proxyresponse.RepairOrderDocuments.Length > 0)
                                {
                                    response.RepairOrderDocuments = new List<RepairOrderDocument>();
                                    foreach (_WA.Mapper.v2.RepairOrder.RepairOrderDocument proxyrepairorderdocument in proxyresponse.RepairOrderDocuments)
                                    {
                                        #region //RepairOrderDocuments Header
                                        RepairOrderDocument repairorderdocument = new RepairOrderDocument();
                                        repairorderdocument.DMSRODocumentNo = proxyrepairorderdocument.DMSRODocumentNo;
                                        repairorderdocument.DMSRODocumentStatus = proxyrepairorderdocument.DMSRODocumentStatus;
                                        #endregion

                                        if (proxyrepairorderdocument.RepairOrders != null && proxyrepairorderdocument.RepairOrders.Length > 0)
                                        {
                                            repairorderdocument.RepairOrders = new List<RepairOrder>();
                                            foreach (_WA.Mapper.v2.RepairOrder.RepairOrder1 proxyrepairorder in proxyrepairorderdocument.RepairOrders)
                                            {
                                                #region //RepairOrder Header
                                                RepairOrder repairorder = new RepairOrder();
                                                repairorder.CloseDateTimeLocal = proxyrepairorder.CloseDateTimeLocal;
                                                repairorder.DeliveryDateTimeLocal = proxyrepairorder.DeliveryDateTimeLocal;
                                                repairorder.DMSROID = proxyrepairorder.DMSROID;
                                                repairorder.DMSRONo = proxyrepairorder.DMSRONo;
                                                repairorder.DMSROStatus = proxyrepairorder.DMSROStatus;
                                                repairorder.HangTagColor = proxyrepairorder.HangTagColor;
                                                repairorder.HangTagNo = proxyrepairorder.HangTagNo;
                                                repairorder.InMileage = proxyrepairorder.InMileage;
                                                repairorder.OpenDateTimeLocal = proxyrepairorder.OpenDateTimeLocal;
                                                repairorder.OutMileage = proxyrepairorder.OutMileage;
                                                repairorder.PaymentMethod = proxyrepairorder.PaymentMethod;
                                                repairorder.ROChannel = proxyrepairorder.ROChannel;
                                                repairorder.SAEmployeeID = proxyrepairorder.SAEmployeeID;
                                                repairorder.SAEmployeeName = proxyrepairorder.SAEmployeeName;
                                                repairorder.ServiceType = proxyrepairorder.ServiceType;
                                                repairorder.TCEmployeeID = proxyrepairorder.TCEmployeeID;
                                                repairorder.TCEmployeeName = proxyrepairorder.TCEmployeeName;
                                                repairorder.WorkType = proxyrepairorder.WorkType;
                                                #endregion

                                                #region//RepairOrder CustomerParts
                                                if (proxyrepairorder.CustomerParts != null && proxyrepairorder.CustomerParts.Length > 0)
                                                {
                                                    repairorder.CustomerParts = new List<CustomerPart>();
                                                    foreach (_WA.Mapper.v2.RepairOrder.CustomerPart proxycustomerpart in proxyrepairorder.CustomerParts)
                                                    {
                                                        CustomerPart customerpart = new CustomerPart();
                                                        customerpart.Comment = proxycustomerpart.Comment;
                                                        customerpart.PartDescription = proxycustomerpart.PartDescription;
                                                        customerpart.PartNumber = proxycustomerpart.PartNumber;
                                                        customerpart.Quantity = proxycustomerpart.Quantity;
                                                        customerpart.UnitOfMeasure = proxycustomerpart.UnitOfMeasure;
                                                        repairorder.CustomerParts.Add(customerpart);
                                                    }
                                                }
                                                #endregion

                                                #region //RepairOrder AdditionalFields
                                                if (proxyrepairorder.AdditionalFields != null && proxyrepairorder.AdditionalFields.Length > 0)
                                                {
                                                    repairorder.AdditionalFields = new List<AdditionalField>();
                                                    foreach (_WA.Mapper.v2.RepairOrder.AdditionalField proxyadditionalfield in proxyrepairorder.AdditionalFields)
                                                    {
                                                        AdditionalField additionalfield = new AdditionalField();
                                                        additionalfield.AdditionalFieldName = proxyadditionalfield.Name;
                                                        additionalfield.AdditionalFieldValue = proxyadditionalfield.Value;
                                                        repairorder.AdditionalFields.Add(additionalfield);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder JobRefs
                                                if (proxyrepairorder.JobRefs != null && proxyrepairorder.JobRefs.Length > 0)
                                                {
                                                    repairorder.JobRefs = new List<JobRef>();
                                                    foreach (_WA.Mapper.v2.RepairOrder.JobRef proxyjobref in proxyrepairorder.JobRefs)
                                                    {
                                                        JobRef jobref = new JobRef();
                                                        jobref.DMSJobNo = proxyjobref.DMSJobNo;
                                                        jobref.DMSJobStatus = proxyjobref.DMSJobStatus;
                                                        repairorder.JobRefs.Add(jobref);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder ManagementFields
                                                if (proxyrepairorder.ManagementFields != null)
                                                {
                                                    ManagementFields managementfields = new ManagementFields();
                                                    managementfields.CreateDateTimeUTC = proxyrepairorder.ManagementFields.CreateDateTimeUTC;
                                                    managementfields.LastModifiedDateTimeUTC = proxyrepairorder.ManagementFields.LastModifiedDateTimeUTC;
                                                    repairorder.ManagementFields = managementfields;
                                                }
                                                #endregion

                                                #region//RepairOrder Options
                                                if (proxyrepairorder.Options != null && proxyrepairorder.Options.Length > 0)
                                                {
                                                    repairorder.Options = new List<Option>();
                                                    foreach (_WA.Mapper.v2.RepairOrder.Option proxyoption in proxyrepairorder.Options)
                                                    {
                                                        Option option = new Option();
                                                        option.OptionName = proxyoption.Name;
                                                        option.OptionValue = proxyoption.Value;
                                                        repairorder.Options.Add(option);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder PriceType
                                                if (proxyrepairorder.PriceType != null)
                                                {
                                                    PriceType pricetype = new PriceType();
                                                    pricetype.DiscountPrice = proxyrepairorder.PriceType.DiscountPrice;
                                                    pricetype.DiscountRate = proxyrepairorder.PriceType.DiscountRate;
                                                    pricetype.TotalPrice = proxyrepairorder.PriceType.TotalPrice;
                                                    pricetype.TotalPriceIncludeTax = proxyrepairorder.PriceType.TotalPriceIncludeTax;
                                                    pricetype.UnitPrice = proxyrepairorder.PriceType.UnitPrice;
                                                    repairorder.PriceType = pricetype;
                                                }
                                                #endregion

                                                #region//RepairOrder AppointmentRef
                                                if (proxyrepairorder.AppointmentRef != null)
                                                {
                                                    AppointmentRef appointmentref = new AppointmentRef();
                                                    appointmentref.DMSAppointmentNo = proxyrepairorder.AppointmentRef.DMSAppointmentNo;
                                                    appointmentref.DMSAppointmentStatus = proxyrepairorder.AppointmentRef.DMSAppointmentStatus;
                                                    repairorder.AppointmentRef = appointmentref;
                                                }
                                                #endregion

                                                #region//RepairOrder Customers
                                                if (proxyrepairorder.Customers != null && proxyrepairorder.Customers.Length > 0)
                                                {
                                                    repairorder.Customers = new List<Data.v2.Common.Customer.Customer>();
                                                    foreach (_WA.Mapper.v2.RepairOrder.Customer1 proxycustomer in proxyrepairorder.Customers)
                                                    {
                                                        #region//RepairOrder Customer Header
                                                        WA.Standard.IF.Data.v2.Common.Customer.Customer customer = new Data.v2.Common.Customer.Customer();
                                                        customer.CardNo = proxycustomer.CardNo;
                                                        customer.CorporateInfos = customer.CorporateInfos;
                                                        customer.CustomerInfoType = customer.CustomerInfoType;
                                                        customer.DMSCustomerNo = proxycustomer.DMSCustomerNo;
                                                        customer.Email = proxycustomer.Email;
                                                        customer.FirstName = proxycustomer.FirstName;
                                                        customer.FullName = proxycustomer.FullName;
                                                        customer.Gender = proxycustomer.Gender;
                                                        customer.LastName = proxycustomer.LastName;
                                                        customer.MiddleName = proxycustomer.MiddleName;
                                                        customer.Salutation = proxycustomer.Salutation;
                                                        #endregion

                                                        #region//RepairOrder Customer Addresses
                                                        if (proxycustomer.Addresses != null && proxycustomer.Addresses.Length > 0)
                                                        {
                                                            customer.Addresses = new List<Data.v2.Common.Customer.Address>();
                                                            foreach (_WA.Mapper.v2.RepairOrder.Address proxyaddress in proxycustomer.Addresses)
                                                            {
                                                                Data.v2.Common.Customer.Address address = new Data.v2.Common.Customer.Address();
                                                                address.Address1 = proxyaddress.Address1;
                                                                address.Address2 = proxyaddress.Address2;
                                                                address.AddressType = proxyaddress.AddressType;
                                                                address.City = proxyaddress.City;
                                                                address.Country = proxyaddress.Country;
                                                                address.State = proxyaddress.State;
                                                                address.ZipCode = proxyaddress.ZipCode;
                                                                customer.Addresses.Add(address);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder Customer Contacts
                                                        if (proxycustomer.Contacts != null && proxycustomer.Contacts.Length > 0)
                                                        {
                                                            customer.Contacts = new List<Data.v2.Common.Customer.Contact>();
                                                            foreach (_WA.Mapper.v2.RepairOrder.Contact1 proxycontact in proxycustomer.Contacts)
                                                            {
                                                                Data.v2.Common.Customer.Contact contact = new Data.v2.Common.Customer.Contact();
                                                                contact.ContactMethodYN = proxycontact.ContactMethodYN;
                                                                contact.ContactType = proxycontact.ContactType;
                                                                contact.ContactValue = proxycontact.ContactValue;
                                                                customer.Contacts.Add(contact);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder Customer SpecialMessage
                                                        if (proxycustomer.SpecialMessage != null)
                                                        {
                                                            Data.v2.Common.Customer.SpecialMessage specialmessage = new Data.v2.Common.Customer.SpecialMessage();
                                                            specialmessage.Message = proxycustomer.SpecialMessage.Message;
                                                            customer.SpecialMessage = specialmessage;
                                                        }
                                                        #endregion

                                                        #region//RepairOrder Customer CorporateInfos
                                                        if (proxycustomer.CorporateInfos != null && proxycustomer.CorporateInfos.Length > 0)
                                                        {
                                                            customer.CorporateInfos = new List<Data.v2.Common.Customer.CorporateInfo>();
                                                            foreach (_WA.Mapper.v2.RepairOrder.CorporateInfo proxycorporateinfo in proxycustomer.CorporateInfos)
                                                            {
                                                                Data.v2.Common.Customer.CorporateInfo corporateinfo = new Data.v2.Common.Customer.CorporateInfo();
                                                                corporateinfo.CorporateInfoName = proxycorporateinfo.Name;
                                                                corporateinfo.CorporateInfoValue = proxycorporateinfo.Value;
                                                                customer.CorporateInfos.Add(corporateinfo);
                                                            }
                                                        }
                                                        #endregion

                                                        repairorder.Customers.Add(customer);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder Vehicle
                                                if (proxyrepairorder.Vehicle != null)
                                                {
                                                    if (proxyrepairorder.Vehicle != null)
                                                    {
                                                        #region//RepairOrder Vehicle Header
                                                        Data.v2.Common.Vehicle.Vehicle vehicle = new Data.v2.Common.Vehicle.Vehicle();
                                                        vehicle.Color = proxyrepairorder.Vehicle.Color;
                                                        vehicle.Cylinders = proxyrepairorder.Vehicle.Cylinders;
                                                        vehicle.DateDelivered = proxyrepairorder.Vehicle.DateDelivered;
                                                        vehicle.DateInService = proxyrepairorder.Vehicle.DateInService;
                                                        vehicle.DeclinedJob = proxyrepairorder.Vehicle.DeclinedJob;
                                                        vehicle.DisplayDescription = proxyrepairorder.Vehicle.DisplayDescription;
                                                        vehicle.DMSVehicleNo = proxyrepairorder.Vehicle.DMSVehicleNo;
                                                        vehicle.EngineType = proxyrepairorder.Vehicle.EngineType;
                                                        vehicle.ExtendedWarranty = proxyrepairorder.Vehicle.ExtendedWarranty;
                                                        vehicle.FuelType = proxyrepairorder.Vehicle.FuelType;
                                                        vehicle.FullModelName = proxyrepairorder.Vehicle.FullModelName;
                                                        vehicle.InsuranceDate = proxyrepairorder.Vehicle.InsuranceDate;
                                                        vehicle.LastMileage = proxyrepairorder.Vehicle.LastMileage;
                                                        vehicle.LastServiceDate = proxyrepairorder.Vehicle.LastServiceDate;
                                                        vehicle.LastSixVIN = proxyrepairorder.Vehicle.LastSixVIN;
                                                        vehicle.LicenseNumber = proxyrepairorder.Vehicle.LicenseNumber;
                                                        vehicle.LicensePlateNo = proxyrepairorder.Vehicle.LicensePlateNo;
                                                        vehicle.Make = proxyrepairorder.Vehicle.Make;
                                                        vehicle.ModelCode = proxyrepairorder.Vehicle.ModelCode;
                                                        vehicle.ModelName = proxyrepairorder.Vehicle.ModelName;
                                                        vehicle.ModelYear = proxyrepairorder.Vehicle.ModelYear;
                                                        vehicle.PendingJob = proxyrepairorder.Vehicle.PendingJob;
                                                        vehicle.StockNumber = proxyrepairorder.Vehicle.StockNumber;
                                                        vehicle.Trim = proxyrepairorder.Vehicle.Trim;
                                                        vehicle.VehicleType = proxyrepairorder.Vehicle.VehicleType;
                                                        vehicle.VIN = proxyrepairorder.Vehicle.VIN;
                                                        vehicle.WarrantyMiles = proxyrepairorder.Vehicle.WarrantyMiles;
                                                        vehicle.WarrantyMonths = proxyrepairorder.Vehicle.WarrantyMonths;
                                                        vehicle.WarrantyStartDate = proxyrepairorder.Vehicle.WarrantyStartDate;
                                                        #endregion

                                                        #region//RepairOrder Vehicle Campaigns
                                                        if (proxyrepairorder.Vehicle.Campaigns != null && proxyrepairorder.Vehicle.Campaigns.Length > 0)
                                                        {
                                                            vehicle.Campaigns = new List<Data.v2.Common.Vehicle.Campaign>();
                                                            foreach (_WA.Mapper.v2.RepairOrder.Campaign proxycampaign in proxyrepairorder.Vehicle.Campaigns)
                                                            {
                                                                Data.v2.Common.Vehicle.Campaign campaign = new Data.v2.Common.Vehicle.Campaign();
                                                                campaign.CampaignDescription = proxycampaign.CampaignDescription;
                                                                campaign.CampaignID = proxycampaign.CampaignID;
                                                                campaign.CampaignPerformed = proxycampaign.CampaignPerformed;
                                                                vehicle.Campaigns.Add(campaign);
                                                            }
                                                        }
                                                        #endregion

                                                        repairorder.Vehicle = vehicle;
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder RequestItems
                                                if (proxyrepairorder.RequestItems != null && proxyrepairorder.RequestItems.Length > 0)
                                                {
                                                    repairorder.RequestItems = new List<RequestItem>();
                                                    foreach (_WA.Mapper.v2.RepairOrder.RequestItem proxyrequestitem in proxyrepairorder.RequestItems)
                                                    {
                                                        #region//RepairOrder RequestItem Header
                                                        RequestItem requestitem = new RequestItem();
                                                        requestitem.CPSIND = proxyrequestitem.CPSIND;
                                                        requestitem.RequestCode = proxyrequestitem.RequestCode;
                                                        requestitem.RequestDescription = proxyrequestitem.RequestDescription;
                                                        requestitem.ServiceLineNumber = proxyrequestitem.ServiceLineNumber;
                                                        requestitem.ServiceLineStatus = proxyrequestitem.ServiceLineStatus;
                                                        requestitem.ServiceType = proxyrequestitem.ServiceType;
                                                        requestitem.TCEmployeeID = proxyrequestitem.TCEmployeeID;
                                                        requestitem.TCEmployeeName = proxyrequestitem.TCEmployeeName;
                                                        requestitem.WorkType = proxyrequestitem.WorkType;
                                                        #endregion

                                                        #region//RepairOrder RequestItem Comments
                                                        if (proxyrequestitem.Comments != null && proxyrequestitem.Comments.Length > 0)
                                                        {
                                                            requestitem.Comments = new List<Comment>();
                                                            foreach (_WA.Mapper.v2.RepairOrder.Comment proxycomment in proxyrequestitem.Comments)
                                                            {
                                                                Comment comment = new Comment();
                                                                comment.DescriptionComment = proxycomment.DescriptionComment;
                                                                comment.SequenceNumber = proxycomment.SequenceNumber;
                                                                requestitem.Comments.Add(comment);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder RequestItem Descriptions
                                                        if (proxyrequestitem.Descriptions != null && proxyrequestitem.Descriptions.Length > 0)
                                                        {
                                                            requestitem.Descriptions = new List<Description>();
                                                            foreach (_WA.Mapper.v2.RepairOrder.Description proxydescription in proxyrequestitem.Descriptions)
                                                            {
                                                                Description description = new Description();
                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                requestitem.Descriptions.Add(description);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder RequestItem OPCodes
                                                        if (proxyrequestitem.OPCodes != null && proxyrequestitem.OPCodes.Length > 0)
                                                        {
                                                            requestitem.OPCodes = new List<OPCode>();
                                                            foreach (_WA.Mapper.v2.RepairOrder.OPCode proxyopcode in proxyrequestitem.OPCodes)
                                                            {
                                                                #region//RepairOrder RequestItem OPCode Header
                                                                OPCode opcode = new OPCode();
                                                                opcode.ActualHours = proxyopcode.ActualHours;
                                                                opcode.Code = proxyopcode.Code;
                                                                opcode.Description = proxyopcode.Description;
                                                                opcode.EstimatedHours = proxyopcode.EstimatedHours;
                                                                opcode.SequenceNumber = proxyopcode.SequenceNumber;
                                                                opcode.ServiceType = proxyopcode.ServiceType;
                                                                opcode.SkillLevel = proxyopcode.SkillLevel;
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode Descriptions
                                                                if (proxyopcode.Descriptions != null && proxyopcode.Descriptions.Length > 0)
                                                                {
                                                                    opcode.Descriptions = new List<Description>();
                                                                    foreach (_WA.Mapper.v2.RepairOrder.Description proxydescription in proxyopcode.Descriptions)
                                                                    {
                                                                        Description description = new Description();
                                                                        description.DescriptionComment = proxydescription.DescriptionComment;
                                                                        description.SequenceNumber = proxydescription.SequenceNumber;
                                                                        opcode.Descriptions.Add(description);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode Causes
                                                                if (proxyopcode.Causes != null && proxyopcode.Causes.Length > 0)
                                                                {
                                                                    opcode.Causes = new List<Cause>();
                                                                    foreach (_WA.Mapper.v2.RepairOrder.Cause proxycause in proxyopcode.Causes)
                                                                    {
                                                                        Cause cause = new Cause();
                                                                        cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                                                        cause.Comment = proxycause.Comment;
                                                                        cause.SequenceNumber = proxycause.SequenceNumber;
                                                                        opcode.Causes.Add(cause);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode Corrections
                                                                if (proxyopcode.Corrections != null && proxyopcode.Corrections.Length > 0)
                                                                {
                                                                    opcode.Corrections = new List<Correction>();
                                                                    foreach (_WA.Mapper.v2.RepairOrder.Correction proxycorrection in proxyopcode.Corrections)
                                                                    {
                                                                        Correction correction = new Correction();
                                                                        correction.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                                                        correction.Comment = proxycorrection.Comment;
                                                                        correction.SequenceNumber = proxycorrection.SequenceNumber;
                                                                        opcode.Corrections.Add(correction);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem 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//RepairOrder RequestItem OPCode Parts
                                                                if (proxyopcode.Parts != null && proxyopcode.Parts.Length > 0)
                                                                {
                                                                    opcode.Parts = new List<Part>();
                                                                    foreach (_WA.Mapper.v2.RepairOrder.Part proxypart in proxyopcode.Parts)
                                                                    {
                                                                        #region//RepairOrder RequestItem OPCode Parts Header
                                                                        Part part = new Part();
                                                                        part.DisplayPartNumber = proxypart.DisplayPartNumber;
                                                                        part.PartDescription = proxypart.PartDescription;
                                                                        part.PartNumber = proxypart.PartNumber;
                                                                        part.PartType = proxypart.PartType;
                                                                        part.Quantity = proxypart.Quantity;
                                                                        part.SequenceNumber = proxypart.SequenceNumber;
                                                                        part.ServiceType = proxypart.ServiceType;
                                                                        part.StockQuantity = proxypart.StockQuantity;
                                                                        part.StockStatus = proxypart.StockStatus;
                                                                        part.UnitOfMeasure = proxypart.UnitOfMeasure;
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Parts Descriptions
                                                                        if (proxypart.Descriptions != null && proxypart.Descriptions.Length > 0)
                                                                        {
                                                                            part.Descriptions = new List<Description>();
                                                                            foreach (_WA.Mapper.v2.RepairOrder.Description proxydescription in proxypart.Descriptions)
                                                                            {
                                                                                Description description = new Description();
                                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                                part.Descriptions.Add(description);
                                                                            }
                                                                        }
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Parts 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

                                                                #region//RepairOrder RequestItem OPCode Sublets
                                                                if (proxyopcode.Sublets != null && proxyopcode.Sublets.Length > 0)
                                                                {
                                                                    opcode.Sublets = new List<Sublet>();
                                                                    foreach (_WA.Mapper.v2.RepairOrder.Sublet proxysublet in proxyopcode.Sublets)
                                                                    {
                                                                        #region//RepairOrder RequestItem OPCode Sublet Header
                                                                        Sublet sublet = new Sublet();
                                                                        sublet.SequenceNumber = proxysublet.SequenceNumber;
                                                                        sublet.ServiceType = proxysublet.ServiceType;
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Sublets Descriptions
                                                                        if (proxysublet.Descriptions != null && proxysublet.Descriptions.Length > 0)
                                                                        {
                                                                            sublet.Descriptions = new List<Description>();
                                                                            foreach (_WA.Mapper.v2.RepairOrder.Description proxydescription in proxysublet.Descriptions)
                                                                            {
                                                                                Description description = new Description();
                                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                                sublet.Descriptions.Add(description);
                                                                            }
                                                                        }
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Sublets PriceType
                                                                        if (proxysublet.PriceType != null)
                                                                        {
                                                                            PriceType pricetype = new PriceType();
                                                                            pricetype.DiscountPrice = proxysublet.PriceType.DiscountPrice;
                                                                            pricetype.DiscountRate = proxysublet.PriceType.DiscountRate;
                                                                            pricetype.TotalPrice = proxysublet.PriceType.TotalPrice;
                                                                            pricetype.TotalPriceIncludeTax = proxysublet.PriceType.TotalPriceIncludeTax;
                                                                            pricetype.UnitPrice = proxysublet.PriceType.UnitPrice;
                                                                            sublet.PriceType = pricetype;
                                                                        }
                                                                        #endregion

                                                                        opcode.Sublets.Add(sublet);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode MISCs
                                                                if (proxyopcode.MISCs != null && proxyopcode.MISCs.Length > 0)
                                                                {
                                                                    opcode.MISCs = new List<MISC>();
                                                                    foreach (_WA.Mapper.v2.RepairOrder.MISC proxymisc in proxyopcode.MISCs)
                                                                    {
                                                                        #region//RepairOrder RequestItem OPCode MISC Header
                                                                        MISC misc = new MISC();
                                                                        misc.SequenceNumber = proxymisc.SequenceNumber;
                                                                        misc.ServiceType = proxymisc.ServiceType;
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode MISCs Descriptions
                                                                        if (proxymisc.Descriptions != null && proxymisc.Descriptions.Length > 0)
                                                                        {
                                                                            misc.Descriptions = new List<Description>();
                                                                            foreach (_WA.Mapper.v2.RepairOrder.Description proxydescription in proxymisc.Descriptions)
                                                                            {
                                                                                Description description = new Description();
                                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                                misc.Descriptions.Add(description);
                                                                            }
                                                                        }
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode MISCs PriceType
                                                                        if (proxymisc.PriceType != null)
                                                                        {
                                                                            PriceType pricetype = new PriceType();
                                                                            pricetype.DiscountPrice = proxymisc.PriceType.DiscountPrice;
                                                                            pricetype.DiscountRate = proxymisc.PriceType.DiscountRate;
                                                                            pricetype.TotalPrice = proxymisc.PriceType.TotalPrice;
                                                                            pricetype.TotalPriceIncludeTax = proxymisc.PriceType.TotalPriceIncludeTax;
                                                                            pricetype.UnitPrice = proxymisc.PriceType.UnitPrice;
                                                                            misc.PriceType = pricetype;
                                                                        }
                                                                        #endregion

                                                                        opcode.MISCs.Add(misc);
                                                                    }
                                                                }
                                                                #endregion

                                                                requestitem.OPCodes.Add(opcode);
                                                            }
                                                        }
                                                        #endregion

                                                        repairorder.RequestItems.Add(requestitem);
                                                    }
                                                }
                                                #endregion

                                                repairorderdocument.RepairOrders.Add(repairorder);
                                            }
                                        }
                                        response.RepairOrderDocuments.Add(repairorderdocument);
                                    }
                                }
                                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 RepairOrderGet 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.RepairOrder.RepairOrder proxyws = new _1C.v4.RepairOrder.RepairOrder(request.TransactionHeader.DMSServerUrl);
                        proxyws.Credentials = proxycredential;

                        //Create proxy request with repairorderget and transaction
                        _1C.v4.RepairOrder.RepairOrderGetRequest proxyrequest = new _1C.v4.RepairOrder.RepairOrderGetRequest();

                        //Create proxy transaction
                        _1C.v4.RepairOrder.TransactionHeader proxytransactionheader = new _1C.v4.RepairOrder.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 repairorderget
                        _1C.v4.RepairOrder.RepairOrderGet proxyrepairorderget = new _1C.v4.RepairOrder.RepairOrderGet();
                        if (request.RepairOrderGet != null)
                        {
                            #region//RepairOrderGet Set
                            proxyrepairorderget.OpenDateTimeFromLocal = request.RepairOrderGet.OpenDateTimeFromLocal;
                            proxyrepairorderget.OpenDateTimeToLocal = request.RepairOrderGet.OpenDateTimeToLocal;
                            proxyrepairorderget.DMSROID = request.RepairOrderGet.DMSROID;
                            proxyrepairorderget.DMSRONo = request.RepairOrderGet.DMSRONo;
                            proxyrepairorderget.DMSAppointmentID = request.RepairOrderGet.DMSAppointmentID;
                            proxyrepairorderget.DMSAppointmentNo = request.RepairOrderGet.DMSAppointmentNo;
                            proxyrepairorderget.DMSROStatus = request.RepairOrderGet.DMSROStatus;
                            proxyrepairorderget.LastModifiedDateTimeFromUTC = request.RepairOrderGet.LastModifiedDateTimeFromUTC;
                            proxyrepairorderget.LastModifiedDateTimeToUTC = request.RepairOrderGet.LastModifiedDateTimeToUTC;
                            proxyrepairorderget.SAEmployeeID = request.RepairOrderGet.SAEmployeeID;
                            proxyrepairorderget.SAEmployeeName = request.RepairOrderGet.SAEmployeeName;
                            proxyrepairorderget.TCEmployeeID = request.RepairOrderGet.TCEmployeeID;
                            proxyrepairorderget.TCEmployeeName = request.RepairOrderGet.TCEmployeeName;
                            if (request.RepairOrderGet.Customer != null)
                            {
                                _1C.v4.RepairOrder.Customer proxycustomer = new _1C.v4.RepairOrder.Customer();
                                proxycustomer.DMSCustomerNo = request.RepairOrderGet.Customer.DMSCustomerNo;
                                proxycustomer.LastName = request.RepairOrderGet.Customer.LastName;

                                if (request.RepairOrderGet.Customer.Contacts != null && request.RepairOrderGet.Customer.Contacts.Count > 0)
                                {
                                    int cnt = 0;
                                    proxycustomer.Contacts = new _1C.v4.RepairOrder.Contact[request.RepairOrderGet.Customer.Contacts.Count];
                                    foreach (WA.Standard.IF.Data.v2.Common.RepairOrder.Contact contact in request.RepairOrderGet.Customer.Contacts)
                                    {
                                        _1C.v4.RepairOrder.Contact proxycontact = new _1C.v4.RepairOrder.Contact();
                                        proxycontact.ContactType = contact.ContactType;
                                        proxycontact.ContactValue = contact.ContactValue;
                                        proxycustomer.Contacts[cnt] = proxycontact;
                                        cnt++;
                                    }
                                }
                                proxyrepairorderget.Customer = proxycustomer;
                            }
                            proxyrequest.RepairOrderGet = proxyrepairorderget;
                            #endregion
                        }

                        #endregion

                        //Run proxy web method with proxy request
                        _1C.v4.RepairOrder.RepairOrderGetResponse proxyresponse = proxyws.RepairOrderGet(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.RepairOrder.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//RepairOrderGetResponse Set

                                if (proxyresponse.RepairOrderDocuments != null && proxyresponse.RepairOrderDocuments.Length > 0)
                                {
                                    response.RepairOrderDocuments = new List<RepairOrderDocument>();
                                    foreach (_1C.v4.RepairOrder.RepairOrderDocument proxyrepairorderdocument in proxyresponse.RepairOrderDocuments)
                                    {
                                        #region //RepairOrderDocuments Header
                                        RepairOrderDocument repairorderdocument = new RepairOrderDocument();
                                        repairorderdocument.DMSRODocumentNo = proxyrepairorderdocument.DMSRODocumentNo;
                                        repairorderdocument.DMSRODocumentStatus = proxyrepairorderdocument.DMSRODocumentStatus;
                                        #endregion

                                        if (proxyrepairorderdocument.RepairOrders != null && proxyrepairorderdocument.RepairOrders.Length > 0)
                                        {
                                            repairorderdocument.RepairOrders = new List<RepairOrder>();
                                            foreach (_1C.v4.RepairOrder.RepairOrder1 proxyrepairorder in proxyrepairorderdocument.RepairOrders)
                                            {
                                                #region //RepairOrder Header
                                                RepairOrder repairorder = new RepairOrder();
                                                repairorder.CloseDateTimeLocal = proxyrepairorder.CloseDateTimeLocal;
                                                repairorder.DeliveryDateTimeLocal = proxyrepairorder.DeliveryDateTimeLocal;
                                                repairorder.DMSROID = proxyrepairorder.DMSROID;
                                                repairorder.DMSRONo = proxyrepairorder.DMSRONo;
                                                repairorder.DMSROStatus = proxyrepairorder.DMSROStatus;
                                                repairorder.HangTagColor = proxyrepairorder.HangTagColor;
                                                repairorder.HangTagNo = proxyrepairorder.HangTagNo;
                                                repairorder.InMileage = proxyrepairorder.InMileage;
                                                repairorder.OpenDateTimeLocal = proxyrepairorder.OpenDateTimeLocal;
                                                repairorder.OutMileage = proxyrepairorder.OutMileage;
                                                repairorder.PaymentMethod = proxyrepairorder.PaymentMethod;
                                                repairorder.ROChannel = proxyrepairorder.ROChannel;
                                                repairorder.SAEmployeeID = proxyrepairorder.SAEmployeeID;
                                                repairorder.SAEmployeeName = proxyrepairorder.SAEmployeeName;
                                                repairorder.ServiceType = proxyrepairorder.ServiceType;
                                                repairorder.TCEmployeeID = proxyrepairorder.TCEmployeeID;
                                                repairorder.TCEmployeeName = proxyrepairorder.TCEmployeeName;
                                                repairorder.WorkType = proxyrepairorder.WorkType;
                                                #endregion

                                                #region//RepairOrder CustomerParts
                                                if (proxyrepairorder.CustomerParts != null && proxyrepairorder.CustomerParts.Length > 0)
                                                {
                                                    repairorder.CustomerParts = new List<CustomerPart>();
                                                    foreach (_1C.v4.RepairOrder.CustomerPart proxycustomerpart in proxyrepairorder.CustomerParts)
                                                    {
                                                        CustomerPart customerpart = new CustomerPart();
                                                        customerpart.Comment = proxycustomerpart.Comment;
                                                        customerpart.PartDescription = proxycustomerpart.PartDescription;
                                                        customerpart.PartNumber = proxycustomerpart.PartNumber;
                                                        customerpart.Quantity = proxycustomerpart.Quantity;
                                                        customerpart.UnitOfMeasure = proxycustomerpart.UnitOfMeasure;
                                                        repairorder.CustomerParts.Add(customerpart);
                                                    }
                                                }
                                                #endregion

                                                #region //RepairOrder AdditionalFields
                                                if (proxyrepairorder.AdditionalFields != null && proxyrepairorder.AdditionalFields.Length > 0)
                                                {
                                                    repairorder.AdditionalFields = new List<AdditionalField>();
                                                    foreach (_1C.v4.RepairOrder.AdditionalField proxyadditionalfield in proxyrepairorder.AdditionalFields)
                                                    {
                                                        AdditionalField additionalfield = new AdditionalField();
                                                        additionalfield.AdditionalFieldName = proxyadditionalfield.Name;
                                                        additionalfield.AdditionalFieldValue = proxyadditionalfield.Value;
                                                        repairorder.AdditionalFields.Add(additionalfield);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder JobRefs
                                                if (proxyrepairorder.JobRefs != null && proxyrepairorder.JobRefs.Length > 0)
                                                {
                                                    repairorder.JobRefs = new List<JobRef>();
                                                    foreach (_1C.v4.RepairOrder.JobRef proxyjobref in proxyrepairorder.JobRefs)
                                                    {
                                                        JobRef jobref = new JobRef();
                                                        jobref.DMSJobNo = proxyjobref.DMSJobNo;
                                                        jobref.DMSJobStatus = proxyjobref.DMSJobStatus;
                                                        repairorder.JobRefs.Add(jobref);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder ManagementFields
                                                if (proxyrepairorder.ManagementFields != null)
                                                {
                                                    ManagementFields managementfields = new ManagementFields();
                                                    managementfields.CreateDateTimeUTC = proxyrepairorder.ManagementFields.CreateDateTimeUTC;
                                                    managementfields.LastModifiedDateTimeUTC = proxyrepairorder.ManagementFields.LastModifiedDateTimeUTC;
                                                    repairorder.ManagementFields = managementfields;
                                                }
                                                #endregion

                                                #region//RepairOrder Options
                                                if (proxyrepairorder.Options != null && proxyrepairorder.Options.Length > 0)
                                                {
                                                    repairorder.Options = new List<Option>();
                                                    foreach (_1C.v4.RepairOrder.Option proxyoption in proxyrepairorder.Options)
                                                    {
                                                        Option option = new Option();
                                                        option.OptionName = proxyoption.Name;
                                                        option.OptionValue = proxyoption.Value;
                                                        repairorder.Options.Add(option);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder PriceType
                                                if (proxyrepairorder.PriceType != null)
                                                {
                                                    PriceType pricetype = new PriceType();
                                                    pricetype.DiscountPrice = proxyrepairorder.PriceType.DiscountPrice;
                                                    pricetype.DiscountRate = proxyrepairorder.PriceType.DiscountRate;
                                                    pricetype.TotalPrice = proxyrepairorder.PriceType.TotalPrice;
                                                    pricetype.TotalPriceIncludeTax = proxyrepairorder.PriceType.TotalPriceIncludeTax;
                                                    pricetype.UnitPrice = proxyrepairorder.PriceType.UnitPrice;
                                                    repairorder.PriceType = pricetype;
                                                }
                                                #endregion

                                                #region//RepairOrder AppointmentRef
                                                if (proxyrepairorder.AppointmentRef != null)
                                                {
                                                    AppointmentRef appointmentref = new AppointmentRef();
                                                    appointmentref.DMSAppointmentNo = proxyrepairorder.AppointmentRef.DMSAppointmentNo;
                                                    appointmentref.DMSAppointmentStatus = proxyrepairorder.AppointmentRef.DMSAppointmentStatus;
                                                    repairorder.AppointmentRef = appointmentref;
                                                }
                                                #endregion

                                                #region//RepairOrder Customers
                                                if (proxyrepairorder.Customers != null && proxyrepairorder.Customers.Length > 0)
                                                {
                                                    repairorder.Customers = new List<Data.v2.Common.Customer.Customer>();
                                                    foreach (_1C.v4.RepairOrder.Customer1 proxycustomer in proxyrepairorder.Customers)
                                                    {
                                                        #region//RepairOrder Customer Header
                                                        WA.Standard.IF.Data.v2.Common.Customer.Customer customer = new Data.v2.Common.Customer.Customer();
                                                        customer.CardNo = proxycustomer.CardNo;
                                                        customer.CorporateInfos = customer.CorporateInfos;
                                                        customer.CustomerInfoType = customer.CustomerInfoType;
                                                        customer.DMSCustomerNo = proxycustomer.DMSCustomerNo;
                                                        customer.Email = proxycustomer.Email;
                                                        customer.FirstName = proxycustomer.FirstName;
                                                        customer.FullName = proxycustomer.FullName;
                                                        customer.Gender = proxycustomer.Gender;
                                                        customer.LastName = proxycustomer.LastName;
                                                        customer.MiddleName = proxycustomer.MiddleName;
                                                        customer.Salutation = proxycustomer.Salutation;
                                                        #endregion

                                                        #region//RepairOrder Customer Addresses
                                                        if (proxycustomer.Addresses != null && proxycustomer.Addresses.Length > 0)
                                                        {
                                                            customer.Addresses = new List<Data.v2.Common.Customer.Address>();
                                                            foreach (_1C.v4.RepairOrder.Address proxyaddress in proxycustomer.Addresses)
                                                            {
                                                                Data.v2.Common.Customer.Address address = new Data.v2.Common.Customer.Address();
                                                                address.Address1 = proxyaddress.Address1;
                                                                address.Address2 = proxyaddress.Address2;
                                                                address.AddressType = proxyaddress.AddressType;
                                                                address.City = proxyaddress.City;
                                                                address.Country = proxyaddress.Country;
                                                                address.State = proxyaddress.State;
                                                                address.ZipCode = proxyaddress.ZipCode;
                                                                customer.Addresses.Add(address);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder Customer Contacts
                                                        if (proxycustomer.Contacts != null && proxycustomer.Contacts.Length > 0)
                                                        {
                                                            customer.Contacts = new List<Data.v2.Common.Customer.Contact>();
                                                            foreach (_1C.v4.RepairOrder.Contact1 proxycontact in proxycustomer.Contacts)
                                                            {
                                                                Data.v2.Common.Customer.Contact contact = new Data.v2.Common.Customer.Contact();
                                                                contact.ContactMethodYN = proxycontact.ContactMethodYN;
                                                                contact.ContactType = proxycontact.ContactType;
                                                                contact.ContactValue = proxycontact.ContactValue;
                                                                customer.Contacts.Add(contact);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder Customer SpecialMessage
                                                        if (proxycustomer.SpecialMessage != null)
                                                        {
                                                            Data.v2.Common.Customer.SpecialMessage specialmessage = new Data.v2.Common.Customer.SpecialMessage();
                                                            specialmessage.Message = proxycustomer.SpecialMessage.Message;
                                                            customer.SpecialMessage = specialmessage;
                                                        }
                                                        #endregion

                                                        #region//RepairOrder Customer CorporateInfos
                                                        if (proxycustomer.CorporateInfos != null && proxycustomer.CorporateInfos.Length > 0)
                                                        {
                                                            customer.CorporateInfos = new List<Data.v2.Common.Customer.CorporateInfo>();
                                                            foreach (_1C.v4.RepairOrder.CorporateInfo proxycorporateinfo in proxycustomer.CorporateInfos)
                                                            {
                                                                Data.v2.Common.Customer.CorporateInfo corporateinfo = new Data.v2.Common.Customer.CorporateInfo();
                                                                corporateinfo.CorporateInfoName = proxycorporateinfo.Name;
                                                                corporateinfo.CorporateInfoValue = proxycorporateinfo.Value;
                                                                customer.CorporateInfos.Add(corporateinfo);
                                                            }
                                                        }
                                                        #endregion

                                                        repairorder.Customers.Add(customer);
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder Vehicle
                                                if (proxyrepairorder.Vehicle != null)
                                                {
                                                    if (proxyrepairorder.Vehicle != null)
                                                    {
                                                        #region//RepairOrder Vehicle Header
                                                        Data.v2.Common.Vehicle.Vehicle vehicle = new Data.v2.Common.Vehicle.Vehicle();
                                                        vehicle.Color = proxyrepairorder.Vehicle.Color;
                                                        vehicle.Cylinders = proxyrepairorder.Vehicle.Cylinders;
                                                        vehicle.DateDelivered = proxyrepairorder.Vehicle.DateDelivered;
                                                        vehicle.DateInService = proxyrepairorder.Vehicle.DateInService;
                                                        vehicle.DeclinedJob = proxyrepairorder.Vehicle.DeclinedJob;
                                                        vehicle.DisplayDescription = proxyrepairorder.Vehicle.DisplayDescription;
                                                        vehicle.DMSVehicleNo = proxyrepairorder.Vehicle.DMSVehicleNo;
                                                        vehicle.EngineType = proxyrepairorder.Vehicle.EngineType;
                                                        vehicle.ExtendedWarranty = proxyrepairorder.Vehicle.ExtendedWarranty;
                                                        vehicle.FuelType = proxyrepairorder.Vehicle.FuelType;
                                                        vehicle.FullModelName = proxyrepairorder.Vehicle.FullModelName;
                                                        vehicle.InsuranceDate = proxyrepairorder.Vehicle.InsuranceDate;
                                                        vehicle.LastMileage = proxyrepairorder.Vehicle.LastMileage;
                                                        vehicle.LastServiceDate = proxyrepairorder.Vehicle.LastServiceDate;
                                                        vehicle.LastSixVIN = proxyrepairorder.Vehicle.LastSixVIN;
                                                        vehicle.LicenseNumber = proxyrepairorder.Vehicle.LicenseNumber;
                                                        vehicle.LicensePlateNo = proxyrepairorder.Vehicle.LicensePlateNo;
                                                        vehicle.Make = proxyrepairorder.Vehicle.Make;
                                                        vehicle.ModelCode = proxyrepairorder.Vehicle.ModelCode;
                                                        vehicle.ModelName = proxyrepairorder.Vehicle.ModelName;
                                                        vehicle.ModelYear = proxyrepairorder.Vehicle.ModelYear;
                                                        vehicle.PendingJob = proxyrepairorder.Vehicle.PendingJob;
                                                        vehicle.StockNumber = proxyrepairorder.Vehicle.StockNumber;
                                                        vehicle.Trim = proxyrepairorder.Vehicle.Trim;
                                                        vehicle.VehicleType = proxyrepairorder.Vehicle.VehicleType;
                                                        vehicle.VIN = proxyrepairorder.Vehicle.VIN;
                                                        vehicle.WarrantyMiles = proxyrepairorder.Vehicle.WarrantyMiles;
                                                        vehicle.WarrantyMonths = proxyrepairorder.Vehicle.WarrantyMonths;
                                                        vehicle.WarrantyStartDate = proxyrepairorder.Vehicle.WarrantyStartDate;
                                                        #endregion

                                                        #region//RepairOrder Vehicle Campaigns
                                                        if (proxyrepairorder.Vehicle.Campaigns != null && proxyrepairorder.Vehicle.Campaigns.Length > 0)
                                                        {
                                                            vehicle.Campaigns = new List<Data.v2.Common.Vehicle.Campaign>();
                                                            foreach (_1C.v4.RepairOrder.Campaign proxycampaign in proxyrepairorder.Vehicle.Campaigns)
                                                            {
                                                                Data.v2.Common.Vehicle.Campaign campaign = new Data.v2.Common.Vehicle.Campaign();
                                                                campaign.CampaignDescription = proxycampaign.CampaignDescription;
                                                                campaign.CampaignID = proxycampaign.CampaignID;
                                                                campaign.CampaignPerformed = proxycampaign.CampaignPerformed;
                                                                vehicle.Campaigns.Add(campaign);
                                                            }
                                                        }
                                                        #endregion

                                                        repairorder.Vehicle = vehicle;
                                                    }
                                                }
                                                #endregion

                                                #region//RepairOrder RequestItems
                                                if (proxyrepairorder.RequestItems != null && proxyrepairorder.RequestItems.Length > 0)
                                                {
                                                    repairorder.RequestItems = new List<RequestItem>();
                                                    foreach (_1C.v4.RepairOrder.RequestItem proxyrequestitem in proxyrepairorder.RequestItems)
                                                    {
                                                        #region//RepairOrder RequestItem Header
                                                        RequestItem requestitem = new RequestItem();
                                                        requestitem.CPSIND = proxyrequestitem.CPSIND;
                                                        requestitem.RequestCode = proxyrequestitem.RequestCode;
                                                        requestitem.RequestDescription = proxyrequestitem.RequestDescription;
                                                        requestitem.ServiceLineNumber = proxyrequestitem.ServiceLineNumber;
                                                        requestitem.ServiceLineStatus = proxyrequestitem.ServiceLineStatus;
                                                        requestitem.ServiceType = proxyrequestitem.ServiceType;
                                                        requestitem.TCEmployeeID = proxyrequestitem.TCEmployeeID;
                                                        requestitem.TCEmployeeName = proxyrequestitem.TCEmployeeName;
                                                        requestitem.WorkType = proxyrequestitem.WorkType;
                                                        #endregion

                                                        #region//RepairOrder RequestItem Comments
                                                        if (proxyrequestitem.Comments != null && proxyrequestitem.Comments.Length > 0)
                                                        {
                                                            requestitem.Comments = new List<Comment>();
                                                            foreach (_1C.v4.RepairOrder.Comment proxycomment in proxyrequestitem.Comments)
                                                            {
                                                                Comment comment = new Comment();
                                                                comment.DescriptionComment = proxycomment.DescriptionComment;
                                                                comment.SequenceNumber = proxycomment.SequenceNumber;
                                                                requestitem.Comments.Add(comment);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder RequestItem Descriptions
                                                        if (proxyrequestitem.Descriptions != null && proxyrequestitem.Descriptions.Length > 0)
                                                        {
                                                            requestitem.Descriptions = new List<Description>();
                                                            foreach (_1C.v4.RepairOrder.Description proxydescription in proxyrequestitem.Descriptions)
                                                            {
                                                                Description description = new Description();
                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                requestitem.Descriptions.Add(description);
                                                            }
                                                        }
                                                        #endregion

                                                        #region//RepairOrder RequestItem OPCodes
                                                        if (proxyrequestitem.OPCodes != null && proxyrequestitem.OPCodes.Length > 0)
                                                        {
                                                            requestitem.OPCodes = new List<OPCode>();
                                                            foreach (_1C.v4.RepairOrder.OPCode proxyopcode in proxyrequestitem.OPCodes)
                                                            {
                                                                #region//RepairOrder RequestItem OPCode Header
                                                                OPCode opcode = new OPCode();
                                                                opcode.ActualHours = proxyopcode.ActualHours;
                                                                opcode.Code = proxyopcode.Code;
                                                                opcode.Description = proxyopcode.Description;
                                                                opcode.EstimatedHours = proxyopcode.EstimatedHours;
                                                                opcode.SequenceNumber = proxyopcode.SequenceNumber;
                                                                opcode.ServiceType = proxyopcode.ServiceType;
                                                                opcode.SkillLevel = proxyopcode.SkillLevel;
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode Descriptions
                                                                if (proxyopcode.Descriptions != null && proxyopcode.Descriptions.Length > 0)
                                                                {
                                                                    opcode.Descriptions = new List<Description>();
                                                                    foreach (_1C.v4.RepairOrder.Description proxydescription in proxyopcode.Descriptions)
                                                                    {
                                                                        Description description = new Description();
                                                                        description.DescriptionComment = proxydescription.DescriptionComment;
                                                                        description.SequenceNumber = proxydescription.SequenceNumber;
                                                                        opcode.Descriptions.Add(description);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode Causes
                                                                if (proxyopcode.Causes != null && proxyopcode.Causes.Length > 0)
                                                                {
                                                                    opcode.Causes = new List<Cause>();
                                                                    foreach (_1C.v4.RepairOrder.Cause proxycause in proxyopcode.Causes)
                                                                    {
                                                                        Cause cause = new Cause();
                                                                        cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                                                        cause.Comment = proxycause.Comment;
                                                                        cause.SequenceNumber = proxycause.SequenceNumber;
                                                                        opcode.Causes.Add(cause);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode Corrections
                                                                if (proxyopcode.Corrections != null && proxyopcode.Corrections.Length > 0)
                                                                {
                                                                    opcode.Corrections = new List<Correction>();
                                                                    foreach (_1C.v4.RepairOrder.Correction proxycorrection in proxyopcode.Corrections)
                                                                    {
                                                                        Correction correction = new Correction();
                                                                        correction.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                                                        correction.Comment = proxycorrection.Comment;
                                                                        correction.SequenceNumber = proxycorrection.SequenceNumber;
                                                                        opcode.Corrections.Add(correction);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem 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//RepairOrder RequestItem OPCode Parts
                                                                if (proxyopcode.Parts != null && proxyopcode.Parts.Length > 0)
                                                                {
                                                                    opcode.Parts = new List<Part>();
                                                                    foreach (_1C.v4.RepairOrder.Part proxypart in proxyopcode.Parts)
                                                                    {
                                                                        #region//RepairOrder RequestItem OPCode Parts Header
                                                                        Part part = new Part();
                                                                        part.DisplayPartNumber = proxypart.DisplayPartNumber;
                                                                        part.PartDescription = proxypart.PartDescription;
                                                                        part.PartNumber = proxypart.PartNumber;
                                                                        part.PartType = proxypart.PartType;
                                                                        part.Quantity = proxypart.Quantity;
                                                                        part.SequenceNumber = proxypart.SequenceNumber;
                                                                        part.ServiceType = proxypart.ServiceType;
                                                                        part.StockQuantity = proxypart.StockQuantity;
                                                                        part.StockStatus = proxypart.StockStatus;
                                                                        part.UnitOfMeasure = proxypart.UnitOfMeasure;
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Parts Descriptions
                                                                        if (proxypart.Descriptions != null && proxypart.Descriptions.Length > 0)
                                                                        {
                                                                            part.Descriptions = new List<Description>();
                                                                            foreach (_1C.v4.RepairOrder.Description proxydescription in proxypart.Descriptions)
                                                                            {
                                                                                Description description = new Description();
                                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                                part.Descriptions.Add(description);
                                                                            }
                                                                        }
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Parts 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

                                                                #region//RepairOrder RequestItem OPCode Sublets
                                                                if (proxyopcode.Sublets != null && proxyopcode.Sublets.Length > 0)
                                                                {
                                                                    opcode.Sublets = new List<Sublet>();
                                                                    foreach (_1C.v4.RepairOrder.Sublet proxysublet in proxyopcode.Sublets)
                                                                    {
                                                                        #region//RepairOrder RequestItem OPCode Sublet Header
                                                                        Sublet sublet = new Sublet();
                                                                        sublet.SequenceNumber = proxysublet.SequenceNumber;
                                                                        sublet.ServiceType = proxysublet.ServiceType;
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Sublets Descriptions
                                                                        if (proxysublet.Descriptions != null && proxysublet.Descriptions.Length > 0)
                                                                        {
                                                                            sublet.Descriptions = new List<Description>();
                                                                            foreach (_1C.v4.RepairOrder.Description proxydescription in proxysublet.Descriptions)
                                                                            {
                                                                                Description description = new Description();
                                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                                sublet.Descriptions.Add(description);
                                                                            }
                                                                        }
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode Sublets PriceType
                                                                        if (proxysublet.PriceType != null)
                                                                        {
                                                                            PriceType pricetype = new PriceType();
                                                                            pricetype.DiscountPrice = proxysublet.PriceType.DiscountPrice;
                                                                            pricetype.DiscountRate = proxysublet.PriceType.DiscountRate;
                                                                            pricetype.TotalPrice = proxysublet.PriceType.TotalPrice;
                                                                            pricetype.TotalPriceIncludeTax = proxysublet.PriceType.TotalPriceIncludeTax;
                                                                            pricetype.UnitPrice = proxysublet.PriceType.UnitPrice;
                                                                            sublet.PriceType = pricetype;
                                                                        }
                                                                        #endregion

                                                                        opcode.Sublets.Add(sublet);
                                                                    }
                                                                }
                                                                #endregion

                                                                #region//RepairOrder RequestItem OPCode MISCs
                                                                if (proxyopcode.MISCs != null && proxyopcode.MISCs.Length > 0)
                                                                {
                                                                    opcode.MISCs = new List<MISC>();
                                                                    foreach (_1C.v4.RepairOrder.MISC proxymisc in proxyopcode.MISCs)
                                                                    {
                                                                        #region//RepairOrder RequestItem OPCode MISC Header
                                                                        MISC misc = new MISC();
                                                                        misc.SequenceNumber = proxymisc.SequenceNumber;
                                                                        misc.ServiceType = proxymisc.ServiceType;
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode MISCs Descriptions
                                                                        if (proxymisc.Descriptions != null && proxymisc.Descriptions.Length > 0)
                                                                        {
                                                                            misc.Descriptions = new List<Description>();
                                                                            foreach (_1C.v4.RepairOrder.Description proxydescription in proxymisc.Descriptions)
                                                                            {
                                                                                Description description = new Description();
                                                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                                                misc.Descriptions.Add(description);
                                                                            }
                                                                        }
                                                                        #endregion

                                                                        #region//RepairOrder RequestItem OPCode MISCs PriceType
                                                                        if (proxymisc.PriceType != null)
                                                                        {
                                                                            PriceType pricetype = new PriceType();
                                                                            pricetype.DiscountPrice = proxymisc.PriceType.DiscountPrice;
                                                                            pricetype.DiscountRate = proxymisc.PriceType.DiscountRate;
                                                                            pricetype.TotalPrice = proxymisc.PriceType.TotalPrice;
                                                                            pricetype.TotalPriceIncludeTax = proxymisc.PriceType.TotalPriceIncludeTax;
                                                                            pricetype.UnitPrice = proxymisc.PriceType.UnitPrice;
                                                                            misc.PriceType = pricetype;
                                                                        }
                                                                        #endregion

                                                                        opcode.MISCs.Add(misc);
                                                                    }
                                                                }
                                                                #endregion

                                                                requestitem.OPCodes.Add(opcode);
                                                            }
                                                        }
                                                        #endregion

                                                        repairorder.RequestItems.Add(requestitem);
                                                    }
                                                }
                                                #endregion

                                                repairorderdocument.RepairOrders.Add(repairorder);
                                            }
                                        }
                                        response.RepairOrderDocuments.Add(repairorderdocument);
                                    }
                                }
                                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;
        }
Example #2
0
 public EmployeeVerificationException(Cause reason, string message, Exception inner)
     : base(message, inner)
 {
     Reason = reason;
 }
Example #3
0
        public JobGetResponse JobGet(JobGetRequest request)
        {
            JobGetResponse response = new JobGetResponse();

            //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 - Standard (Proxy Class Dll Name : _WA.Mapper.v2)

                        #region JobGet 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.Job.Job proxyws = new _WA.Mapper.v2.Job.Job(request.TransactionHeader.DMSServerUrl);
                        proxyws.Credentials = proxycredential;

                        //Create proxy request with jobget and transaction
                        _WA.Mapper.v2.Job.JobGetRequest proxyrequest = new _WA.Mapper.v2.Job.JobGetRequest();

                        //Create proxy transaction
                        _WA.Mapper.v2.Job.TransactionHeader proxytransactionheader = new _WA.Mapper.v2.Job.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 jobget
                        _WA.Mapper.v2.Job.JobGet proxyjobget = new _WA.Mapper.v2.Job.JobGet();
                        if (request.JobGet != null)
                        {
                            #region//JobGet Set
                            proxyjobget.DMSJobNo = request.JobGet.DMSJobNo;
                            proxyjobget.DMSJobNo = request.JobGet.DMSJobNo;
                            proxyjobget.DMSJobStatus = request.JobGet.DMSJobStatus;
                            proxyjobget.DMSRONo = request.JobGet.DMSRONo;
                            proxyjobget.LastModifiedDateTimeFromUTC = request.JobGet.LastModifiedDateTimeFromUTC;
                            proxyjobget.LastModifiedDateTimeToUTC = request.JobGet.LastModifiedDateTimeToUTC;
                            proxyjobget.ScheduledDateTimeFromLocal = request.JobGet.ScheduledDateTimeFromLocal;
                            proxyjobget.ScheduledDateTimeToLocal = request.JobGet.ScheduledDateTimeToLocal;
                            proxyrequest.JobGet = proxyjobget;
                            #endregion
                        }

                        #endregion

                        //Run proxy web method with proxy request
                        _WA.Mapper.v2.Job.JobGetResponse proxyresponse = proxyws.JobGet(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.Job.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//JobGetResponse Set

                                if (proxyresponse.Jobs != null && proxyresponse.Jobs.Length > 0)
                                {
                                    response.Jobs = new List<Job>();
                                    foreach (_WA.Mapper.v2.Job.Job1 proxyjob in proxyresponse.Jobs)
                                    {
                                        #region//Job Header
                                        Job job = new Job();
                                        job.ActualHours = proxyjob.ActualHours;
                                        job.DMSJobNo = proxyjob.DMSJobNo;
                                        job.DMSJobNo = proxyjob.DMSJobNo;
                                        job.DMSRONo = proxyjob.DMSRONo;
                                        job.ServiceLineNumber = proxyjob.ServiceLineNumber;
                                        job.SkillLevel = proxyjob.SkillLevel;
                                        #endregion

                                        #region //Job ManagementFields
                                        if (proxyjob.ManagementFields != null)
                                        {
                                            ManagementFields managementfields = new ManagementFields();
                                            managementfields.CreateDateTimeUTC = proxyjob.ManagementFields.CreateDateTimeUTC;
                                            managementfields.LastModifiedDateTimeUTC = proxyjob.ManagementFields.LastModifiedDateTimeUTC;
                                            job.ManagementFields = managementfields;
                                        }
                                        #endregion

                                        #region//Job Comments
                                        if (proxyjob.Comments != null && proxyjob.Comments.Length > 0)
                                        {
                                            job.Comments = new List<Comment>();
                                            foreach (_WA.Mapper.v2.Job.Comment proxycomment in proxyjob.Comments)
                                            {
                                                Comment comment = new Comment();
                                                comment.DescriptionComment = proxycomment.DescriptionComment;
                                                comment.SequenceNumber = proxycomment.SequenceNumber;
                                                job.Comments.Add(comment);
                                            }
                                        }
                                        #endregion

                                        #region//Job Descriptions
                                        if (proxyjob.Descriptions != null && proxyjob.Descriptions.Length > 0)
                                        {
                                            job.Descriptions = new List<Description>();
                                            foreach (_WA.Mapper.v2.Job.Description proxydescription in proxyjob.Descriptions)
                                            {
                                                Description description = new Description();
                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                job.Descriptions.Add(description);
                                            }
                                        }
                                        #endregion

                                        #region//Job Causes
                                        if (proxyjob.Causes != null && proxyjob.Causes.Length > 0)
                                        {
                                            job.Causes = new List<Cause>();
                                            foreach (_WA.Mapper.v2.Job.Cause proxycause in proxyjob.Causes)
                                            {
                                                Cause cause = new Cause();
                                                cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                                cause.Comment = proxycause.Comment;
                                                cause.SequenceNumber = proxycause.SequenceNumber;
                                                job.Causes.Add(cause);
                                            }
                                        }
                                        #endregion

                                        #region//Job Corrections
                                        if (proxyjob.Corrections != null && proxyjob.Corrections.Length > 0)
                                        {
                                            job.Corrections = new List<Correction>();
                                            foreach (_WA.Mapper.v2.Job.Correction proxycorrection in proxyjob.Corrections)
                                            {
                                                Correction cause = new Correction();
                                                cause.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                                cause.Comment = proxycorrection.Comment;
                                                cause.SequenceNumber = proxycorrection.SequenceNumber;
                                                job.Corrections.Add(cause);
                                            }
                                        }
                                        #endregion

                                        #region//Job OPCodes
                                        if (proxyjob.OPCodes != null && proxyjob.OPCodes.Length > 0)
                                        {
                                            job.OPCodes = new List<Data.v2.Common.Job.OPCode>();
                                            foreach (_WA.Mapper.v2.Job.OPCode proxyopcode in proxyjob.OPCodes)
                                            {
                                                #region//Job OPCode Header
                                                Data.v2.Common.Job.OPCode opcode = new Data.v2.Common.Job.OPCode();
                                                opcode.ActualHours = proxyopcode.ActualHours;
                                                opcode.Code = proxyopcode.Code;
                                                opcode.Description = proxyopcode.Description;
                                                opcode.EstimatedHours = proxyopcode.EstimatedHours;
                                                opcode.SkillLevel = proxyopcode.SkillLevel;
                                                #endregion

                                                #region//Job OPCode Comments
                                                if (proxyopcode.Comments != null && proxyopcode.Comments.Length > 0)
                                                {
                                                    opcode.Comments = new List<Comment>();
                                                    foreach (_WA.Mapper.v2.Job.Comment proxycomment in proxyopcode.Comments)
                                                    {
                                                        Comment comment = new Comment();
                                                        comment.DescriptionComment = proxycomment.DescriptionComment;
                                                        comment.SequenceNumber = proxycomment.SequenceNumber;
                                                        opcode.Comments.Add(comment);
                                                    }
                                                }
                                                #endregion

                                                #region//Job OPCode Descriptions
                                                if (proxyopcode.Descriptions != null && proxyopcode.Descriptions.Length > 0)
                                                {
                                                    opcode.Descriptions = new List<Description>();
                                                    foreach (_WA.Mapper.v2.Job.Description proxydescription in proxyopcode.Descriptions)
                                                    {
                                                        Description description = new Description();
                                                        description.DescriptionComment = proxydescription.DescriptionComment;
                                                        description.SequenceNumber = proxydescription.SequenceNumber;
                                                        opcode.Descriptions.Add(description);
                                                    }
                                                }
                                                #endregion

                                                #region//Job OPCode Causes
                                                if (proxyopcode.Causes != null && proxyopcode.Causes.Length > 0)
                                                {
                                                    opcode.Causes = new List<Cause>();
                                                    foreach (_WA.Mapper.v2.Job.Cause proxycause in proxyopcode.Causes)
                                                    {
                                                        Cause cause = new Cause();
                                                        cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                                        cause.Comment = proxycause.Comment;
                                                        cause.SequenceNumber = proxycause.SequenceNumber;
                                                        opcode.Causes.Add(cause);
                                                    }
                                                }
                                                #endregion

                                                #region//Job OPCode Corrections
                                                if (proxyopcode.Corrections != null && proxyopcode.Corrections.Length > 0)
                                                {
                                                    opcode.Corrections = new List<Correction>();
                                                    foreach (_WA.Mapper.v2.Job.Correction proxycorrection in proxyopcode.Corrections)
                                                    {
                                                        Correction correction = new Correction();
                                                        correction.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                                        correction.Comment = proxycorrection.Comment;
                                                        correction.SequenceNumber = proxycorrection.SequenceNumber;
                                                        opcode.Corrections.Add(correction);
                                                    }
                                                }
                                                #endregion

                                                job.OPCodes.Add(opcode);
                                            }
                                        }
                                        #endregion

                                        #region//Job JobLogs
                                        if (proxyjob.JobLogs != null && proxyjob.JobLogs.Length > 0)
                                        {
                                            job.JobLogs = new List<JobLog>();
                                            foreach (_WA.Mapper.v2.Job.JobLog proxyjoblog in proxyjob.JobLogs)
                                            {
                                                #region//Job JobLogs Header
                                                JobLog joblog = new JobLog();
                                                joblog.DMSJobStatus = proxyjoblog.DMSJobStatus;
                                                joblog.EstimatedLaborHour = proxyjoblog.EstimatedLaborHour;
                                                joblog.LogType = proxyjoblog.LogType;
                                                joblog.ScheduledDateTimeFromLocal = proxyjoblog.ScheduledDateTimeFromLocal;
                                                joblog.ScheduledDateTimeToLocal = proxyjoblog.ScheduledDateTimeToLocal;
                                                joblog.Stall = proxyjoblog.Stall;
                                                #endregion

                                                #region//Job Technicians
                                                if (proxyjoblog.Technicians != null && proxyjoblog.Technicians.Length > 0)
                                                {
                                                    joblog.Technicians = new List<Technician>();
                                                    foreach (_WA.Mapper.v2.Job.Technician proxytechnician in proxyjoblog.Technicians)
                                                    {
                                                        Technician technician = new Technician();
                                                        technician.TCEmployeeID = proxytechnician.TCEmployeeID;
                                                        technician.TCEmployeeName = proxytechnician.TCEmployeeName;
                                                        joblog.Technicians.Add(technician);
                                                    }
                                                }
                                                #endregion

                                                #region//Job ActualTimeLogs
                                                if (proxyjoblog.ActualTimeLogs != null && proxyjoblog.ActualTimeLogs.Length > 0)
                                                {
                                                    joblog.ActualTimeLogs = new List<ActualTimeLog>();
                                                    foreach (_WA.Mapper.v2.Job.ActualTimeLog proxyactualtimelog in proxyjoblog.ActualTimeLogs)
                                                    {
                                                        ActualTimeLog actualtimelog = new ActualTimeLog();
                                                        actualtimelog.EndDateTimeLocal = proxyactualtimelog.EndDateTimeLocal;
                                                        actualtimelog.PauseReasonCode = proxyactualtimelog.PauseReasonCode;
                                                        actualtimelog.PauseReasonComment = proxyactualtimelog.PauseReasonComment;
                                                        actualtimelog.StartDateTimeLocal = proxyactualtimelog.StartDateTimeLocal;
                                                        actualtimelog.Status = proxyactualtimelog.Status;
                                                        actualtimelog.TCEmployeeID = proxyactualtimelog.TCEmployeeID;
                                                        actualtimelog.TCEmployeeName = proxyactualtimelog.TCEmployeeName;
                                                        joblog.ActualTimeLogs.Add(actualtimelog);
                                                    }
                                                }
                                                #endregion

                                                #region//Job JobComments
                                                if (proxyjoblog.JobComments != null && proxyjoblog.JobComments.Length > 0)
                                                {
                                                    joblog.JobComments = new List<JobComment>();
                                                    foreach (_WA.Mapper.v2.Job.JobComment proxyjobcomment in proxyjoblog.JobComments)
                                                    {
                                                        JobComment jobcomment = new JobComment();
                                                        jobcomment.ActualWorkHour = proxyjobcomment.ActualWorkHour;
                                                        jobcomment.SubStatus = proxyjobcomment.SubStatus;
                                                        joblog.JobComments.Add(jobcomment);
                                                    }
                                                }
                                                #endregion

                                                job.JobLogs.Add(joblog);
                                            }
                                        }
                                        #endregion

                                        response.Jobs.Add(job);
                                    }
                                }
                                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 JobGet 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.Job.Job proxyws = new _1C.v4.Job.Job(request.TransactionHeader.DMSServerUrl);
                        proxyws.Credentials = proxycredential;

                        //Create proxy request with jobget and transaction
                        _1C.v4.Job.JobGetRequest proxyrequest = new _1C.v4.Job.JobGetRequest();

                        //Create proxy transaction
                        _1C.v4.Job.TransactionHeader proxytransactionheader = new _1C.v4.Job.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 jobget
                        _1C.v4.Job.JobGet proxyjobget = new _1C.v4.Job.JobGet();
                        if (request.JobGet != null)
                        {
                            #region//JobGet Set
                            proxyjobget.DMSJobNo = request.JobGet.DMSJobNo;
                            proxyjobget.DMSJobNo = request.JobGet.DMSJobNo;
                            proxyjobget.DMSJobStatus = request.JobGet.DMSJobStatus;
                            proxyjobget.DMSRONo = request.JobGet.DMSRONo;
                            proxyjobget.LastModifiedDateTimeFromUTC = request.JobGet.LastModifiedDateTimeFromUTC;
                            proxyjobget.LastModifiedDateTimeToUTC = request.JobGet.LastModifiedDateTimeToUTC;
                            proxyjobget.ScheduledDateTimeFromLocal = request.JobGet.ScheduledDateTimeFromLocal;
                            proxyjobget.ScheduledDateTimeToLocal = request.JobGet.ScheduledDateTimeToLocal;
                            proxyrequest.JobGet = proxyjobget;
                            #endregion
                        }

                        #endregion

                        //Run proxy web method with proxy request
                        _1C.v4.Job.JobGetResponse proxyresponse = proxyws.JobGet(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.Job.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//JobGetResponse Set

                                if (proxyresponse.Jobs != null && proxyresponse.Jobs.Length > 0)
                                {
                                    response.Jobs = new List<Job>();
                                    foreach (_1C.v4.Job.Job1 proxyjob in proxyresponse.Jobs)
                                    {
                                        #region//Job Header
                                        Job job = new Job();
                                        job.ActualHours = proxyjob.ActualHours;
                                        job.DMSJobNo = proxyjob.DMSJobNo;
                                        job.DMSJobNo = proxyjob.DMSJobNo;
                                        job.DMSRONo = proxyjob.DMSRONo;
                                        job.ServiceLineNumber = proxyjob.ServiceLineNumber;
                                        job.SkillLevel = proxyjob.SkillLevel;
                                        #endregion

                                        #region //Job ManagementFields
                                        if (proxyjob.ManagementFields != null)
                                        {
                                            ManagementFields managementfields = new ManagementFields();
                                            managementfields.CreateDateTimeUTC = proxyjob.ManagementFields.CreateDateTimeUTC;
                                            managementfields.LastModifiedDateTimeUTC = proxyjob.ManagementFields.LastModifiedDateTimeUTC;
                                            job.ManagementFields = managementfields;
                                        }
                                        #endregion

                                        #region//Job Comments
                                        if (proxyjob.Comments != null && proxyjob.Comments.Length > 0)
                                        {
                                            job.Comments = new List<Comment>();
                                            foreach (_1C.v4.Job.Comment proxycomment in proxyjob.Comments)
                                            {
                                                Comment comment = new Comment();
                                                comment.DescriptionComment = proxycomment.DescriptionComment;
                                                comment.SequenceNumber = proxycomment.SequenceNumber;
                                                job.Comments.Add(comment);
                                            }
                                        }
                                        #endregion

                                        #region//Job Descriptions
                                        if (proxyjob.Descriptions != null && proxyjob.Descriptions.Length > 0)
                                        {
                                            job.Descriptions = new List<Description>();
                                            foreach (_1C.v4.Job.Description proxydescription in proxyjob.Descriptions)
                                            {
                                                Description description = new Description();
                                                description.DescriptionComment = proxydescription.DescriptionComment;
                                                description.SequenceNumber = proxydescription.SequenceNumber;
                                                job.Descriptions.Add(description);
                                            }
                                        }
                                        #endregion

                                        #region//Job Causes
                                        if (proxyjob.Causes != null && proxyjob.Causes.Length > 0)
                                        {
                                            job.Causes = new List<Cause>();
                                            foreach (_1C.v4.Job.Cause proxycause in proxyjob.Causes)
                                            {
                                                Cause cause = new Cause();
                                                cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                                cause.Comment = proxycause.Comment;
                                                cause.SequenceNumber = proxycause.SequenceNumber;
                                                job.Causes.Add(cause);
                                            }
                                        }
                                        #endregion

                                        #region//Job Corrections
                                        if (proxyjob.Corrections != null && proxyjob.Corrections.Length > 0)
                                        {
                                            job.Corrections = new List<Correction>();
                                            foreach (_1C.v4.Job.Correction proxycorrection in proxyjob.Corrections)
                                            {
                                                Correction cause = new Correction();
                                                cause.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                                cause.Comment = proxycorrection.Comment;
                                                cause.SequenceNumber = proxycorrection.SequenceNumber;
                                                job.Corrections.Add(cause);
                                            }
                                        }
                                        #endregion

                                        #region//Job OPCodes
                                        if (proxyjob.OPCodes != null && proxyjob.OPCodes.Length > 0)
                                        {
                                            job.OPCodes = new List<Data.v2.Common.Job.OPCode>();
                                            foreach (_1C.v4.Job.OPCode proxyopcode in proxyjob.OPCodes)
                                            {
                                                #region//Job OPCode Header
                                                Data.v2.Common.Job.OPCode opcode = new Data.v2.Common.Job.OPCode();
                                                opcode.ActualHours = proxyopcode.ActualHours;
                                                opcode.Code = proxyopcode.Code;
                                                opcode.Description = proxyopcode.Description;
                                                opcode.EstimatedHours = proxyopcode.EstimatedHours;
                                                opcode.SkillLevel = proxyopcode.SkillLevel;
                                                #endregion

                                                #region//Job OPCode Comments
                                                if (proxyopcode.Comments != null && proxyopcode.Comments.Length > 0)
                                                {
                                                    opcode.Comments = new List<Comment>();
                                                    foreach (_1C.v4.Job.Comment proxycomment in proxyopcode.Comments)
                                                    {
                                                        Comment comment = new Comment();
                                                        comment.DescriptionComment = proxycomment.DescriptionComment;
                                                        comment.SequenceNumber = proxycomment.SequenceNumber;
                                                        opcode.Comments.Add(comment);
                                                    }
                                                }
                                                #endregion

                                                #region//Job OPCode Descriptions
                                                if (proxyopcode.Descriptions != null && proxyopcode.Descriptions.Length > 0)
                                                {
                                                    opcode.Descriptions = new List<Description>();
                                                    foreach (_1C.v4.Job.Description proxydescription in proxyopcode.Descriptions)
                                                    {
                                                        Description description = new Description();
                                                        description.DescriptionComment = proxydescription.DescriptionComment;
                                                        description.SequenceNumber = proxydescription.SequenceNumber;
                                                        opcode.Descriptions.Add(description);
                                                    }
                                                }
                                                #endregion

                                                #region//Job OPCode Causes
                                                if (proxyopcode.Causes != null && proxyopcode.Causes.Length > 0)
                                                {
                                                    opcode.Causes = new List<Cause>();
                                                    foreach (_1C.v4.Job.Cause proxycause in proxyopcode.Causes)
                                                    {
                                                        Cause cause = new Cause();
                                                        cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                                        cause.Comment = proxycause.Comment;
                                                        cause.SequenceNumber = proxycause.SequenceNumber;
                                                        opcode.Causes.Add(cause);
                                                    }
                                                }
                                                #endregion

                                                #region//Job OPCode Corrections
                                                if (proxyopcode.Corrections != null && proxyopcode.Corrections.Length > 0)
                                                {
                                                    opcode.Corrections = new List<Correction>();
                                                    foreach (_1C.v4.Job.Correction proxycorrection in proxyopcode.Corrections)
                                                    {
                                                        Correction correction = new Correction();
                                                        correction.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                                        correction.Comment = proxycorrection.Comment;
                                                        correction.SequenceNumber = proxycorrection.SequenceNumber;
                                                        opcode.Corrections.Add(correction);
                                                    }
                                                }
                                                #endregion

                                                job.OPCodes.Add(opcode);
                                            }
                                        }
                                        #endregion

                                        #region//Job JobLogs
                                        if (proxyjob.JobLogs != null && proxyjob.JobLogs.Length > 0)
                                        {
                                            job.JobLogs = new List<JobLog>();
                                            foreach (_1C.v4.Job.JobLog proxyjoblog in proxyjob.JobLogs)
                                            {
                                                #region//Job JobLogs Header
                                                JobLog joblog = new JobLog();
                                                joblog.DMSJobStatus = proxyjoblog.DMSJobStatus;
                                                joblog.EstimatedLaborHour = proxyjoblog.EstimatedLaborHour;
                                                joblog.LogType = proxyjoblog.LogType;
                                                joblog.ScheduledDateTimeFromLocal = proxyjoblog.ScheduledDateTimeFromLocal;
                                                joblog.ScheduledDateTimeToLocal = proxyjoblog.ScheduledDateTimeToLocal;
                                                joblog.Stall = proxyjoblog.Stall;
                                                #endregion

                                                #region//Job Technicians
                                                if (proxyjoblog.Technicians != null && proxyjoblog.Technicians.Length > 0)
                                                {
                                                    joblog.Technicians = new List<Technician>();
                                                    foreach (_1C.v4.Job.Technician proxytechnician in proxyjoblog.Technicians)
                                                    {
                                                        Technician technician = new Technician();
                                                        technician.TCEmployeeID = proxytechnician.TCEmployeeID;
                                                        technician.TCEmployeeName = proxytechnician.TCEmployeeName;
                                                        joblog.Technicians.Add(technician);
                                                    }
                                                }
                                                #endregion

                                                #region//Job ActualTimeLogs
                                                if (proxyjoblog.ActualTimeLogs != null && proxyjoblog.ActualTimeLogs.Length > 0)
                                                {
                                                    joblog.ActualTimeLogs = new List<ActualTimeLog>();
                                                    foreach (_1C.v4.Job.ActualTimeLog proxyactualtimelog in proxyjoblog.ActualTimeLogs)
                                                    {
                                                        ActualTimeLog actualtimelog = new ActualTimeLog();
                                                        actualtimelog.EndDateTimeLocal = proxyactualtimelog.EndDateTimeLocal;
                                                        actualtimelog.PauseReasonCode = proxyactualtimelog.PauseReasonCode;
                                                        actualtimelog.PauseReasonComment = proxyactualtimelog.PauseReasonComment;
                                                        actualtimelog.StartDateTimeLocal = proxyactualtimelog.StartDateTimeLocal;
                                                        actualtimelog.Status = proxyactualtimelog.Status;
                                                        actualtimelog.TCEmployeeID = proxyactualtimelog.TCEmployeeID;
                                                        actualtimelog.TCEmployeeName = proxyactualtimelog.TCEmployeeName;
                                                        joblog.ActualTimeLogs.Add(actualtimelog);
                                                    }
                                                }
                                                #endregion

                                                #region//Job JobComments
                                                if (proxyjoblog.JobComments != null && proxyjoblog.JobComments.Length > 0)
                                                {
                                                    joblog.JobComments = new List<JobComment>();
                                                    foreach (_1C.v4.Job.JobComment proxyjobcomment in proxyjoblog.JobComments)
                                                    {
                                                        JobComment jobcomment = new JobComment();
                                                        jobcomment.ActualWorkHour = proxyjobcomment.ActualWorkHour;
                                                        jobcomment.SubStatus = proxyjobcomment.SubStatus;
                                                        joblog.JobComments.Add(jobcomment);
                                                    }
                                                }
                                                #endregion

                                                job.JobLogs.Add(joblog);
                                            }
                                        }
                                        #endregion

                                        response.Jobs.Add(job);
                                    }
                                }
                                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;
        }
Example #4
0
 protected async Task Edit(Int32 Id)
 {
     await dataService.TryGetById(Id, "", (Cause m, String s) => { selectedItem = m; Notify("info", s); }, (Exception e, String r) => { selectedItem = null; Notify("error", e.ToString() + " " + r); }, StateProvider);
 }
Example #5
0
 public EmployeeVerificationException(Cause reason)
     : base()
 {
     Reason = reason;
 }
 private static CauseDetailsModel MapCauseDetails(Cause cause)
 {
     var model = Mapper.Map<Cause, CauseDetailsModel>(cause);
     model.Region = cause.Region != null ? cause.Region.Name : string.Empty;
     model.Recipients = cause.Recipients.Select(Mapper.Map<Recipient, RecipientDetailsModel>).ToList();
     return model;
 }
        private void ArrangeCauseTest()
        {
            organization = EntityHelpers.GetValidOrganization() as Organization;
            organization.UserProfiles = new List<UserProfile>();
            organization.CauseTemplates = new List<CauseTemplate>();
            organization.Causes = new List<Cause>();
            organizationRepository.Add(organization);
            organizationRepository.Save();

            userProfile = EntityHelpers.GetValidUserProfile();
            userProfile.Users = new List<User>();
            userProfile.UserProfileService = new UserProfileService( new UserProfileRepository() );
            organization.UserProfiles.Add( userProfile );
            organizationRepository.Save();

            user = EntityHelpers.GetValidUser();
            userProfile.Users.Add( user );
            organizationRepository.Save();

            causeTemplate = EntityHelpers.GetValidCauseTemplate();
            causeTemplate.Causes = new List<Cause>();
            organization.CauseTemplates.Add(causeTemplate);
            organizationRepository.Save();

            cause = causeTemplate.CreateCause();
            causeTemplate.Causes.Add(cause);
            organization.Causes.Add(cause);
            causeRepository.Save();
        }
Example #8
0
 /// <summary>
 /// Called when the entity is broken by a game object or player.
 /// </summary>
 /// <param name="cause">Cause.</param>
 /// <param name="callback">Callback.</param>
 public virtual void OnBreak(Cause cause, Action callback)
 {
     callback();
 }
Example #9
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="cause">エラー原因</param>
 /// <param name="exception">例外</param>
 /// <param name="path">ファイルパス</param>
 public ConfigJsonErrorEventArgs(Cause cause, Exception exception, string path)
 {
     ErrorCause = cause;
     Exception  = exception;
     Path       = path;
 }
Example #10
0
        protected async Task Update()
        {
            await dataService.TryUpdate(selectedItem, (Cause m, String s) => { GetAll(); Notify("success", s); }, (Exception e, String r) => { selectedItem = null; Notify("error", e.ToString() + " " + r); }, StateProvider);

            await InvokeAsync(StateHasChanged);
        }
		private static void SaveLevel(String filepath, Tile[][] tileset, List<Entity> entList, List<Cause> causeList, List<Effect> effectList, List<Trigger> triggerList, List<Light> lightList)
		{
			Level level = new Level();

			try
			{
				#region Save Tileset

				level.Tileset = new LevelTileset();

				int x = tileset.Length;
				int y = tileset[0].Length;

				level.Tileset.x = x.ToString();
				level.Tileset.y = y.ToString();

				level.Tileset.Tile = new TileInfo[x * y];

				for (int i = 0; i < x; i++)
				{
					for (int j = 0; j < y; j++)
					{
						level.Tileset.Tile[j * x + i] = new TileInfo();
						level.Tileset.Tile[j * x + i].state = (tileStateType)tileset[i][j].TileType;
					}
				}

				#endregion

				#region Save Entities

				level.Entities = new LevelEntities();

				Player player = (Player)entList.Find(ent => ent is Player);
				if (player != null)
				{
					player.ID = Guid.NewGuid().ToString();
					level.Entities.Player = new PlayerInfo();
					level.Entities.Player = SaveEntity<PlayerInfo, Player>(level.Entities.Player, player);
				}

				List<Entity> buttonList = entList.FindAll(ent => ent is Button);
				if (buttonList.Count > 0)
				{
					level.Entities.Button = new ButtonInfo[buttonList.Count];
					for (int i = 0; i < buttonList.Count; i++)
					{
						buttonList[i].ID = Guid.NewGuid().ToString();
						level.Entities.Button[i] = new ButtonInfo();
						level.Entities.Button[i] = SaveEntity<ButtonInfo, Button>(level.Entities.Button[i], (Button)buttonList[i]);
					}
				}

				List<Entity> breakableDoorList = entList.FindAll(ent => ent is BreakableDoor);
				if (breakableDoorList.Count > 0)
				{
					level.Entities.BreakableDoor = new BreakableDoorInfo[breakableDoorList.Count];
					for (int i = 0; i < breakableDoorList.Count; i++)
					{
						breakableDoorList[i].ID = Guid.NewGuid().ToString();
						level.Entities.BreakableDoor[i] = new BreakableDoorInfo();
						level.Entities.BreakableDoor[i].maxHits = ((BreakableDoor)breakableDoorList[i]).MaxHits;
						level.Entities.BreakableDoor[i] = SaveEntity<BreakableDoorInfo, BreakableDoor>(level.Entities.BreakableDoor[i], (BreakableDoor)breakableDoorList[i]);
					}
				}

				List<Entity> cannonList = entList.FindAll(ent => ent is Cannon);
				if (cannonList.Count > 0)
				{
					level.Entities.Cannon = new CannonInfo[cannonList.Count];
					for (int i = 0; i < cannonList.Count; i++)
					{
						cannonList[i].ID = Guid.NewGuid().ToString();
						Cannon c = (Cannon)cannonList[i];
						level.Entities.Cannon[i] = new CannonInfo();
						level.Entities.Cannon[i].shotVelocity = c.BallSpeed;
						level.Entities.Cannon[i].stupidity = c.Stupidity;
						level.Entities.Cannon[i] = SaveEntity<CannonInfo, Cannon>(level.Entities.Cannon[i], c);
					}
				}

				List<Entity> doorList = entList.FindAll(ent => ent is Door);
				if (doorList.Count > 0)
				{
					level.Entities.Door = new DoorInfo[doorList.Count];
					for (int i = 0; i < doorList.Count; i++)
					{
						doorList[i].ID = Guid.NewGuid().ToString();
						level.Entities.Door[i] = new DoorInfo();
						level.Entities.Door[i].dir = (directionType)((Door)doorList[i]).Dir;
						level.Entities.Door[i] = SaveEntity<DoorInfo, Door>(level.Entities.Door[i], (Door)doorList[i]);
					}
				}

				List<Entity> laserShooterList = entList.FindAll(ent => ent is LaserShooter);
				if (laserShooterList.Count > 0)
				{
					level.Entities.LaserShooter = new LaserShooterInfo[laserShooterList.Count];
					for (int i = 0; i < laserShooterList.Count; i++)
					{
						laserShooterList[i].ID = Guid.NewGuid().ToString();
						LaserShooter ls = (LaserShooter)laserShooterList[i];
						level.Entities.LaserShooter[i] = new LaserShooterInfo();
						level.Entities.LaserShooter[i].shotsPerSecond = ls.ShotsPerSecond;
						level.Entities.LaserShooter[i].beamWidth = ls.BeamWidth;
						level.Entities.LaserShooter[i].stupidity = ls.Stupidity;
						level.Entities.LaserShooter[i] = SaveEntity<LaserShooterInfo, LaserShooter>(level.Entities.LaserShooter[i], ls);
					}
				}

				List<Entity> BallList = entList.FindAll(ent => ent is Ball);
				if (BallList.Count > 0)
				{
					level.Entities.Ball = new BallInfo[BallList.Count];
					for (int i = 0; i < BallList.Count; i++)
					{
						BallList[i].ID = Guid.NewGuid().ToString();
						level.Entities.Ball[i] = new BallInfo();
						level.Entities.Ball[i].friction = ((Ball)BallList[i]).Friction;
						level.Entities.Ball[i] = SaveEntity(level.Entities.Ball[i], (Ball)BallList[i]);
					}
				}

				List<Entity> blockList = entList.FindAll(ent => ent is Block);
				if (blockList.Count > 0)
				{
					level.Entities.Block = new BlockInfo[blockList.Count];
					for (int i = 0; i < blockList.Count; i++)
					{
						blockList[i].ID = Guid.NewGuid().ToString();
						level.Entities.Block[i] = new BlockInfo();
						level.Entities.Block[i].friction = ((Block)blockList[i]).Friction;
						level.Entities.Block[i] = SaveEntity(level.Entities.Block[i], (Block)blockList[i]);
					}
				}

				List<Entity> puzzleBoxList = entList.FindAll(ent => ent is PuzzleBox);
				if (puzzleBoxList.Count > 0)
				{
					level.Entities.PuzzleBox = new PuzzleBoxInfo[puzzleBoxList.Count];
					for (int i = 0; i < puzzleBoxList.Count; i++)
					{
						puzzleBoxList[i].ID = Guid.NewGuid().ToString();
						level.Entities.PuzzleBox[i] = new PuzzleBoxInfo();
						level.Entities.PuzzleBox[i] = SaveEntity(level.Entities.PuzzleBox[i], (PuzzleBox)puzzleBoxList[i]);
					}
				}

				List<Entity> spikeWallList = entList.FindAll(ent => ent is SpikeWall);
				if (spikeWallList.Count > 0)
				{
					level.Entities.SpikeWall = new SpikeWallInfo[spikeWallList.Count];
					for (int i = 0; i < spikeWallList.Count; i++)
					{
						spikeWallList[i].ID = Guid.NewGuid().ToString();
						level.Entities.SpikeWall[i] = new SpikeWallInfo();
						level.Entities.SpikeWall[i].dir = (directionType)((SpikeWall)spikeWallList[i]).Dir;
						level.Entities.SpikeWall[i] = SaveEntity<SpikeWallInfo, SpikeWall>(level.Entities.SpikeWall[i], (SpikeWall)spikeWallList[i]);
					}
				}

				List<Entity> teleporterList = entList.FindAll(ent => ent is Teleporter);
				if (teleporterList.Count > 0)
				{
					level.Entities.Teleporter = new TeleporterInfo[teleporterList.Count];
					for (int i = 0; i < teleporterList.Count; i++)
					{
						teleporterList[i].ID = Guid.NewGuid().ToString();
						level.Entities.Teleporter[i] = new TeleporterInfo();
						level.Entities.Teleporter[i] = SaveEntity(level.Entities.Teleporter[i], (Block)teleporterList[i]);
					}
				}

				#endregion

				level.Triggers = new LevelTriggers();

				#region Save Causes

				if (causeList.Count > 0)
				{
					for (int i = 0; i < causeList.Count; i++)
					{
						causeList[i].ID = Guid.NewGuid().ToString();
					}

					level.Triggers.Cause = new LevelTriggersCause[causeList.Count];

					List<Cause> startList = new List<Cause>();
					List<Cause> parseList = new List<Cause>();
					foreach (Cause c in causeList)
						startList.Add(c);

					List<Cause> refList = new List<Cause>();
					refList = startList.FindAll(cause => cause is CauseAND || cause is CauseOR || cause is CauseNOT || cause is CauseXOR);
					foreach (Cause c in refList)
						startList.Remove(c);

					List<int> refCount = new List<int>();
					while (refCount.Count != refList.Count)
						refCount.Add(0);


					for (int i = 0; i < refList.Count; i++)
					{
						Cause c = refList[i];
						int refs = 0;
						foreach (Cause cCompare in refList)
						{
							if (cCompare is CauseAND)
							{
								if (((CauseAND)cCompare).Cause1 == c || ((CauseAND)cCompare).Cause2 == c)
									refs++;
							}
							else if (cCompare is CauseOR)
							{
								if (((CauseOR)cCompare).Cause1 == c || ((CauseOR)cCompare).Cause2 == c)
									refs++;
							}
							else if (cCompare is CauseNOT)
							{
								if (((CauseNOT)cCompare).Cause == c)
									refs++;
							}
							else if (cCompare is CauseXOR)
							{
								if (((CauseXOR)cCompare).Cause1 == c || ((CauseXOR)cCompare).Cause2 == c)
									refs++;
							}
						}
						refCount[i] = refs;
					}

					int refNum = 0;
					for (int i = 0; i < refCount.Count; i++)
					{
						if (refCount[i] > refNum)
							refNum = refCount[i];
					}

					List<Cause> removeList = new List<Cause>();
					for (int i = 0; i <= refNum; i++)
					{
						for (int j = 0; j < refList.Count; j++)
						{
							if (refCount[j] <= i)
							{
								parseList.Add(refList[j]);
								removeList.Add(refList[j]);
							}
						}

						foreach (Cause c in removeList)
							refList.Remove(c);

						removeList.Clear();
					}

					foreach (Cause c in startList)
						parseList.Add(c);

					parseList.Reverse();

					for (int i = 0; i < parseList.Count; i++)
						level.Triggers.Cause[i] = saveTriggerCause(parseList[i]);
				}

				#endregion

				#region Save Effects

				if (effectList.Count > 0)
				{
					for (int i = 0; i < effectList.Count; i++)
					{
						effectList[i].ID = Guid.NewGuid().ToString();
					}

					level.Triggers.Effect = new LevelTriggersEffect[effectList.Count];

					List<Effect> startList = new List<Effect>();
					List<Effect> parseList = new List<Effect>();
					foreach (Effect e in effectList)
						startList.Add(e);

					List<Effect> refList = new List<Effect>();
					refList = startList.FindAll(effect => effect is EffectAND || effect is EffectList);
					foreach (Effect e in refList)
						startList.Remove(e);

					List<int> refCount = new List<int>();
					while (refCount.Count != refList.Count)
						refCount.Add(-1);


					for (int i = 0; i < refList.Count; i++)
					{
						Effect e = refList[i];
						int refs = 0;
						foreach (Effect eCompare in refList)
						{
							if (eCompare is EffectAND)
							{
								if (((EffectAND)eCompare).Effect1 == e || ((EffectAND)eCompare).Effect2 == e)
									refs++;
							}

							else if (eCompare is EffectList)
							{
								foreach (Effect lEffect in ((EffectList)eCompare).List)
								{
									if (eCompare == lEffect)
									{
										refs++;
										break;
									}
								}
							}
						}
						refCount[i] = refs;
					}

					int refNum = 0;
					for (int i = 0; i < refCount.Count; i++)
					{
						if (refCount[i] > refNum)
							refNum = refCount[i];
					}

					List<Effect> removeList = new List<Effect>();
					for (int i = 0; i <= refNum; i++)
					{
						for (int j = 0; j < refList.Count; j++)
						{
							if (refCount[j] <= i)
							{
								parseList.Add(refList[j]);
								removeList.Add(refList[j]);
							}
						}

						foreach (Effect e in removeList)
							refList.Remove(e);

						removeList.Clear();
					}

					foreach (Effect e in startList)
						parseList.Add(e);

					parseList.Reverse();

					for (int i = 0; i < parseList.Count; i++)
						level.Triggers.Effect[i] = SaveTriggerEffect(parseList[i]);
				}

				#endregion

				#region Save Triggers

				if (triggerList.Count > 0)
				{
					if (level.Triggers == null)
						level.Triggers = new LevelTriggers();

					level.Triggers.Trigger = new LevelTriggersTrigger[triggerList.Count];

					for (int i = 0; i < triggerList.Count; i++)
					{
						LevelTriggersTrigger tData = new LevelTriggersTrigger();
						tData.cause = triggerList[i].Cause.ID;
						tData.effect = triggerList[i].Effect.ID;
						level.Triggers.Trigger[i] = tData;
					}
				}

				#endregion

				#region Save Lights

				level.Lights = new LightInfo[lightList.Count];

				for (int i = 0; i < lightList.Count; i++ )
				{
					Light l = lightList[i];
					LightInfo ll = new LightInfo();
					ll.index = l.Index;
					ll.ambient = l.AmbientR + "," + l.AmbientG + "," + l.AmbientB + "," + l.AmbientA;
					ll.diffuse = l.DiffuseR + "," + l.DiffuseG + "," + l.DiffuseB + "," + l.DiffuseB;
					ll.position = l.PositionX + "," + l.PositionY + "," + l.PositionZ + "," + l.PositionW;
					ll.constAtten = l.ConstantAttenuation;
					ll.linAtten = l.LinearAttenuation;
					ll.quadAtten = l.QuadraticAttenuation;
					level.Lights[i] = ll;
				}

				#endregion

				XmlSerializer serializer = new XmlSerializer(level.GetType());
				StreamWriter writer = new StreamWriter(filepath);
				serializer.Serialize(writer, level);
			}
			catch (Exception e)
			{
				System.Windows.Forms.MessageBox.Show("Error. Unable to save level. Reason: " + e.Message, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
			}
		}
Example #12
0
        protected async Task Cancel()
        {
            await Task.Delay(0);

            selectedItem = null;
        }
Example #13
0
 protected async void GetAll()
 {
     await dataService.TryGet(c => c.EventId == EventId && c.ClassId == ClassId, "Id", true, "", (IEnumerable <Cause> m, String s) => { list = m.ToList(); selectedItem = null; Notify("info", s); }, (Exception e, String s) => { selectedItem = null; Notify("error", e + " " + s); }, StateProvider);
 }
Example #14
0
 protected async Task Search(ChangeEventArgs args)
 {
     if (args.Value?.ToString().Length > 0)
     {
         await dataService.TryGet(c => c.Value.ToLower().Contains(args.Value.ToString()), "Id", true, "", (IEnumerable <Cause> m, String s) => { list = m.ToList(); selectedItem = null; Notify("info", s); }, (Exception e, String r) => { list = null; selectedItem = null; Notify("error", e.ToString() + " " + r); }, StateProvider);
         await InvokeAsync(StateHasChanged);
     }
     else
     {
         GetAll();
     }
 }
 public void Add(Cause cause)
 {
     cause.CauseID = causes.Count + 1;
     causes.Add(cause);
 }
Example #16
0
        public static async Task <Playlist> GeneratePlaylist(AuthenticationToken token, Cause cause, int attempt = 1)
        {
            var user = await User.GetCurrentUserProfile(token);

            using (var db = new SoundFundingDbContext())
            {
                var stored = db.Tracks.OrderByDescending(t => t.Id).FirstOrDefault(t => t.UserId == user.Id);
                if (stored == null)
                {
                    if (attempt <= 3)
                    {
                        // Might not be generated yet
                        Thread.Sleep(TimeSpan.FromSeconds(10));
                        return(await GeneratePlaylist(token, cause, ++attempt));
                    }
                    else
                    {
                        var filrPlaylist = GetStandardFiltrPlaylist();
                        return(new Playlist
                        {
                            Owner = user,
                            Uri = filrPlaylist.spotifyUri
                        });
                    }
                }

                var newPlaylistTracks = await Track.GetTracks(stored.TrackIds.Split(',').ToList());

                var newPlaylist = await Playlist.CreatePlaylist(user.Id, "SoundFunding " + cause.Name, true, token);

                await newPlaylist.AddTracks(newPlaylistTracks.OrderBy(t => t.Popularity).Take(5).ToList(), token);

                newPlaylist = await Playlist.GetPlaylist(user.Id, newPlaylist.Id, token);

                return(newPlaylist);
            }
        }
 public void Delete(Cause cause)
 {
     causes.Remove(cause);
 }
Example #18
0
 public Exception AsError()
 {
     return(Cause.IsPresent() ? Cause.Value : new InvalidOperationException(ToString()));
 }
 public void GetCauseByID_Should_Load_Cause_From_Database()
 {
     using (new UnitOfWorkScope())
     using (new TransactionScope())
     {
         ArrangeCauseTest();
         var id = cause.CauseID;
         cause = null;
         cause = causeRepository.GetCauseByID(id);
         Assert.IsNotNull(cause);
         Assert.Greater(id, 0);
     }
 }
        public ActionResult SignCause(int?id)
        {
            if (Session["MemberId"] == null)
            {
                return(RedirectToAction("Login", "Member"));
            }
            //creates instance of member and assigns the current user's properties to it.
            int    currentSessionId = Convert.ToInt32(Session["MemberId"]);
            Member currentUser      = causeSiteDb.Members.FirstOrDefault(x => x.MemberId == currentSessionId);

            //finds cause based on parameters fed in.
            Cause cause = new Cause();

            cause = causeSiteDb.Causes.FirstOrDefault(c => c.Id == id);


            // check if user has already signed cause
            List <Signature> allSigs       = causeSiteDb.Signatures.ToList();
            Boolean          alreadySigned = false;

            foreach (Signature signature in allSigs)
            {
                if (signature.MemberId == currentUser.MemberId && signature.CauseId == cause.Id)
                {
                    alreadySigned = true;
                }
            }
            if (alreadySigned == true)
            {
                //if user has already signed cause another signature is not permitted. So they are redirected to the main page.
                //cause creators are permitted to sign their cause once.
                //add some sort of error message here
                CauseSignatureViewModel causeSignatureViewModel = new CauseSignatureViewModel();
                causeSignatureViewModel.Causes     = causeSiteDb.Causes.ToList();
                causeSignatureViewModel.Signatures = causeSiteDb.Signatures.ToList();
                return(RedirectToAction("Index", causeSignatureViewModel));
            }

            else
            {
                //if member has not signed the cause before, creates a new instance of signature.
                //sets the signatures properties based on the cause being signed and the current user.
                Signature signature = new Signature();
                signature.SignatureTime  = DateTime.Now;
                signature.Member         = currentUser;
                signature.Cause          = cause;
                signature.MemberId       = currentUser.MemberId;
                signature.CauseId        = cause.Id;
                signature.MemberUsername = currentUser.Username;

                //saves db after adding the signature object
                causeSiteDb.Signatures.Add(signature);
                causeSiteDb.SaveChanges();


                CauseSignatureViewModel causeSignatureViewModel = new CauseSignatureViewModel();
                causeSignatureViewModel.Causes     = causeSiteDb.Causes.ToList();
                causeSignatureViewModel.Signatures = causeSiteDb.Signatures.ToList();
                return(RedirectToAction("index", causeSignatureViewModel));
            }
        }
 public void Delete_Should_Delete_Cause_From_Database()
 {
     using (new UnitOfWorkScope())
     using (new TransactionScope())
     {
         ArrangeCauseTest();
         var id = cause.CauseID;
         causeRepository.Delete(cause);
         causeRepository.Save();
         cause = causeRepository.GetCauseByID(id);
         Assert.IsNull(cause);
     }
 }
Example #22
0
        protected async Task Add()
        {
            var item = new Cause();

            item.EventId     = EventId;
            item.ClassId     = ClassId;
            item.Order       = list.Count > 0 ? list.LastOrDefault().Order + 1 : 0;
            item.Value       = "Cause";
            item.UpdatedDate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
            await dataService.TryInsert(item, (Cause m, String s) => { list.Add(m); Notify("success", s); }, (Exception e, String r) => { selectedItem = null; Notify("error", e.ToString() + " " + r); }, StateProvider);

            await InvokeAsync(StateHasChanged);
        }