本文整理汇总了C#中Receipt.CopyPropertiesFrom方法的典型用法代码示例。如果您正苦于以下问题:C# Receipt.CopyPropertiesFrom方法的具体用法?C# Receipt.CopyPropertiesFrom怎么用?C# Receipt.CopyPropertiesFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Receipt
的用法示例。
在下文中一共展示了Receipt.CopyPropertiesFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
btnSave.Focus();
var receipt = new Receipt();
var lstSavingReceiptItem = new List<ReceiptItem>();
if (!ReceiptItems.Any())
{
ShowError(Exception.UnselectedItem);
return;
}
UpdateReceiptValue();
if (IsLoaded)
receipt.CopyPropertiesFrom(Original_Receipt);
receipt.SubstitutionICMSBase = ucCurrFieldSubstituionICMSBase.CurrencyValue;
receipt.SubstitutionICMSValue = ucCurrFieldSubstituionICMSValue.CurrencyValue;
receipt.FreightValue = ucCurrFieldFreightValue.CurrencyValue;
receipt.InsuranceValue = ucCurrFieldInsuranceValue.CurrencyValue;
receipt.OthersChargesValue = ucCurrFieldOthersChargesValue.CurrencyValue;
if (!String.IsNullOrEmpty(lblReceiptValue.Text))
receipt.ReceiptValue = Convert.ToDecimal(lblReceiptValue.Text.Replace("_", ""));
receipt.CompanyId = Company.CompanyId;
if (Page.ViewState["customerId"] != null)
{
receipt.SupplierId = null;
receipt.CustomerId = Convert.ToInt32(Page.ViewState["customerId"]);
}
else
{
receipt.CustomerId = null;
receipt.SupplierId = Convert.ToInt32(Page.ViewState["SupplierId"]);
}
if (Page.ViewState["TransporterId"] != null)
receipt.TransporterId = Convert.ToInt32(Page.ViewState["TransporterId"]);
receipt.DeliveryDate = null;
receipt.EntryDate = null;
if (ucEntrydate.DateTime.HasValue)
receipt.EntryDate = ucEntrydate.DateTime;
else
receipt.DeliveryDate = ucDeliveryDate.DateTime;
if (ucIssueDate.DateTime.HasValue)
receipt.IssueDate = ucIssueDate.DateTime.Value;
receipt.CfopId = Convert.ToInt32(cboCFOP.SelectedValue);
receipt.ReceiptNumber = ucCurrFieldReceiptNumber.IntValue;
foreach (ReceiptItem item in ReceiptItems)
{
item.ReceiptId = receipt.ReceiptId;
lstSavingReceiptItem.Add(item);
}
try
{
///update ReceiptValue
ReceiptManager.SaveReceipt(Original_Receipt, receipt, lstSavingReceiptItem, LstServiceOrder, LstSale);
}
catch (InvalidOperationException)
{
ShowError(Exception.InvalidReceiptNumber);
return;
}
Server.Transfer("Receipts.aspx");
}