public void ModificarMercaderiaIntegral(csMercaderia m) { using (MySqlCommand cmd = new MySqlCommand()) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con.getConexion(); cmd.CommandText = "operar_Tabla"; cmd.Parameters.AddWithValue("tabla", "mercaderia"); cmd.Parameters.AddWithValue("parm", m.CodMercaderiaIntegral); cmd.Parameters.AddWithValue("t_accion", "M"); cmd.Parameters.AddWithValue("att", "MercaderiaIntegral"); cmd.Parameters.AddWithValue("cod", m.IdMercaderia); 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(); } } }
public DataTable ConsultarMercaderiaXNombre(csMercaderia m) { using (MySqlCommand cmd = new MySqlCommand()) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con.getConexion(); cmd.CommandText = "operar_Tabla"; cmd.Parameters.AddWithValue("tabla", "mercaderia"); cmd.Parameters.AddWithValue("parm", m.NomMercaderia); cmd.Parameters.AddWithValue("t_accion", "C"); cmd.Parameters.AddWithValue("att", "Nombre"); 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(); } } }