public static Documento_venta getDocumento_venta(int id) { try { Query query = new Query("select", "documento_venta"); query.AddWhere("ID", id.ToString()); query.AddSelect("*"); Documento_venta objeto = new Documento_venta(); DataSet dataset = FachadaDocumento_venta.getListado(query); int contador = 0; if (dataset != null) { foreach (DataRow fila in dataset.Tables[0].Rows) { objeto = new Documento_venta(fila); contador++; } } return(objeto); } catch (Exception ex) { Utils.EscribeLog(ex); return(null); } }
public static Documento_venta[] getListadoPorWhere(string where) { try { string[] arrString = where.Split('='); Query query = new Query("select", "documento_venta"); query.AddWhere(arrString[0], arrString[1]); query.AddSelect("*"); DataSet dataset = FachadaDocumento_venta.getListado(query); Documento_venta[] arrdocumento_venta = new Documento_venta[dataset.Tables[0].Rows.Count]; int contador = 0; if (dataset != null) { foreach (DataRow fila in dataset.Tables[0].Rows) { Documento_venta objeto = new Documento_venta(fila); arrdocumento_venta[contador] = objeto; contador++; } } return(arrdocumento_venta); } catch (Exception ex) { Utils.EscribeLog(ex); return(null); } }
public static Documento_venta[] getListado(Query query) { try { query.AddWhereExacto(ST_Documento_venta.estado_vigente, "vigente"); DataSet dataset = FachadaDocumento_venta.getListado(query); Documento_venta[] arrdocumento_venta = new Documento_venta[dataset.Tables[0].Rows.Count]; int contador = 0; if (dataset != null) { foreach (DataRow fila in dataset.Tables[0].Rows) { Documento_venta objeto = new Documento_venta(fila); arrdocumento_venta[contador] = objeto; contador++; } } return(arrdocumento_venta); } catch (Exception ex) { Utils.EscribeLog(ex); return(null); } }