Exemple #1
0
 protected bool Equals(Payment other)
 {
     return ID == other.ID &&
         string.Equals(Number, other.Number) &&
         SaleDate.Equals(other.SaleDate) &&
         (PaymentDetails.SequenceEqual(other.PaymentDetails, new PaymentDetailComparer()));
 }
        protected void WriteToPaymentModel(Payment newModel)
        {
            newModel.ID = PaymentId;
            newModel.SaleDate = SaleDate;
            newModel.Number = Number;

            newModel.PaymentDetails.Clear();

            foreach (var paymentDetail in PaymentDetailList)
            {
                newModel.PaymentDetails.Add(paymentDetail);
            }

            newModel.TotalValue = TotalValue;
        }
        protected virtual void ReadFromModel(Payment payment)
        {
            PaymentId = payment.ID;

            Number = payment.Number;
            SaleDate = payment.SaleDate;

            PaymentDetailList.Clear();
            foreach (var paymentDetail in payment.PaymentDetails)
            {
                PaymentDetailList.Add(paymentDetail);
            }
        }
        protected override void ReadFromModel(Payment payment)
        {
            base.ReadFromModel(payment);
            InvoiceModel = payment as Invoice;

            IssueDate = InvoiceModel.IssueDate;
            SelectedPaymentMethod = InvoiceModel.PaymentMethod;
            PaymentPeriod = InvoiceModel.PaymentPeriod;
            Annotation = InvoiceModel.Annotation;
        }