public static DataTable Consultar(MaterialLogica mate) { DataTable datos = new DataTable(); try { datos = AccesoDatos.Consultar("SELECT * FROM t_materiales WHERE material = '" + mate.Material + "'"); } catch (Exception ex) { throw ex; } return(datos); }
public static bool Eliminar(MaterialLogica mate) { try { string sQuery = "DELETE FROM t_materiales WHERE material = '" + mate.Material + "'"; if (AccesoDatos.Borrar(sQuery) != 0) { return(true); } else { return(false); } } catch { return(false); } }
public static bool Verificar(MaterialLogica mate) { try { string sQuery; sQuery = "SELECT * FROM t_materiales WHERE material = '" + mate.Material + "'"; DataTable datos = AccesoDatos.Consultar(sQuery); if (datos.Rows.Count != 0) { return(true); } else { return(false); } } catch { return(false); } }
public static int Guardar(MaterialLogica mate) { string[] parametros = { "@Material", "@Nombre", "@Estandar", "@Usuario" }; return(AccesoDatos.Actualizar("sp_mant_materiales", parametros, mate.Material, mate.Nombre, mate.Estandar, mate.Usuario)); }