public void DeletePaymentRule(IPaymentRule paymentRule) { PaymentRule payRule = (PaymentRule)paymentRule; Supplier supp = (Supplier)payRule.Supplier; supp.DeletePaymentRule(payRule); }
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); }
public void DeletePaymentRule(IPaymentRule paymentRuleEntity) { PaymentRuleEntity paymentRule = (PaymentRuleEntity)paymentRuleEntity; paymentRule.Deleted = true; SupplierEntity supplier = (SupplierEntity)(paymentRule.Supplier); supplier.RemovePaymentRule(paymentRule); }
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; }
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; }
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)); } }
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); }
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; }
public void UpdatePaymentRule(IPaymentRule paymentRuleEntity) { PaymentRuleEntity paymentRule = (PaymentRuleEntity)paymentRuleEntity; paymentRule.LastModified = DateTime.Now; }
public void Setup() { _paymentSchemeFasterPaymentsRule = new PaymentSchemeFasterPaymentsRule(); }
public IPaymentRule UpdatePaymentRule(IPaymentRule iPaymentRule) { iPaymentRule = paymentRuleController.Update(iPaymentRule); dataAccessFacade.UpdatePaymentRule(iPaymentRule); return iPaymentRule; }
public void DeletePaymentRule(IPaymentRule paymentRuleEntity) { paymentRuleMapper.Delete((PaymentRuleEntity)paymentRuleEntity); }
public IPaymentRule CreatePaymentRule(IPaymentRule iPaymentRule) { iPaymentRule = paymentRuleController.Create(iPaymentRule); return iPaymentRule; }
public IPaymentRule DeletePaymentRule(IPaymentRule iPaymentRule) { iPaymentRule = paymentRuleController.Delete(iPaymentRule); return iPaymentRule; }
public void UpdatePaymentRule(IPaymentRule paymentRuleEntity) { paymentRuleMapper.Update((PaymentRuleEntity)paymentRuleEntity); }
private void paymentRuleDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { selectedPaymentRule = (IPaymentRule) paymentRuleDataGrid.SelectedItem; setPaymentRuleValuesInTextBoxes(); }
public void Setup() { _paymentSchemeBacsRule = new PaymentSchemeBacsRule(); }
private void paymentRuleDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { selectedPaymentRule = (IPaymentRule)paymentRuleDataGrid.SelectedItem; setPaymentRuleValuesInTextBoxes(); }