本文整理汇总了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);
}
示例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");
}
}