本文整理汇总了C#中BLL.ReceiveDoc.SavePrice方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.SavePrice方法的具体用法?C# ReceiveDoc.SavePrice怎么用?C# ReceiveDoc.SavePrice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.SavePrice方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSetNewPrice_Click
private void btnSetNewPrice_Click(object sender, EventArgs e)
{
bool validated = false;
ReceiveDoc rd = new ReceiveDoc();
validated = dxValidationProviderPrice.Validate();
if (!validated)
{
XtraMessageBox.Show("Please fill in all required fields!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (!isConfirmation)
{
if (XtraMessageBox.Show("Are u sure, you want to save the new price change?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
{
MyGeneration.dOOdads.TransactionMgr transactionMgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
transactionMgr.BeginTransaction();
try
{
rs.NewUnitCost = Convert.ToDouble(txtAverageCost.EditValue);
rs.Margin = Convert.ToDouble(txtMargin.EditValue);
rs.NewSellingPrice = Convert.ToDouble(txtSellingPrice.EditValue);
rs.NewPrice = rs.NewSellingPrice;
//rs.Remark = txtRemark.EditValue.ToString();
// set the item as weighted average item
Item itm = new Item();
itm.LoadByPrimaryKey(rs.ItemID);
itm.IsFree = false;
itm.Save();
rd.SavePrice(rs, CurrentContext.UserId);
transactionMgr.CommitTransaction();
XtraMessageBox.Show("Price setting successful", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
transactionMgr.RollbackTransaction();
XtraMessageBox.Show("Price setting failed", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
throw ex;
}
}
}
else
{
if (XtraMessageBox.Show("Are you sure you want to approve the new price change.", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
{
rd.ConfirmMovingAverage(rs, CurrentContext.UserId);
XtraMessageBox.Show("Price setting successful", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
ResetForm();
}
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:59,代码来源:PriceSettingsHubConfirmation.cs
示例2: btnSave_Click
private void btnSave_Click(object sender, EventArgs e)
{
ReceiveDoc rd = new ReceiveDoc();
if (!confirmation)
{
rs.NewUnitCost = Convert.ToDouble(txtAverageCost.EditValue);
rs.Margin = Convert.ToDouble(txtMargin.EditValue);
rs.NewSellingPrice = Convert.ToDouble(txtSellingPrice.EditValue);
rs.NewPrice = rs.NewSellingPrice;
// set the item as weighted average item
Item itm = new Item();
itm.LoadByPrimaryKey(ItemID);
itm.IsFree = false;
itm.Save();
rd.SavePrice(rs, CurrentContext.UserId);
//if (!StoreType.IsFreeStore(StoreID))
//{
// //Change the cost
// rs.NewCost = rs.NewUnitCost;
// rd.SaveNewCost(rs, NewMainWindow.UserId);
//}
//-----------
XtraMessageBox.Show("New Price setting has been saved.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
rd.ConfirmMovingAverage(rs, CurrentContext.UserId);
}
this.Close();
}
示例3: btnConfirm_Click
private void btnConfirm_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 = Convert.ToDouble(dr["AverageCost"]);
costElement.Margin = Convert.ToDouble(dr["Margin"]);
costElement.SellingPrice = Convert.ToDouble(dr["SellingPrice"]);
try
{
transaction.BeginTransaction();
var journalService = new JournalService();
journalService.StartRecordingSession();
costElement.ConfirmPrice(CurrentContext.UserId, "", journalService, ChangeMode.PriceOverride);
var receiveDoc = new ReceiveDoc();
receiveDoc.SavePrice(costElement, CurrentContext.UserId);
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.ConfirmGRVPrinted(CurrentContext.UserId);
receipt.ChangeStatus(ReceiptConfirmationStatus.Constants.GRV_PRINTED, null,
this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");
}
}
示例4: btnMovingAverage_Click
private void btnMovingAverage_Click(object sender, EventArgs e)
{
MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
var dialogResult =
XtraMessageBox.Show(
String.Format("Are you Sure you want to Set the Price for {0}", txtItemName.Text),
"Are you sure", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (dialogResult == DialogResult.Cancel)
{
return;
}
if (dialogResult == DialogResult.Yes)
{
try
{
transaction.BeginTransaction();
// This is where we set the Price
JournalService journalService = new JournalService();
journalService.StartRecordingSession();
costElement.SavePrice(CurrentContext.UserId, "", journalService, ChangeMode.BeginningBalance);
journalService.CommitRecordingSession();
journalService.StartRecordingSession();
costElement.ConfirmPrice(CurrentContext.UserId, "", journalService, ChangeMode.BeginningBalance);
journalService.CommitRecordingSession();
ReceiveDoc receiveDoc = new ReceiveDoc();
receiveDoc.SavePrice(costElement, CurrentContext.UserId);
ReceiveDocConfirmation receiveDocConfirmation = new ReceiveDocConfirmation();
receiveDocConfirmation.ChangeStatusByAccountReceiveDocs(receiveDocs, ReceiptConfirmationStatus.Constants.GRV_PRINTED, ReceiptConfirmationStatus.Constants.PRICE_CALCULATED);
transaction.CommitTransaction();
this.Close();
}
catch (Exception exception)
{
transaction.RollbackTransaction();
XtraMessageBox.Show("Error : " + exception.Message, "Error...", MessageBoxButtons.OK,
MessageBoxIcon.Error);
throw exception;
}
}
}
示例5: btnSave_Click
private void btnSave_Click(object sender, EventArgs e)
{
MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
DataView dtChangedPricelist = gridViewPriceList.DataSource as DataView;
if (dtChangedPricelist != null)
{
dtChangedPricelist.RowFilter = "IsConfirmed = 1";
foreach (DataRowView drw in dtChangedPricelist)
{
var dialogResult =
XtraMessageBox.Show(
String.Format("Are you Sure you want to Change Price for {0}", drw["ItemName"]),
"Are you sure", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (dialogResult == DialogResult.Cancel)
{
return;
}
if (dialogResult == DialogResult.Yes)
{
try
{
transaction.BeginTransaction();
// This is where we set the Price
JournalService journalService = new JournalService();
journalService.StartRecordingSession();
CostElement costElement = new CostElement(Convert.ToInt32(drw["ItemID"])
, Convert.ToInt32(drw["MovingAverageGroupID"])
, Convert.ToInt32(drw["ManufacturerID"])
, Convert.ToInt32(drw["UnitID"]));
costElement.AverageCost = Math.Round(Convert.ToDouble(drw["UnitCost"]),
BLL.Settings.NoOfDigitsAfterTheDecimalPoint,
MidpointRounding.AwayFromZero);
costElement.Margin = Math.Round(Convert.ToDouble(drw["Margin"]),
BLL.Settings.NoOfDigitsAfterTheDecimalPoint+2,
MidpointRounding.AwayFromZero);
costElement.SellingPrice = Math.Round(Convert.ToDouble(drw["SellingPrice"]),
BLL.Settings.NoOfDigitsAfterTheDecimalPoint,
MidpointRounding.AwayFromZero);
costElement.ConfirmPrice(CurrentContext.UserId,"", journalService,ChangeMode.PriceOverride);
ReceiveDoc receiveDoc = new ReceiveDoc();
receiveDoc.SavePrice(costElement, CurrentContext.UserId);
journalService.CommitRecordingSession();
transaction.CommitTransaction();
}
catch (Exception exception)
{
transaction.RollbackTransaction();
XtraMessageBox.Show("Error : " + exception.Message, "Error...", MessageBoxButtons.OK,
MessageBoxIcon.Error);
throw exception;
}
}
}
BindDataSet();
XtraMessageBox.Show("Change was Successfull", "Success...", MessageBoxButtons.OK,
MessageBoxIcon.Information);
return;
}
XtraMessageBox.Show("No Changes have been made", "No Changes...", MessageBoxButtons.OK, MessageBoxIcon.Error);
}