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


C# ReceiveDoc.SetPrice方法代码示例

本文整理汇总了C#中BLL.ReceiveDoc.SetPrice方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.SetPrice方法的具体用法?C# ReceiveDoc.SetPrice怎么用?C# ReceiveDoc.SetPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BLL.ReceiveDoc的用法示例。


在下文中一共展示了ReceiveDoc.SetPrice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnSave_Click

        private void btnSave_Click(object sender, EventArgs e)
        {
            GRV.SaveInsurance();
            GRV.SaveCostCoefficientAndTotalValue(CurrentContext.UserId);
               //ToDo: Remove this When it is safe and Ready for deployement.
            GRV.RecordAverageCostAndSellingPrice(CurrentContext.UserId);
            print();
            BLL.ReceiveDoc recDoc = new ReceiveDoc();
            recDoc.LoadByReceiptID(ReceiptID);
            BLL.Receipt receiptStatus = new BLL.Receipt();
            if (!BLL.Settings.UseReceiveCostConfirmation && PONumber.StartsWith("S2S-"))
            {
                if (SetFinalCost())
                {  recDoc.ConfirmGRVPrinted(CurrentContext.UserId);

                receiptStatus.LoadByPrimaryKey(ReceiptID);
                receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRV_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "StoreToStore Confirmed");
                }

            }
            else if (BLL.Settings.UseReceiveCostConfirmation)
            {
                recDoc.SetPrice(CurrentContext.UserId);
                receiptStatus.LoadByPrimaryKey(ReceiptID);
                receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.PRICE_CALCULATED, null,
                                           this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");
            }
            else
            {   recDoc.ConfirmPrice(CurrentContext.UserId);

                receiptStatus.LoadByPrimaryKey(ReceiptID);
                receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.PRICE_CONFIRMED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");
            }

            XtraMessageBox.Show("Received Cost and Margin Set successfully!", "Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);

            PutAwayListsLoad(null, null);
            this.LogActivity("Print-Cost-Analysis", ReceiptID);
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:39,代码来源:CostingForm.cs

示例2: btnSave_Click

        private void btnSave_Click(object sender, EventArgs e)
        {
            MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();

            var dt = grdDetailView.DataSource as DataView;
            if ((dt) != null)
            {

                // This is where we set the Price

                foreach (DataRow dr in dt.Table.Rows)
                {
                    var costElement = new CostElement();
                    costElement.LoadFromDataRow(dr, receipt.ID);
                    costElement.AverageCost =Math.Round(Convert.ToDouble(dr["AverageCost"]),BLL.Settings.NoOfDigitsAfterTheDecimalPoint,MidpointRounding.AwayFromZero);
                    costElement.Margin = Convert.ToDouble(dr["Margin"]);

                    costElement.SellingPrice = Math.Round(Convert.ToDouble(dr["SellingPrice"]), BLL.Settings.NoOfDigitsAfterTheDecimalPoint, MidpointRounding.AwayFromZero);
                    try
                    {
                        transaction.BeginTransaction();
                        var journalService = new JournalService();
                        journalService.StartRecordingSession();
                        costElement.SetPriceForReceiveDocs();
                        costElement.SavePrice(CurrentContext.UserId, costElement.ReceiptID.ToString(), journalService,
                                              ChangeMode.ErrorCorrection);
                        journalService.CommitRecordingSession();
                        transaction.CommitTransaction();

                    }
                    catch (Exception exception)
                    {
                        transaction.RollbackTransaction();
                        XtraMessageBox.Show("Error : " + exception.Message, "Error...", MessageBoxButtons.OK,
                                            MessageBoxIcon.Error);
                        throw exception;
                    }
                    var report = new PriceOverridePrintout
                                     {
                                         xrCostedBy = {Text = CurrentContext.LoggedInUserName},
                                         lblDate = {Text = DateTimeHelper.ServerDateTime.ToString()},
                                         DataSource = getPriceChangeReport(costElement)
                                     };
                    report.ShowPreviewDialog();

                }
                var recDoc = new ReceiveDoc();
                recDoc.LoadByReceiptID(receipt.ID);
                recDoc.SetPrice(CurrentContext.UserId);
                receipt.ChangeStatus(ReceiptConfirmationStatus.Constants.PRICE_CALCULATED, null,
                                     this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");

            }
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:54,代码来源:ErrorCorrectionPricing.cs


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