当前位置: 首页>>代码示例>>C#>>正文


C# Receipt.CopyPropertiesFrom方法代码示例

本文整理汇总了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");
    }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:75,代码来源:Receipt.aspx.cs


注:本文中的Receipt.CopyPropertiesFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。