public static VoucherImport ToVoucherImport(VoucherImportWrapper v)
 {
     var n = new VoucherImport();
     n.AddressLine1 = v.AddressLine1;
     n.AddressLine2 = v.AddressLine2;
     n.Amount = v.Amount;
     n.Company = v.Company;
     //n.Country = Country;
     n.EmailAddress = v.EmailAddress;
     n.First = v.First;
     n.Last = v.Last;
     n.Middle = v.Middle;
     n.Municipality = v.Municipality;
     n.NamePrefix = v.NamePrefix;
     n.PersonId = v.PersonId;
     n.PhoneNumber = v.PhoneNumber;
     n.PostalCode = v.PostalCode;
     n.Region = v.Region;
     n.Suffix = v.Suffix;
     n.Title = v.Title;
     n.JobNumber = v.JobNumber;
     n.Amount = v.Amount;
     n.RecordID = v.RecordID;
     return n;
 }
 public static InputStreetAddress ToInputStreetAddress(VoucherImport v)
 {
     var n = new InputStreetAddress();
     n.AddressLine1 = v.AddressLine1;
     n.AddressLine2 = v.AddressLine2;
     n.CompanyName = v.Company;
     n.Country = v.Country;
     n.EmailAddress = v.EmailAddress;
     n.FirstName = v.First;
     n.LastName = v.Last;
     n.City = v.Municipality;
     n.PhoneNumber = v.PhoneNumber;
     n.PostalCode = v.PostalCode;
     n.State = v.Region;
     n.ID = v.ID;
     n.RecordID = v.RecordID;
     return n;
 }
 public static VoucherEdit ToVoucherEdit(VoucherImport v)
 {
     var n = VoucherEdit.NewVoucherEdit();
     n.AddressLine1 = !string.IsNullOrEmpty(v.AddressLine1) ? v.AddressLine1.ToUpper():v.AddressLine1;
     n.AddressLine2 = !string.IsNullOrEmpty(v.AddressLine2) ? v.AddressLine2.ToUpper() : v.AddressLine2;
     n.Amount = v.Amount;
     n.Company = !string.IsNullOrEmpty(v.Company) ? v.Company.ToUpper(): v.Company;
     //n.Country = Country;
     n.EmailAddress = v.EmailAddress;
     n.First = !string.IsNullOrEmpty(v.First) ?  v.First.ToUpper(): v.First;
     n.Last = !string.IsNullOrEmpty(v.Last) ? v.Last.ToUpper() : v.Last;
     n.Middle = !string.IsNullOrEmpty(v.Middle) ? v.Middle.ToUpper(): v.Middle;
     n.Municipality = !string.IsNullOrEmpty(v.Municipality) ? v.Municipality.ToUpper(): v.Municipality;
     n.NamePrefix = !string.IsNullOrEmpty(v.NamePrefix) ? v.NamePrefix.ToUpper(): v.NamePrefix;
     n.PersonId = v.PersonId;
     n.PhoneNumber = v.PhoneNumber;
     n.PostalCode = v.PostalCode;
     n.Region = !string.IsNullOrEmpty(v.Region) ? v.Region.ToUpper() : v.Region;
     n.Suffix = !string.IsNullOrEmpty(v.Suffix)? v.Suffix.ToUpper(): v.Suffix;
     n.Title = !string.IsNullOrEmpty(v.Title) ? v.Title.ToUpper() : v.Title;
     return n;
 }
        public static VoucherImportWrapper ToVoucherImportWrapper(DataCleanEvent e)
        {
            var n = new VoucherImport();
            n.AddressLine1 = e.Input.AddressLine1;
            n.AddressLine2 = e.Input.AddressLine2;
            n.Company = e.Input.CompanyName;
            n.Country = e.Input.Country;
            n.EmailAddress = e.Input.EmailAddress;
            n.First = e.Input.FirstName;
            n.Last = e.Input.LastName;
            n.Municipality = e.Input.City;
            n.PhoneNumber = e.Input.PhoneNumber;
            n.PostalCode = e.Input.PostalCode;
            n.Region = e.Input.State;
            n.RecordID = e.Input.RecordID;
            n.ID = e.Input.ID;

            var v = new VoucherImportWrapper(n);
            v.DataCleanDate = e.DataCleanDate;
            v.AltAddress = e.Output;
            return v;
        }
Пример #5
0
 public void CreateNewVoucher()
 {
     if (SelectedBatch != null)
     {
         var v = new VoucherImport();
         v.Amount = SelectedBatch.Amount;
         v.JobNumber = SelectedBatch.JobNum.ToString();
         WorkVoucherImport = v;
     }
 }