using System; using System.Security.Cryptography; using System.Text; using ApiTestConsole.ContractService; using ApiTestConsole.PayrollService; using System.Linq; using System.Threading; using ApiTestConsole.PrimePaymentService; using ApiTestConsole.VendorService; using ReturnCode = ApiTestConsole.PayrollService.ReturnCode; namespace ApiTestConsole { class Program { #region Properties private static string _encryptedPassword; private static string _encryptedJuri; private const string Password = "prism2017"; // "passw0rd"; private const string Jurisdiction = "Newtown"; private const string UserName = "skyj3wel"; private const string VendorName = "Apple Inc2"; private const string PrimeTaxid = "102720124";//"52-1234505"; private const string ContractNumber = "102720112";//"222183505"; private const string SubTaxId = "102720125";//"52-1234505"; private const string CodeSet = "NIGP"; private const string ServiceProduct = "76084 Scrapers"; private const string AddressType = "secondary"; private const string FundSource = "Federal"; private const string FundSourceAmount = "1000"; private const string ContractType = "Professional Services"; private const string PoNumber = "81"; private const string CoNumber = "CO1000"; private const long CertificateId = 1; private const string ReferenceNumber = "Ref5"; private static string _subId = string.Empty; private const string Role = "MBE"; public static string ProjectNumber = "Test12345"; private static readonly StringBuilder WriteLog = new StringBuilder(); static readonly PayrollASMXServiceSoapClient PayrollServiceProxy = new PayrollASMXServiceSoapClient(); static readonly ContractSoapClient ContractServiceProxy = new ContractSoapClient(); static readonly VendorSoapClient VndServiceProxy = new VendorSoapClient(); static readonly PrimePaymentSoapClient primePaymentServiceProxy = new PrimePaymentSoapClient(); #endregion static void Main(string[] args) { _encryptedPassword = EncryptTripleDES(Password); _encryptedJuri = EncryptTripleDES(Jurisdiction); #region Insert CreateUpdateVendorProfile(); CreateUpdateVendorAddress(); CreateUpdateVendorCertification(); CreateUpdateVendorIndustry(); CreateUpdateContractProfile(); CreateUpdateContractFundSource(); CreateUpdateContractGoals(); CreateUpdateContractPrime(); CreateUpdateContractSub(); CreateUpdateContractChangeOrder(); CreateUpdateContractPurchaseOrders(); CreateUpdateContractProject(); CreateUpdatePrimePayment(); CreateUpdatePrimePaymentIndustry(); InsertPayroll(); #endregion #region GetContractProject(); #endregion #region Delete DeleteVendorIndustry(); DeleteVendorCertification(); DeleteVendorAddress(); DeleteVendorProfile(); DeleteChangeOrder(); DeletePurchaseOrder(); DeleteContractFundSource(); DeleteContractSub(); DeletePrimePaymentIndustry(); DeletePrimePayment(); DeleteContractPrime(); DeleteContractProfile(); DeleteContractProject(); #endregion Console.WriteLine(WriteLog); Console.ReadKey(); } private static void CreateUpdatePrimePayment() { try { //PrimePayment Proxy //Get PrimePayment //PrimePayment[] returnedPrimePayments = primePaymentServiceProxy.GetPrimePayments("102720112", 0, 50, userid, encryptedPassword); //Add PrimePayment PrimePayment primePayment = new PrimePayment(); primePayment.ContractNumber = ContractNumber; primePayment.PrimeTaxId = PrimeTaxid; primePayment.PurchaseOrderNumber = PoNumber; primePayment.PaymentAmount = 56; primePayment.PaymentDate = DateTime.Now; primePayment.Reference = ReferenceNumber; primePayment.IssueDate = DateTime.Now; PrimePaymentService.ReturnCode retMessage = primePaymentServiceProxy.CreatePrimePayment(primePayment, UserName, _encryptedPassword, _encryptedJuri); if (retMessage != null) { WriteLog.AppendLine(retMessage.Message + ". "); } } catch (Exception ex) { Console.WriteLine(ex); } } private static void CreateUpdatePrimePaymentIndustry() { try { //PrimePayment Industry Proxy //Get PrimePayment //PrimePaymentIndustry[] returnedPrimePaymentIndustires = primePaymentServiceProxy.GetPrimePaymentIndustryServices("678", userid, encryptedPassword); //Add PrimePayment Industry PrimePaymentIndustry primePaymentIndustry = new PrimePaymentIndustry(); primePaymentIndustry.Reference = ReferenceNumber; primePaymentIndustry.ServiceProduct = ServiceProduct; primePaymentIndustry.CodeSet = CodeSet; PrimePaymentService.ReturnCode retMessage = primePaymentServiceProxy.CreatePrimePaymentIndustry(primePaymentIndustry, UserName, _encryptedPassword, _encryptedJuri); if (retMessage != null) { WriteLog.AppendLine(retMessage.Message + ". "); } } catch (Exception ex) { Console.WriteLine(ex); } } private static void DeletePrimePayment() { PrimePaymentService.ReturnCode deletePrimePayment = primePaymentServiceProxy.DeletePrimePayment(ReferenceNumber, ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Prime Payment Start. "); if (deletePrimePayment != null) { WriteLog.AppendLine(deletePrimePayment.Message + ". "); } } private static void DeletePrimePaymentIndustry() { PrimePaymentService.ReturnCode deletePrimePaymentIndustryService = primePaymentServiceProxy.DeletePrimePaymentIndustry(ReferenceNumber, ServiceProduct, CodeSet, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Prime Payment Industry Start. "); if (deletePrimePaymentIndustryService != null) { WriteLog.AppendLine(deletePrimePaymentIndustryService.Message + ". "); } } private static void InsertPayroll() { Payroll payroll = new Payroll(); payroll.Id = 0; payroll.EndDate = Convert.ToDateTime("2016-10-22T00:00:00"); payroll.PayrollNumber = "10"; payroll.TaxID = PrimeTaxid; payroll.ContractNumber = ContractNumber; payroll.Ssn = "2288"; payroll.Craft = "BUILDING CONSTRUCTION: CARPENTER"; payroll.CraftLevel = "Journeyman"; payroll.TotalGrossPay = 100; payroll.TotalNetPay = 100; payroll.BaseRate = 1; payroll.OvertimeRate1 = 10; payroll.OvertimeRate2 = 10; payroll.Cash = 10; payroll.OtherFringe = 10; payroll.CheckNo = 1; payroll.HealthAndWelfare = 10; payroll.Pension = 10; payroll.FederalTaxes = 10; payroll.Fica = 10; payroll.StateTax = 10; payroll.Sdi = 0; payroll.UnionDues = 0; payroll.Savings = 0; payroll.Medicare = 0; payroll.OtherDeductions = 0; payroll.LocalTax = 0; payroll.WithHolding = 0; payroll.OtherTaxes = 0; payroll.TravSubs = 0; payroll.Exemptions = 0; payroll.Notes = "it is comment for the deduction"; payroll.RhDay1 = 0; payroll.RhDay2 = 0; payroll.RhDay3 = 0; payroll.RhDay4 = 0; payroll.RhDay5 = 0; payroll.RhDay6 = 0; payroll.RhDay7 = 0; payroll.OhDay1 = 0; payroll.OhDay2 = 0; payroll.OhDay3 = 0; payroll.OhDay4 = 0; payroll.OhDay5 = 0; payroll.OhDay6 = 0; payroll.OhDay7 = 0; payroll.DhDay1 = 0; payroll.DhDay2 = 0; payroll.DhDay3 = 0; payroll.DhDay4 = 0; payroll.DhDay5 = 0; payroll.DhDay6 = 0; payroll.DhDay7 = 0; ReturnCode retMsg = PayrollServiceProxy.AddPayroll(payroll, _encryptedJuri, UserName, _encryptedPassword); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } if (retMsg.OperationStatus.ToString().ToLower() == "true") { WriteLog.AppendLine("AddPayroll OK. Payroll Id: " + retMsg.ID + ". "); } else { WriteLog.AppendLine("AddPayroll is Failed."); } } private static void DeleteChangeOrder() { ContractService.ReturnCode deleteChangeOrderStatus = ContractServiceProxy.DeleteContractChangeOrder(ContractNumber, CoNumber, PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Contract Change Order Start. "); if (deleteChangeOrderStatus != null) { WriteLog.AppendLine(deleteChangeOrderStatus.Message + ". "); } } private static void DeleteContractProfile() { ContractService.ReturnCode deleteContractProfileMessage = ContractServiceProxy.DeleteContract(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Contract Profile Start. "); if (deleteContractProfileMessage != null) { WriteLog.AppendLine(deleteContractProfileMessage.Message + ". "); } } private static void DeleteContractFundSource() { ContractService.ReturnCode deleteContractProfileMessage = ContractServiceProxy.DeleteContractFundSource(ContractNumber, FundSource, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Fund Source Start. "); if (deleteContractProfileMessage != null) { WriteLog.AppendLine(deleteContractProfileMessage.Message + ". "); } } private static void DeleteContractSub() { ContractService.ReturnCode deleteContractSub = ContractServiceProxy.DeleteContractSub(ContractNumber, _subId, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Contract Sub Start. "); if (deleteContractSub != null) { WriteLog.AppendLine(deleteContractSub.Message + ". "); } } private static void DeletePurchaseOrder() { ContractService.ReturnCode deletePurchaseOrderStatus = ContractServiceProxy.DeleteContractPurchaseOrder(ContractNumber, PoNumber, PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Contract Purchase Order Start. "); if (deletePurchaseOrderStatus != null) { WriteLog.AppendLine(deletePurchaseOrderStatus.Message + ". "); } } private static void DeleteContractPrime() { ContractService.ReturnCode deleteContractPrimeMessage = ContractServiceProxy.DeleteContractPrime(ContractNumber, PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Contract Prime Start. "); if (deleteContractPrimeMessage != null) { WriteLog.AppendLine(deleteContractPrimeMessage.Message + ". "); } } private static void DeleteVendorAddress() { VendorService.ReturnCode deleteVendorAddressMessage = VndServiceProxy.DeleteVendorAddress(PrimeTaxid, AddressType, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete vendor Address Start. "); if (deleteVendorAddressMessage != null) { WriteLog.AppendLine(deleteVendorAddressMessage.Message + ". "); } } private static void DeleteVendorProfile() { VendorService.ReturnCode deleteVendorMessage = VndServiceProxy.DeleteVendor(PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete vendor profile Start. "); if (deleteVendorMessage != null) { WriteLog.AppendLine(deleteVendorMessage.Message + ". "); } deleteVendorMessage = VndServiceProxy.DeleteVendor(SubTaxId, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete vendor profile Start. "); if (deleteVendorMessage != null) { WriteLog.AppendLine(deleteVendorMessage.Message + ". "); } } private static void DeleteVendorCertification() { VendorService.ReturnCode deleteVendorCertification = VndServiceProxy.DeleteVendorCertification(PrimeTaxid, CertificateId, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Vendor Certification Start. "); if (deleteVendorCertification != null) { WriteLog.AppendLine(deleteVendorCertification.Message + ". "); } } private static void DeleteVendorIndustry() { VendorService.ReturnCode deleteVendorIndustryMessage = VndServiceProxy.DeleteVendorIndustry(PrimeTaxid, ServiceProduct, CodeSet, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete vendor Industry Start. "); if (deleteVendorIndustryMessage != null) { WriteLog.AppendLine(deleteVendorIndustryMessage.Message + ". "); } } private static void CreateUpdateContractPurchaseOrders() { try { ContractPurchaseOrder purchaseOrder = new ContractPurchaseOrder(); purchaseOrder.ContractNumber = ContractNumber; purchaseOrder.PrimeTaxId = PrimeTaxid; purchaseOrder.PurchaseOrderNumber = PoNumber; purchaseOrder.IssueDate = DateTime.Now.AddDays(180); ; purchaseOrder.PoAmount = 1000; purchaseOrder.PoSow = "Additional funds needed for turf for plaza lawn due to insect damage"; ContractService.ReturnCode createPoStatus = ContractServiceProxy.CreateContractPurchaseOrder(purchaseOrder, UserName, _encryptedPassword, _encryptedJuri); if (createPoStatus != null) WriteLog.AppendLine("Contract Purchase order added successfully. "); //Get ContractGoals ContractPurchaseOrder[] returnedPurchaseOrders = ContractServiceProxy.GetContractPurchaseOrders(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetContractPurchaseOrders OK. Count: " + returnedPurchaseOrders.Count() + ". "); } catch (Exception ex) { Console.WriteLine(ex); } } private static void CreateUpdateContractGoals() { try { // Add ContractGoal ContractGoal contractGoal = new ContractGoal(); contractGoal.ContractNumber = ContractNumber; contractGoal.GoalType = "MBE"; contractGoal.GoalPercentage = 20; var returnMessage = ContractServiceProxy.CreateContractGoal(contractGoal, UserName, _encryptedPassword, _encryptedJuri); if (returnMessage != null) { WriteLog.AppendLine(returnMessage.Message + ". "); } //Get ContractGoals ContractGoal[] returnedGoals = ContractServiceProxy.GetContractGoals(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetContractGoals OK. Count: " + returnedGoals.Count() + ". "); //var deleteContractGoal = contractServiceProxy.DeleteContractGoal(ContractNumber, "MWBE", UserName, // encryptedPassword); } catch (Exception ex) { Console.WriteLine(ex); } } private static void CreateUpdateContractChangeOrder() { try { //Add Contract Change Order ContractChangeOrder co = new ContractChangeOrder(); co.ContractNumber = ContractNumber; co.PrimeTaxID = PrimeTaxid; co.ChangeOrderNumber = CoNumber; co.ChangeOrderDate = DateTime.Now; co.ChangeOrderAmount = 10000; co.ChangeOrderSOW = "Add one more lane each side"; ContractService.ReturnCode returnMessage = ContractServiceProxy.CreateContractChangeOrder(co, UserName, _encryptedPassword, _encryptedJuri); if (returnMessage != null) { WriteLog.AppendLine(returnMessage.Message + ". "); } //Get Contract Change Orders - Tested for Newtown Jurisdiction var returnedChangedOrders = ContractServiceProxy.GetContractChangeOrders(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetContractChangeOrders OK. Count: " + returnedChangedOrders.Count() + ". "); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateContractFundSource() { ContractFundSource fundSource = new ContractFundSource(); fundSource.ContractNumber = ContractNumber; fundSource.FundSource = FundSource; fundSource.FundSourceAmount = FundSourceAmount; var insertFsStatus = ContractServiceProxy.CreateContractFundSource(fundSource, UserName, _encryptedPassword, _encryptedJuri); if (insertFsStatus != null) { WriteLog.AppendLine(insertFsStatus.Message + ". "); } try { var getFundSources = ContractServiceProxy.GetContractFundSources(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Get Contract Fund Source OK. Count: " + getFundSources.Count() + ". "); } catch (Exception ex) { WriteLog.AppendLine("ERROR: Get Contract Fund Source throwing exception: " +ex.Message + ". "); } // var deleteFsStatus = contractServiceProxy.DeleteContractFundSource(ContractNumber, FundSource, UserName, // encryptedPassword); } private static void CreateUpdateContractSub() { try { //Add Sub ContractSub sub = new ContractSub(); sub.ContractNumber = ContractNumber; sub.PrimeTaxId = PrimeTaxid; sub.SubTaxId = SubTaxId; sub.Role = Role; ContractService.ReturnCode createSubMsg = ContractServiceProxy.CreateContractSub(sub, UserName, _encryptedPassword, _encryptedJuri); _subId = createSubMsg.ID; if (createSubMsg != null) { WriteLog.AppendLine(createSubMsg.Message + ". "); } //Get Subs ContractSub[] returnedSubs = ContractServiceProxy.GetContractSubs(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Get Contract Sub OK. Count: " + returnedSubs.Count() + ". "); // Delete Sub // PrismContract.ReturnCode deleteSubMsg = contractServiceProxy.DeleteContractSub(ContractNumber, SubTaxID, UserName, encryptedPassword); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateContractPrime() { try { //Add Prime ContractPrime prime = new ContractPrime(); prime.ContractNumber = ContractNumber; prime.PrimeTaxId = PrimeTaxid; prime.Role = "MBE"; ContractService.ReturnCode createPrimeMsg = ContractServiceProxy.CreateContractPrime(prime, UserName, _encryptedPassword, _encryptedJuri); if (createPrimeMsg != null) { WriteLog.AppendLine(createPrimeMsg.Message + ". "); } //Get Prime ContractPrime[] returnedPrimes = ContractServiceProxy.GetContractPrimes(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetContractPrimes OK. Count: " + returnedPrimes.Count() + ". "); //PrismContract.ReturnCode deleteSubMsg = contractServiceProxy.DeletePrime(ContractNumber, SubTaxID, UserName, encryptedPassword); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateVendorIndustry() { try { VendorIndustry vendorIndustry = new VendorIndustry(); vendorIndustry.CodeSet = CodeSet; vendorIndustry.ServiceProduct = ServiceProduct; vendorIndustry.TaxId = PrimeTaxid; // var vIndusDeleteStatus = VndServiceProxy.DeleteVendorIndustry(PrimeTaxid, ServiceProduct, CodeSet, UserName, _encryptedPassword, _encryptedJuri); var vendorIndustryStatus = VndServiceProxy.CreateVendorIndustry(vendorIndustry, UserName, _encryptedPassword, _encryptedJuri); if (vendorIndustryStatus != null) { WriteLog.AppendLine(vendorIndustryStatus.Message + ". "); } var vendorIndustries = VndServiceProxy.GetVendorIndustries(PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Get Vendor Industry OK. Count: " + vendorIndustries.Count() + ". "); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateContractProfile() { try { ContractProfile cnt = new ContractProfile(); cnt.ContractNumber = ContractNumber; cnt.Name = VendorName + " Bridge"; cnt.AwardAmount = 1000; cnt.ContractType = ContractType; cnt.AwardDate = DateTime.Now; cnt.EndDate = DateTime.Now.AddDays(360); cnt.StartDate = DateTime.Now.AddDays(30); cnt.Industry = "236"; cnt.Department = "Information Technology"; //cnt.Division = "Infrastructure"; cnt.Buyer = "Jim Hanks"; cnt.Status = "Open"; //cnt.Specialist = "Vladimir Charlotte"; cnt.OverallGoal = 90; cnt.SOW = "Build a bridge"; //cnt.ProjectNumber = "18060N"; cnt.Address1 = "227 Howard Str"; cnt.Address2 = "Suit 220"; cnt.City = "Baltimore"; cnt.State = "MD"; cnt.Zip = "21202"; //cnt.County = "Baltimore (city)"; //cnt.Residence = "Local Residence"; ContractService.ReturnCode returnMessage = ContractServiceProxy.CreateContract(cnt, true, UserName, _encryptedPassword, _encryptedJuri); if (returnMessage != null) { WriteLog.AppendLine(returnMessage.Message + ". "); } //Get Contract - Tested for Newtown Jurisdiction ContractProfile returnedContract = ContractServiceProxy.GetContract(ContractNumber, UserName, _encryptedPassword, _encryptedJuri); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateVendorCertification() { try { //Add VendorCertification VendorCertification _vendorCertification = new VendorCertification(); _vendorCertification.TaxID = PrimeTaxid; _vendorCertification.CertificateNumber = "14900"; _vendorCertification.CertificateJuri = Jurisdiction; _vendorCertification.CertificateType = "MBE"; _vendorCertification.CertificateExpDate = new DateTime(2016, 12, 31); _vendorCertification.CertificateIssueDate = DateTime.Now; _vendorCertification.ReCertificationDate = new DateTime(2016, 11, 30); VendorService.ReturnCode retMsg = VndServiceProxy.CreateVendorCertification(_vendorCertification, UserName, _encryptedPassword, _encryptedJuri); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } _vendorCertification.TaxID = PrimeTaxid; _vendorCertification.CertificateNumber = "14901"; _vendorCertification.CertificateJuri = Jurisdiction; _vendorCertification.CertificateType = "MBE"; _vendorCertification.CertificateExpDate = new DateTime(2017, 12, 31); _vendorCertification.CertificateIssueDate = DateTime.Now; _vendorCertification.ReCertificationDate = new DateTime(2017, 11, 30); retMsg = VndServiceProxy.CreateVendorCertification(_vendorCertification, UserName, _encryptedPassword, _encryptedJuri); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } //Get VendorCertificate VendorCertification[] returnedVendorCertifications = VndServiceProxy.GetVendorCertifications(PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetVendor Certification OK. Count: " + returnedVendorCertifications.Count() + ". "); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateVendorAddress() { try { //Add Primary VendorAddress VendorAddress _vendorAddress = new VendorAddress(); _vendorAddress.TaxID = PrimeTaxid; _vendorAddress.AddressType = "Primary"; _vendorAddress.Address1 = "3184 Howard Ln"; //_vendorAddress.Address2 = "Apt 5"; //_vendorAddress.District = "11th"; //_vendorAddress.County = "Baltimore (City)"; _vendorAddress.City = "Baltimore"; _vendorAddress.State = "MARYLAND"; _vendorAddress.Zip = "21202"; _vendorAddress.Country = "UNITED STATES"; //_vendorAddress.ContactPersonFirstName = "JOHN"; //_vendorAddress.ContactPersonLastName = "Doe"; //_vendorAddress.ContactPersonEmail = "John@gmail.com"; //_vendorAddress.ContactPersonPhone = "9876543210"; _vendorAddress.SiteID = "5554"; VendorService.ReturnCode retMsg = VndServiceProxy.CreateVendorAddress(_vendorAddress, UserName, _encryptedPassword, _encryptedJuri); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } //Get VendorAddress VendorAddress[] returnedVendorAddresses = VndServiceProxy.GetVendorAddresses(PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetVendor Address OK. Count: " + returnedVendorAddresses.Count() + ". "); //Add Secondary VendorAddress VendorAddress _vendorSecondaryAddress = new VendorAddress(); _vendorSecondaryAddress.TaxID = SubTaxId; _vendorSecondaryAddress.AddressType = "Secondary"; _vendorSecondaryAddress.Address1 = "2100 Guilford Str"; _vendorSecondaryAddress.City = "Baltimore"; _vendorSecondaryAddress.State = "MARYLAND"; _vendorSecondaryAddress.Zip = "21202"; _vendorSecondaryAddress.Country = "UNITED STATES"; _vendorSecondaryAddress.SiteID = "5555"; retMsg = VndServiceProxy.CreateVendorAddress(_vendorSecondaryAddress, UserName, _encryptedPassword, _encryptedJuri); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } //Get VendorAddress returnedVendorAddresses = VndServiceProxy.GetVendorAddresses(SubTaxId, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetVendor Address OK. Count: " + returnedVendorAddresses.Count() + ". "); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateVendorProfile() { try { //Add Vendor VendorProfile _vendor = new VendorProfile(); _vendor.TAXID = PrimeTaxid; _vendor.Name = VendorName; _vendor.DBA = "MBE"; _vendor.BusinessStructure = "Corporation"; _vendor.PrimaryBusinessActivity = "Construction"; _vendor.ProductService = "ABC Product Service"; _vendor.Race = "African American"; _vendor.Gender = "Female"; _vendor.Phone = "555-418-1214"; _vendor.Fax = "555-481-1220"; _vendor.Url = "http://prismcompliance.com"; _vendor.InsuranceCompany = "All State"; _vendor.InsuranceNumber = "Q-102569"; _vendor.InsuranceExpDate = new DateTime(); _vendor.ContactPerson1Name = "Samanta Johnson"; _vendor.ContactPerson1Phone = "1-555-418-1217"; _vendor.ContactPerson1CellPhone = "1-555-123-1234"; _vendor.ContactPerson1Email = "user_na@emailaddress.com"; _vendor.ContactPerson1Title = "Account Manager"; _vendor.ContactPerson2Name = "John Johnson"; _vendor.ContactPerson2Phone = "554-418-1217"; _vendor.ContactPerson2CellPhone = "555-032-1234"; _vendor.ContactPerson2Email = "john.johnson@yahooemails.com"; _vendor.ContactPerson2Title = "President"; _vendor.VIN = "VIN0249"; _vendor.DUNS = "0252"; _vendor.CAGE = "0259"; _vendor.NumberOfEmployees = 15; VendorService.ReturnCode retMsg = VndServiceProxy.CreateVendor(_vendor, false, UserName, _encryptedPassword, _encryptedJuri); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } //Get Vendor VendorProfile returnedVendor = VndServiceProxy.GetVendor(PrimeTaxid, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetVendor OK: " + returnedVendor.Name + ". "); Thread.Sleep(1000); //Add Vendor VendorProfile _subVendor = new VendorProfile(); _subVendor.TAXID = SubTaxId; _subVendor.Name = "Sub of " + VendorName; _subVendor.BusinessStructure = "Corporation"; _subVendor.PrimaryBusinessActivity = "Construction"; _subVendor.Race = "African American"; _subVendor.Gender = "Female"; _vendor.ContactPerson1Name = "Michael Boomer"; _vendor.ContactPerson1Email = "michael_na@emailaddress.com"; retMsg = VndServiceProxy.CreateVendor(_subVendor,true, UserName, _encryptedPassword, _encryptedJuri); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } returnedVendor = VndServiceProxy.GetVendor(SubTaxId, UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetVendor OK: " + returnedVendor.Name + ". "); Thread.Sleep(1000); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void GetContractProject() { try { var projectDetail = ContractServiceProxy.GetContractProjects(UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetProject OK: " + projectDetail.Count() + ". "); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void CreateUpdateContractProject() { try { //Add Contract Project ContractProject contractProject = new ContractProject(); contractProject.ID = 0; contractProject.ProjectName = "test5"; contractProject.ProjectNumber = "test5"; contractProject.Status = 1; contractProject.ProjectType = "Tilman Construction P-1"; ContractService.ReturnCode retMsg = ContractServiceProxy.CreateContractProject(contractProject, UserName, _encryptedPassword, _encryptedJuri); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } //Get VendorAddress ContractProject returnProject = ContractServiceProxy.GetContractProject("test5", UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("GetProject OK. : " + returnProject.ProjectName + ". "); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private static void DeleteContractProject() { ContractService.ReturnCode retMsg = ContractServiceProxy.DeleteContractProject("test5", UserName, _encryptedPassword, _encryptedJuri); WriteLog.AppendLine("Delete Contract Project Start. "); if (retMsg != null) { WriteLog.AppendLine(retMsg.Message + ". "); } } public static string EncryptTripleDES(string sIn) { // Details removed for security reasons return Convert.ToBase64String(DESEncrypt.TransformFinalBlock(buffer, 0, buffer.Length)); } } }