void mEditLastCost_Click(object sender, EventArgs e) { decimal dLastCost = Convert.ToDecimal(sEngine.GetMainStockInfo(sBarcode)[8]); frmSingleInputBox fsiGetLastCost = new frmSingleInputBox("Enter the last cost :", ref sEngine); fsiGetLastCost.tbResponse.Text = FormatMoneyForDisplay(dLastCost); fsiGetLastCost.ShowDialog(); if (fsiGetLastCost.Response != "$NONE") { bool bOk = false; try { Convert.ToDecimal(fsiGetLastCost.Response); bOk = true; } catch {; } if (bOk) { sEngine.ChangeLastCostOfItem(sBarcode, Convert.ToDecimal(fsiGetLastCost.Response)); ShowStatsAboutProduct(); } } }