public static DataSet BuscarSuministro(string Busqueda) { string Sentencia = "SELECT * FROM Suministros WHERE "; Sentencia += "(Descripcion LIKE '%" + Busqueda + "%') "; Sentencia += "ORDER BY Descripcion"; return(AyudanteMSSql.EjecutarDataSet(ConfigurationSettings.AppSettings["ConexionApoyo"], System.Data.CommandType.Text, Sentencia)); }
public static DataSet ObtenerChequesOP(string Orden) { string Sentencia = "select c.denom_banc, b.che_cta, a.che_nro, a.monto, b.che_fecha "; Sentencia += "from det_op_cheques a, Cheques b, bancos c "; Sentencia += "where (a.codigo_orden = '" + Orden + "') and (a.che_nro = b.che_nro) and (b.che_accion = 'CHEQUE EMITIDO') and (b.che_cod_bco = c.cod_banco) "; Sentencia += "ORDER BY c.denom_banc, b.che_cta, a.che_nro"; return(AyudanteMSSql.EjecutarDataSet(ConfigurationSettings.AppSettings["ConexionApoyo"], System.Data.CommandType.Text, Sentencia)); }
public static DataSet ObtenerBeneficiariosOP(string Beneficiario) { string Sentencia = "SELECT * FROM Orden_Pago WHERE "; Sentencia += "((Cod_Benef = '" + Regex.Replace(Beneficiario, "'", "''") + "') "; Sentencia += "AND (Indi_anulacion = '0')) "; Sentencia += "ORDER BY Nro_Orden DESC"; return(AyudanteMSSql.EjecutarDataSet(ConfigurationSettings.AppSettings["ConexionApoyo"], System.Data.CommandType.Text, Sentencia)); }
public static DataSet EjecucionObras(string Presupuesto, string Fecha) { string Sentencia = "select Obras_E.NRO_DET, Obras_E.COD_OBRA, Obras_E.DENOM, Obras_E.mont_ppt as Asignado, "; Sentencia += "(Select sum(Det_Modif.Monto) from Det_Modif where "; Sentencia += "(Obras_E.NRO_DET = Det_Modif.NRO_DET) and (Obras_E.COD_OBRA = Det_Modif.OBRA) and (Det_Modif.ANO_PPTO = Obras_E.ANO_PPTO) and (Det_Modif.Tipo_aux <> 'RI') and (Det_Modif.Indi_Anulacion = '0') and (Det_Modif.Fecha_aux <= '" + Regex.Replace(Fecha, "'", "''") + "')) as Modificado,"; Sentencia += "(Select sum(Det_Modif.Monto) from Det_Modif where "; Sentencia += "(Obras_E.NRO_DET = Det_Modif.NRO_DET) and (Obras_E.COD_OBRA = Det_Modif.OBRA) and (Det_Modif.ANO_PPTO = Obras_E.ANO_PPTO) and (Det_Modif.Tipo_aux = 'RI') and (Det_Modif.Indi_Anulacion = '0') and (Det_Modif.Fecha_aux <= '" + Regex.Replace(Fecha, "'", "''") + "')) as Reintegro,"; Sentencia += "(Select sum(Det_Comp.Monto_Comp) from Det_Comp where "; Sentencia += "(Obras_E.NRO_DET = Det_Comp.NRO_DET) and (Obras_E.COD_OBRA = Det_Comp.COD_OBRA) and (Det_Comp.ANO_PPTO = Obras_E.ANO_PPTO) and (Det_Comp.Indi_Anulacion = '0') and (Det_Comp.Fecha_aux <= '" + Regex.Replace(Fecha, "'", "''") + "')) as Comprometido,"; Sentencia += "(Select sum(Det_Caus.Monto) from Det_Caus where "; Sentencia += "(Obras_E.NRO_DET = Det_Caus.NRO_DET) and (Obras_E.COD_OBRA = Det_Caus.COD_OBRA) and (Det_Caus.ANO_PPTO = Obras_E.ANO_PPTO) and (Det_Caus.Indi_Anulacion = '0') and (Det_Caus.Fecha_aux <= '" + Regex.Replace(Fecha, "'", "''") + "')) as Causado,"; Sentencia += "(Select sum(Det_Pago.Monto_Pord) from Det_Pago where "; Sentencia += "(Obras_E.NRO_DET = Det_Pago.NRO_DET) and (Obras_E.COD_OBRA = Det_Pago.COD_OBRA) and (Det_Pago.ANO_PPTO = Obras_E.ANO_PPTO) and (Det_Pago.Indi_Anulacion = '0') and (Det_Pago.Fecha_aux <= '" + Regex.Replace(Fecha, "'", "''") + "')) as Pagado "; Sentencia += "from Obras_E "; Sentencia += "where (Obras_E.ANO_PPTO = '" + Regex.Replace(Presupuesto, "'", "''") + "') "; Sentencia += "group by Obras_E.NRO_DET, Obras_E.COD_OBRA, Obras_E.DENOM with rollup "; Sentencia += "order by Obras_E.NRO_DET, Obras_E.COD_OBRA "; return(AyudanteMSSql.EjecutarDataSet(ConfigurationSettings.AppSettings["ConexionApoyo"], System.Data.CommandType.Text, Sentencia)); }
public static DataSet ObtenerPartidas() { string Sentencia = "SELECT cod_ing, descripcion FROM Ingresos ORDER BY descripcion"; return(AyudanteMSSql.EjecutarDataSet(ConfigurationSettings.AppSettings["ConexionApoyo"], System.Data.CommandType.Text, Sentencia)); }
public static DataSet ObtenerCuentas() { string Sentencia = "SELECT bcocta_numero FROM Bancos_Ctas WHERE bcocta_tipo = '3' ORDER BY bcocta_numero"; return(AyudanteMSSql.EjecutarDataSet(ConfigurationSettings.AppSettings["ConexionApoyo"], System.Data.CommandType.Text, Sentencia)); }
public static DataSet ObtenerProveedores() { string Sentencia = "SELECT Nombre FROM Benef WHERE TIPO = 'PR' ORDER BY Nombre"; return(AyudanteMSSql.EjecutarDataSet(ConfigurationSettings.AppSettings["ConexionApoyo"], System.Data.CommandType.Text, Sentencia)); }