Пример #1
0
        void EditStatsClick(object sender, EventArgs e)
        {
            MenuItem s  = (MenuItem)sender;
            int      nX = Convert.ToInt32(s.Name.Split(',')[0]);
            int      nY = Convert.ToInt32(s.Name.Split(',')[1]);
            string   sDBaseFieldName = sTopFNames[nX] + sSideFNames[nY];

            frmSingleInputBox fsiGetNewData = new frmSingleInputBox("Enter the new data (field " + sDBaseFieldName + "):", ref sEngine);

            fsiGetNewData.ShowDialog();
            if (fsiGetNewData.Response != "$NONE")
            {
                try
                {
                    Convert.ToDecimal(fsiGetNewData.Response);
                    sEngine.ChangeStockStaField(sBarcode, sDBaseFieldName, fsiGetNewData.Response, sShopCode);
                    ShowStatsAboutProduct();
                }
                catch
                {
                    MessageBox.Show("Invalid data entered. The record has not had its data changed.");
                }
            }
        }