コード例 #1
0
        private void btnSaveDiscountVolume_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dgvDiscountVolume.Rows.Count; i++)
            {
                if (dgvDiscountVolume.Rows[i].IsNewRow)
                {
                    continue;
                }
                if (dgvDiscountVolume.Rows[i].Cells["Discount"].FormattedValue.ToString().Length == 0)
                {
                    LightMessageBox.Show(ref TopForm, false, "Поле \"Скидка\" должно быть заполнено", "Ошибка сохранения");
                    return;
                }
            }

            Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Сохранение данных.\r\nПодождите..."); });

            T.Start();
            while (!SplashWindow.bSmallCreated)
            {
                ;
            }

            try
            {
                DiscountsManager.SaveDiscountVolume();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                while (SplashWindow.bSmallCreated)
                {
                    SmallWaitForm.CloseS = true;
                }
                InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
            }
        }