public DataTable ConsultarXConcepto(csFactores f) { using (MySqlCommand cmd = new MySqlCommand()) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con.getConexion(); cmd.CommandText = "operar_Tabla"; cmd.Parameters.AddWithValue("tabla", "factores"); cmd.Parameters.AddWithValue("parm", f.Concepto); cmd.Parameters.AddWithValue("t_accion", "C"); cmd.Parameters.AddWithValue("att", "Tabla"); cmd.Parameters.AddWithValue("cod", -1); con.getConexion().Open(); DataTable dt = new DataTable(); MySqlDataAdapter da = new MySqlDataAdapter(cmd); da.Fill(dt); return(dt); } catch (Exception ex) { throw ex; } finally { con.getConexion().Close(); } } }
/*****************************ELIMINACION**************************/ public void EliminarFactores(csFactores f) { using (MySqlCommand cmd = new MySqlCommand()) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con.getConexion(); cmd.CommandText = "operar_Tabla"; cmd.Parameters.AddWithValue("tabla", "factores"); cmd.Parameters.AddWithValue("parm", f.Eliminado); cmd.Parameters.AddWithValue("t_accion", "E"); cmd.Parameters.AddWithValue("att", " "); cmd.Parameters.AddWithValue("cod", f.IdFactores); con.getConexion().Open(); e = cmd.ExecuteNonQuery(); if (e == 0) { MessageBox.Show("No se pudo realizar la Modificación, ERROR!"); } } catch (Exception ex) { throw ex; } finally { con.getConexion().Close(); } } }