I am trying to trap the event when a user changes the sell price of an item. All I want to do is capture and display a box that say "Hey dummy, you are trying to change the sell price, do you really want to be doing that???" I am using VS C# and all works well with the exception I do not want this check to occur when the user is entering a new line on the order in the Line Scroll area. What can I use in my code as an indication that this is a new line?
Here is my current code:
/*Register a change event for the Unit Sell Price field of the Line Scroll window on the sales transaction entry window*/
sopEntryWindow.LineScroll.LocalUnitPrice.Change +=
new EventHandler(CheckForLineValueChanges);
/* Check for line value change of the field LocalUnitPrice */
public void CheckForLineValueChanges(object sender, EventArgs e)
{
sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=
new EventHandler(SellPriceChangeNotification);
}
/* Notify the user that the sell price has been changed and prompt for confirmation and reason */
public void SellPriceChangeNotification(object sender, EventArgs e)
{
if (SOPCheckSellPriceForm == null)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice();
}
else
{
if (SOPCheckSellPriceForm.Created == false)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);
}
}
/* Display notificaction that user has changed sell price */
SOPCheckSellPriceForm.Show();
SOPCheckSellPriceForm.Activate();
}
public void CheckForLineValueChanges(object sender, EventArgs e)
{
sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=
new EventHandler(SellPriceChangeNotification);
}
/* Notify the user that the sell price has been changed and prompt for confirmation and reason */
public void SellPriceChangeNotification(object sender, EventArgs e)
{
if (SOPCheckSellPriceForm == null)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice();
}
else
{
if (SOPCheckSellPriceForm.Created == false)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);
}
}
/* Display notificaction that user has changed sell price */
SOPCheckSellPriceForm.Show();
SOPCheckSellPriceForm.Activate();
}
public void CheckForLineValueChanges(object sender, EventArgs e)
{
sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=
new EventHandler(SellPriceChangeNotification);
}
/* Notify the user that the sell price has been changed and prompt for confirmation and reason */
public void SellPriceChangeNotification(object sender, EventArgs e)
{
if (SOPCheckSellPriceForm == null)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice();
}
else
{
if (SOPCheckSellPriceForm.Created == false)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);
}
}
/* Display notificaction that user has changed sell price */
SOPCheckSellPriceForm.Show();
SOPCheckSellPriceForm.Activate();
}
public void CheckForLineValueChanges(object sender, EventArgs e)
{
sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=
new EventHandler(SellPriceChangeNotification);
}
/* Notify the user that the sell price has been changed and prompt for confirmation and reason */
public void SellPriceChangeNotification(object sender, EventArgs e)
{
if (SOPCheckSellPriceForm == null)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice();
}
else
{
if (SOPCheckSellPriceForm.Created == false)
{
SOPCheckSellPriceForm =
new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);
}
}
/* Display notificaction that user has changed sell price */
SOPCheckSellPriceForm.Show();
SOPCheckSellPriceForm.Activate();
}