Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static TransaccionEn ConsultarEstadoCuentaXIdReciboImpresion(int _IdRecibo)
- {
- SqlConnection sqlConexion = new SqlConnection();
- TransaccionEn trans;
- ReciboImpresionEn recibo;
- try
- {
- sqlConexion.ConnectionString = AD.getConexionSql();
- sqlConexion.Open();
- SqlCommand sqlCmd = sqlConexion.CreateCommand();
- sqlCmd.CommandText = "[MOVIL].[espConsultarReciboXIdImpresion]";
- sqlCmd.CommandType = CommandType.StoredProcedure;
- sqlCmd.Parameters.Add(AD.getParametroSql("@_IdRecibo", SqlDbType.Int, _IdRecibo));
- trans = new TransaccionEn();
- SqlDataReader dtRea = sqlCmd.ExecuteReader();
- recibo = new ReciboImpresionEn();
- while (dtRea.Read())
- {
- recibo.CodigoContrato = dtRea.GetString(0);
- recibo.CodigoCliente = dtRea.GetString(1);
- recibo.Gestor = dtRea.GetString(2);
- recibo.CedulaGestor = dtRea.GetString(3);
- recibo.SaldoAnterior = dtRea.GetString(4);
- recibo.MonedaRecibida = dtRea.GetString(5);
- recibo.MontoRecibido = dtRea.GetString(6);
- recibo.FechaImpresion = dtRea.GetString(7);
- recibo.Saldo = dtRea.GetString(8);
- recibo.TasaRecibo = dtRea.GetString(9);
- recibo.NoRecibo = dtRea.GetString(10);
- recibo.MontoPendiente = dtRea.GetString(11);
- recibo.FechaSigPago = dtRea.GetString(12);
- recibo.Serie = dtRea.GetString(13);
- recibo.Cliente = dtRea.GetString(14);
- recibo.StatusId = dtRea.GetString(15);
- recibo.ContadorImpresiones = dtRea.GetString(16);
- recibo.Ruc = dtRea.GetString(17);
- recibo.Telefono = dtRea.GetString(18);
- recibo.Direccion = dtRea.GetString(19);
- recibo.AppName = dtRea.GetString(20);
- }
- List<string> ecs = new List<string>();
- while (dtRea.Read())
- {
- ecs.Add(dtRea.GetString(0));
- }
- recibo.estadoCuenta = string.Join(",", ecs);
- dtRea.NextResult();
- trans.ResultadoDevuelto = recibo;
- }
- catch (Exception ex)
- {
- trans = ErrorPg.RegistrarArchivo(new TransaccionEn("ConsultarEstadoCuentaXIdReciboImpresion", "AD.Recibos", ex.ToString()));
- }
- finally
- {
- if (sqlConexion.State == ConnectionState.Open)
- sqlConexion.Close();
- }
- return trans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement