private void btnSaveDiscountOrderSum_Click(object sender, EventArgs e) { for (int i = 0; i < dgvDiscountOrderSum.Rows.Count; i++) { if (dgvDiscountOrderSum.Rows[i].IsNewRow) { continue; } if (dgvDiscountOrderSum.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.SaveDiscountOrderSum(); } catch (Exception) { throw; } finally { while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700); } }