コード例 #1
0
        public void DeletePaymentRule(IPaymentRule paymentRule)
        {
            PaymentRule payRule = (PaymentRule)paymentRule;
            Supplier    supp    = (Supplier)payRule.Supplier;

            supp.DeletePaymentRule(payRule);
        }
コード例 #2
0
        public void DeletePaymentRule(IPaymentRule paymentRule)
        {
            PaymentRule payRule = (PaymentRule)paymentRule;
            Supplier supp = (Supplier)payRule.Supplier;

            supp.DeletePaymentRule(payRule);
        }
コード例 #3
0
ファイル: PaymentRule.cs プロジェクト: Klockz/LonelyTreeExam
        internal PaymentRule(IPaymentRule paymentRuleEntity, Supplier supplier, IDataAccessFacade dataAccessFacade)
        {
            this.dataAccessFacade = dataAccessFacade;
            this._paymentRuleEntity = paymentRuleEntity;

            // Get/Create Models of supplier and customer
            Supplier = supplier;
            Customer = new Customer(_paymentRuleEntity.Customer, dataAccessFacade);
        }
コード例 #4
0
ファイル: PaymentRule.cs プロジェクト: Klockz/LonelyTreeExam
        internal PaymentRule(IPaymentRule paymentRuleEntity, Supplier supplier, IDataAccessFacade dataAccessFacade)
        {
            this.dataAccessFacade   = dataAccessFacade;
            this._paymentRuleEntity = paymentRuleEntity;

            // Get/Create Models of supplier and customer
            Supplier = supplier;
            Customer = new Customer(_paymentRuleEntity.Customer, dataAccessFacade);
        }
コード例 #5
0
        public void DeletePaymentRule(IPaymentRule paymentRuleEntity)
        {
            PaymentRuleEntity paymentRule = (PaymentRuleEntity)paymentRuleEntity;

            paymentRule.Deleted = true;

            SupplierEntity supplier = (SupplierEntity)(paymentRule.Supplier);

            supplier.RemovePaymentRule(paymentRule);
        }
コード例 #6
0
        public IPaymentContract CreatePaymentContract(IBooking iBooking, IPaymentRule iPaymentRule)
        {
            IPaymentContract iPaymentContract = paymentContractController.Create(iBooking, iPaymentRule);
            iPaymentContract = dataAccessFacade.CreatePaymentContract(iPaymentContract);
            if (iPaymentContract.Deleted == false)
            {
                UpdatePaymentContract(iPaymentContract);
            }

            return iPaymentContract;
        }
コード例 #7
0
        public PaymentRule(IPaymentRule iPaymentRule)
        {
            Id = iPaymentRule.Id;
            Deleted = iPaymentRule.Deleted;
            LastUpdated = iPaymentRule.LastUpdated;

            PaymentRuleCatalog = iPaymentRule.PaymentRuleCatalog;
            ReferenceDate = iPaymentRule.ReferenceDate;
            PaymentDate = iPaymentRule.PaymentDate;
            Percentage = iPaymentRule.Percentage;
            Description = iPaymentRule.Description;
        }
コード例 #8
0
        public void ValidateAllRules(Payment payment, PaymentRuleTestBuilder builder)
        {
            foreach (Type type in builder.GetPassingTypes())
            {
                IPaymentRule rule = (IPaymentRule)System.Activator.CreateInstance(type);
                Assert.True(rule.IsValid(payment));
            }

            foreach (Type type in builder.GetFailingTypes())
            {
                IPaymentRule rule = (IPaymentRule)System.Activator.CreateInstance(type);
                Assert.False(rule.IsValid(payment));
            }
        }
コード例 #9
0
ファイル: PaymentRule.cs プロジェクト: Klockz/LonelyTreeExam
        internal PaymentRule(Supplier supplier, Customer customer, BookingType bookingType, decimal percentage,
                             int daysOffset, BaseDate baseDate, PaymentType paymentType, IDataAccessFacade dataAccessFacade)
        {
            // validate
            validateCustomer(customer);
            validateSupplier(supplier);

            // Get entities for DataAccess
            ISupplier supplierEntity = supplier._supplierEntity;
            ICustomer customerEntity = customer._customerEntity;

            this.dataAccessFacade = dataAccessFacade;
            _paymentRuleEntity    = dataAccessFacade.CreatePaymentRule(supplierEntity, customerEntity, bookingType,
                                                                       percentage, daysOffset, baseDate, paymentType);
        }
コード例 #10
0
ファイル: PaymentRule.cs プロジェクト: Klockz/LonelyTreeExam
        internal PaymentRule(Supplier supplier, Customer customer, BookingType bookingType, decimal percentage, 
            int daysOffset, BaseDate baseDate, PaymentType paymentType, IDataAccessFacade dataAccessFacade)
        {
            // validate
            validateCustomer(customer);
            validateSupplier(supplier);

            // Get entities for DataAccess
            ISupplier supplierEntity = supplier._supplierEntity;
            ICustomer customerEntity = customer._customerEntity;

            this.dataAccessFacade = dataAccessFacade;
            _paymentRuleEntity = dataAccessFacade.CreatePaymentRule(supplierEntity, customerEntity, bookingType,
                percentage, daysOffset, baseDate, paymentType);
        }
コード例 #11
0
        public PaymentContract(IBooking iBooking, IPaymentRule iPaymentRule)
        {
            Booking = iBooking;

            if (iPaymentRule.ReferenceDate == ReferenceDate.BookingEndDate)
            {
                DueDate = iBooking.EndDate.AddDays(iPaymentRule.PaymentDate);
            }
            else
            {
                DueDate = iBooking.StartDate.AddDays(iPaymentRule.PaymentDate);
            }

            Amount = iBooking.TotalAmount * iPaymentRule.Percentage;
            Valuta = iBooking.Valuta;
        }
コード例 #12
0
        public void UpdatePaymentRule(IPaymentRule paymentRuleEntity)
        {
            PaymentRuleEntity paymentRule = (PaymentRuleEntity)paymentRuleEntity;

            paymentRule.LastModified = DateTime.Now;
        }
 public void Setup()
 {
     _paymentSchemeFasterPaymentsRule = new PaymentSchemeFasterPaymentsRule();
 }
コード例 #14
0
        public IPaymentRule UpdatePaymentRule(IPaymentRule iPaymentRule)
        {
            iPaymentRule = paymentRuleController.Update(iPaymentRule);
            dataAccessFacade.UpdatePaymentRule(iPaymentRule);

            return iPaymentRule;
        }
コード例 #15
0
 public void DeletePaymentRule(IPaymentRule paymentRuleEntity)
 {
     paymentRuleMapper.Delete((PaymentRuleEntity)paymentRuleEntity);
 }
コード例 #16
0
        public IPaymentRule CreatePaymentRule(IPaymentRule iPaymentRule)
        {
            iPaymentRule = paymentRuleController.Create(iPaymentRule);

            return iPaymentRule;
        }
コード例 #17
0
        public IPaymentRule DeletePaymentRule(IPaymentRule iPaymentRule)
        {
            iPaymentRule = paymentRuleController.Delete(iPaymentRule);

            return iPaymentRule;
        }
コード例 #18
0
 public void UpdatePaymentRule(IPaymentRule paymentRuleEntity)
 {
     PaymentRuleEntity paymentRule = (PaymentRuleEntity)paymentRuleEntity;
     paymentRule.LastModified = DateTime.Now;
 }
コード例 #19
0
        public void DeletePaymentRule(IPaymentRule paymentRuleEntity)
        {
            PaymentRuleEntity paymentRule = (PaymentRuleEntity)paymentRuleEntity;
            paymentRule.Deleted = true;

            SupplierEntity supplier = (SupplierEntity)(paymentRule.Supplier);
            supplier.RemovePaymentRule(paymentRule);
        }
コード例 #20
0
 public void UpdatePaymentRule(IPaymentRule paymentRuleEntity)
 {
     paymentRuleMapper.Update((PaymentRuleEntity)paymentRuleEntity);
 }
コード例 #21
0
 public void DeletePaymentRule(IPaymentRule paymentRuleEntity)
 {
     paymentRuleMapper.Delete((PaymentRuleEntity)paymentRuleEntity);
 }
コード例 #22
0
 private void paymentRuleDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     selectedPaymentRule = (IPaymentRule) paymentRuleDataGrid.SelectedItem;
     setPaymentRuleValuesInTextBoxes();
 }
コード例 #23
0
 public void Setup()
 {
     _paymentSchemeBacsRule = new PaymentSchemeBacsRule();
 }
コード例 #24
0
 private void paymentRuleDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     selectedPaymentRule = (IPaymentRule)paymentRuleDataGrid.SelectedItem;
     setPaymentRuleValuesInTextBoxes();
 }
コード例 #25
0
 public void UpdatePaymentRule(IPaymentRule paymentRuleEntity)
 {
     paymentRuleMapper.Update((PaymentRuleEntity)paymentRuleEntity);
 }