예제 #1
0
        public void normalizeConfiguration()
        {
            Boolean found = false;

            foreach (EaglesoftAdjustmentType eaglesoftAdjustment in EaglesoftAdjustments)
            {
                found = false;
                foreach (RefundTypeMapping r in RefundTypeMappings)
                {
                    if (eaglesoftAdjustment.Equals(r.EaglesoftAdjustment))
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    RefundTypeMapping refundMapping = new RefundTypeMapping();
                    refundMapping.EaglesoftAdjustment = eaglesoftAdjustment;
                    RefundTypeMappings.Add(refundMapping);
                }
            }


            foreach (EaglesoftPaymentType eaglesoftPaytype in EaglesoftPaytypes)
            {
                found = false;
                foreach (PaytypeMapping p in PayTypeMappings)
                {
                    if (eaglesoftPaytype.Equals(p.EaglesoftPaytype))
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    PaytypeMapping t = new PaytypeMapping();
                    t.EaglesoftPaytype = eaglesoftPaytype;
                    PayTypeMappings.Add(t);
                }
            }
        }
예제 #2
0
 public void FromRefundMappingDTOs(IList <RefundTypeMappingDTO> refundMappingDTOs)
 {
     RefundTypeMappings.Clear();
     foreach (RefundTypeMappingDTO refundTypeMappingDTO in refundMappingDTOs)
     {
         RefundTypeMappings.Add(new RefundTypeMapping()
         {
             Customer               = QuickbooksCustomers.FirstOrDefault(p => p.Name.Equals(refundTypeMappingDTO.QuickbooksCustomer)),
             EaglesoftAdjustment    = EaglesoftAdjustments.Single(p => p.Id.Equals(refundTypeMappingDTO.EaglesoftAdjustmentId)),
             Enabled                = refundTypeMappingDTO.Enabled,
             IncomeAccount          = QuickbooksIncomeAccounts.FirstOrDefault(p => p.Name.Equals(refundTypeMappingDTO.QuickbooksIncomeAccount)),
             RefundCheckBankAccount = QuickbooksBankAccounts.FirstOrDefault(p => p.Name.Equals(refundTypeMappingDTO.QuickbooksRefundCheckBankAccount)),
             IssueCheck             = refundTypeMappingDTO.IssueCheck,
             QuickbooksPaytype      = QuickbooksPaytypes.FirstOrDefault(p => p.Name.Equals(refundTypeMappingDTO.QuickbooksPaytype)),
             RefundCheckRecipient   = refundTypeMappingDTO.RefundCheckRecipient
         });
     }
 }