private void btnStopAudit_Click(object sender, EventArgs e) { ActiveAudit.Clear(); ((System.Windows.Forms.StatusStrip) (((MainForm)this.ParentForm).Controls["stsMainStrip"])) .Items[0].Text = "Активного аудита нет"; }
private void grdSelectAudit_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e) {//Удаление аудита if (Convert.ToInt32(grdSelectAudit.SelectedRows[0].Cells[0].Value) == ActiveAudit.ID) { e.Cancel = true; MessageBox.Show("Активный аудит удалить нельзя"); return; } if (MessageBox.Show("Удалить аудит компании " + grdSelectAudit.SelectedRows[0].Cells[2].Value.ToString() + "\r\n от " + grdSelectAudit.SelectedRows[0].Cells[5].Value.ToString() + "?", "Удаление аудита", MessageBoxButtons.YesNo) == DialogResult.Yes) { auditAdapter.DeleteQuery((Convert.ToInt32(grdSelectAudit.SelectedRows[0].Cells[0].Value))); if (auditAdapter.GetData().Rows.Count == 0) { ActiveAudit.Clear(); ((System.Windows.Forms.StatusStrip) (((MainForm)this.ParentForm).Controls["stsMainStrip"])) .Items[0].Text = "Активного аудита нет"; } } else { e.Cancel = true; } }