Advertisement
daxruiz

Untitled

Jul 9th, 2023
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. public static TransaccionEn ConsultarEstadoCuentaXIdReciboImpresion(int _IdRecibo)
  2. {
  3. SqlConnection sqlConexion = new SqlConnection();
  4. TransaccionEn trans;
  5. ReciboImpresionEn recibo;
  6. try
  7. {
  8. sqlConexion.ConnectionString = AD.getConexionSql();
  9.  
  10. sqlConexion.Open();
  11. SqlCommand sqlCmd = sqlConexion.CreateCommand();
  12. sqlCmd.CommandText = "[MOVIL].[espConsultarReciboXIdImpresion]";
  13. sqlCmd.CommandType = CommandType.StoredProcedure;
  14. sqlCmd.Parameters.Add(AD.getParametroSql("@_IdRecibo", SqlDbType.Int, _IdRecibo));
  15.  
  16. trans = new TransaccionEn();
  17. SqlDataReader dtRea = sqlCmd.ExecuteReader();
  18.  
  19. recibo = new ReciboImpresionEn();
  20.  
  21. while (dtRea.Read())
  22. {
  23. recibo.CodigoContrato = dtRea.GetString(0);
  24. recibo.CodigoCliente = dtRea.GetString(1);
  25. recibo.Gestor = dtRea.GetString(2);
  26. recibo.CedulaGestor = dtRea.GetString(3);
  27. recibo.SaldoAnterior = dtRea.GetString(4);
  28. recibo.MonedaRecibida = dtRea.GetString(5);
  29. recibo.MontoRecibido = dtRea.GetString(6);
  30. recibo.FechaImpresion = dtRea.GetString(7);
  31. recibo.Saldo = dtRea.GetString(8);
  32. recibo.TasaRecibo = dtRea.GetString(9);
  33. recibo.NoRecibo = dtRea.GetString(10);
  34. recibo.MontoPendiente = dtRea.GetString(11);
  35. recibo.FechaSigPago = dtRea.GetString(12);
  36. recibo.Serie = dtRea.GetString(13);
  37. recibo.Cliente = dtRea.GetString(14);
  38. recibo.StatusId = dtRea.GetString(15);
  39. recibo.ContadorImpresiones = dtRea.GetString(16);
  40. recibo.Ruc = dtRea.GetString(17);
  41. recibo.Telefono = dtRea.GetString(18);
  42. recibo.Direccion = dtRea.GetString(19);
  43. recibo.AppName = dtRea.GetString(20);
  44.  
  45. }
  46.  
  47. List<string> ecs = new List<string>();
  48.  
  49. while (dtRea.Read())
  50. {
  51.  
  52. ecs.Add(dtRea.GetString(0));
  53.  
  54. }
  55.  
  56. recibo.estadoCuenta = string.Join(",", ecs);
  57.  
  58. dtRea.NextResult();
  59.  
  60.  
  61.  
  62. trans.ResultadoDevuelto = recibo;
  63. }
  64. catch (Exception ex)
  65. {
  66. trans = ErrorPg.RegistrarArchivo(new TransaccionEn("ConsultarEstadoCuentaXIdReciboImpresion", "AD.Recibos", ex.ToString()));
  67. }
  68. finally
  69. {
  70. if (sqlConexion.State == ConnectionState.Open)
  71. sqlConexion.Close();
  72. }
  73. return trans;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement