/// <summary> /// 设置供应商 /// </summary> /// <param name="supplier">供应商</param> public void SetSupplier(Supplier supplier) { if (supplier == null || supplier.IsTransient()) { throw new ArgumentException("供应商参数为空!"); } Supplier = supplier; SupplierId = supplier.Id; SupplierName = supplier.CnName; }
/// <summary> /// 设置发票属性 /// </summary> /// <param name="invoice">发票</param> /// <param name="invoideCode">发票代码</param> /// <param name="invoiceDate">发票日期</param> /// <param name="operatorName">经办人</param> /// <param name="invoiceNumber">发票号</param> /// <param name="supplier">供应商</param> /// <param name="order">订单</param> /// <param name="paidAmount">已付金额</param> /// <param name="currency">币种</param> /// <param name="paymentScheduleLineId">付款计划行ID</param> /// <param name="status">发票状态</param> /// <returns>发票</returns> public static void SetInvoice(Invoice invoice, string invoideCode, DateTime invoiceDate, string operatorName, string invoiceNumber, Supplier supplier, Order order, decimal paidAmount, Currency currency, int? paymentScheduleLineId, int status) { invoice.InvoideCode = invoideCode; invoice.InvoiceDate = invoiceDate; invoice.SetOperator(operatorName); invoice.SetInvoiceNumber(invoiceNumber); invoice.SetSupplier(supplier); invoice.SetOrder(order); invoice.SetCurrency(currency); invoice.SetPaymentScheduleLine(paymentScheduleLineId); invoice.SetInvoiceStatus((InvoiceStatus) status); }