예제 #1
0
 //Удаление выбранной группы услуг
 private void delGroupBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (groupsTable.Rows.Count == 0)
         {
             MessageBox.Show("Нет записей для удаления!");
             return;
         }
         DialogResult result = MessageBox.Show("Подтвердите удаление.", "Удаление", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); //диалоговое окно
         if (result == DialogResult.OK)
         {
             DBConnection.DeleteServiceGroup(serviceGroupID);
             DBConnection.GetServicesGroups();
             groupsTable.DataSource = DBConnection.dtServicesGroups;
             if (DBConnection.dtServicesGroups.Rows.Count > 0)
             {
                 ReadGroupsTableRow(0);
             }
         }
     }
     catch (Exception ex)
     {
         exceptPanel.Visible = true;
         richTextBox1.Text   = ex.ToString();
     }
 }