Beispiel #1
0
        private void btn_eliminar_Click(object sender, EventArgs e)
        {
            DataRow fila      = dgv_tareas.GetFocusedDataRow();
            string  eliminada = fila[6].ToString();

            OpBD o   = new OpBD();
            int  res = o.EliminarTarea(eliminada, titulo);

            if (res == 1)
            {
                DataTable dt_tareasneg = OpBD.SeleccionarTareasNEG(id_negocio);
                if (dt_tareasneg != null)
                {
                    gridControl_tareas.DataSource = dt_tareasneg;
                    dgv_tareas.Columns[0].Caption = "Descripción";
                    dgv_tareas.Columns[1].Caption = "Fecha";
                    dgv_tareas.Columns[2].Caption = "Tipo";
                    dgv_tareas.Columns[3].Caption = "Empleado";
                    dgv_tareas.Columns[4].Caption = "Estado";
                    dgv_tareas.Columns[5].Caption = "Criticidad";
                    dgv_tareas.Columns[6].Visible = false;
                }
                MessageBox.Show("Eliminacion exitosa");
            }
            else
            {
                MessageBox.Show("No se elimino");
            }
        }