Example #1
0
 public void DeletePaymentNotice(PaymentNoticeDTO paymentNotice)
 {
     PaymentNotice deletePaymentNotice = _paymentNoticeRepository.Get(paymentNotice.PaymentNoticeId);
         //获取需要删除的对象。
     UpdatePaymentNoticeLines(new List<PaymentNoticeLineDTO>(), deletePaymentNotice);
     _paymentNoticeRepository.Remove(deletePaymentNotice); //删除付款通知。
 }
Example #2
0
 public void InsertPaymentNotice(PaymentNoticeDTO paymentNotice)
 {
     PaymentNotice newPaymentNotice = PaymentNoticeFactory.CreatePaymentNotice();
     string date = DateTime.Now.Date.ToString("yyyyMMdd").Substring(0, 8);
     string noticeNumber = _paymentNoticeRepository.GetAll().Max(p => p.NoticeNumber);
     int seq = 1;
     if (!string.IsNullOrEmpty(noticeNumber) && noticeNumber.StartsWith(date))
     {
         seq = Int32.Parse(noticeNumber.Substring(8)) + 1;
     }
     if (seq <= _maxInvoiceNumber)
     {
         seq = _maxInvoiceNumber;
     }
     else
     {
         _maxInvoiceNumber = seq;
     }
     _maxInvoiceNumber++;
     newPaymentNotice.SetNoticeNumber(seq);
     PaymentNoticeFactory.SetPaymentNotice(newPaymentNotice, paymentNotice.DeadLine, paymentNotice.SupplierName,
         paymentNotice.SupplierId,
         paymentNotice.OperatorName, paymentNotice.Reviewer, paymentNotice.Status, paymentNotice.CurrencyId,
         paymentNotice.BankAccountId, paymentNotice.IsComplete);
     if (paymentNotice.PaymentNoticeLines != null)
     {
         foreach (PaymentNoticeLineDTO paymentNoticeLine in paymentNotice.PaymentNoticeLines)
         {
             PaymentNoticeLine newPaymentNoticeLine = PaymentNoticeFactory.CreatePaymentNoticeLine();
             PaymentNoticeFactory.SetPaymentNoticeLine(newPaymentNoticeLine, paymentNoticeLine.InvoiceType,
                 paymentNoticeLine.InvoiceId, paymentNoticeLine.InvoiceNumber,
                 paymentNoticeLine.Amount, paymentNoticeLine.Note);
             newPaymentNotice.PaymentNoticeLines.Add(newPaymentNoticeLine);
         }
     }
     _paymentNoticeRepository.Add(newPaymentNotice);
     UpdateInvoicePaidAmount(newPaymentNotice);
 }
Example #3
0
 public void ModifyPaymentNotice(PaymentNoticeDTO paymentNotice)
 {
     PaymentNotice updatePaymentNotice = _paymentNoticeRepository.Get(paymentNotice.PaymentNoticeId);
         //获取需要更新的对象。
     PaymentNoticeFactory.SetPaymentNotice(updatePaymentNotice, paymentNotice.DeadLine,
         paymentNotice.SupplierName, paymentNotice.SupplierId,
         paymentNotice.OperatorName, paymentNotice.Reviewer, paymentNotice.Status, paymentNotice.CurrencyId,
         paymentNotice.BankAccountId, paymentNotice.IsComplete);
     UpdatePaymentNoticeLines(paymentNotice.PaymentNoticeLines, updatePaymentNotice);
     _paymentNoticeRepository.Modify(updatePaymentNotice);
     UpdateInvoicePaidAmount(updatePaymentNotice);
 }