本文整理汇总了C#中BLL.ReceiveDoc.ConfirmMovingAverage方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.ConfirmMovingAverage方法的具体用法?C# ReceiveDoc.ConfirmMovingAverage怎么用?C# ReceiveDoc.ConfirmMovingAverage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.ConfirmMovingAverage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}