Guest User

Untitled

a guest
May 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. ALTER PROCEDURE [dbo].[spGiros_leer_cantidad_giros_pendientes]
  2. @idAgenciaDestino int,
  3. @cantGirosPendientes int output
  4.  
  5. AS
  6. BEGIN
  7.  
  8. SET NOCOUNT
  9.  
  10. set @cantGirosPendientes = (
  11. select count(*) from giros g
  12. where g.idagencia_destino = @idAgenciaDestino
  13. and g.idestado = 6)
  14. END
  15. return @cantGirosPendientes
  16.  
  17. public int LeerCantidadGirosPendientes(int? idAgenciaDestino)
  18. {
  19. DbTransaction transaccion = null;
  20. try
  21. {
  22. int? cantGirosPendientes = 0;
  23. cantGirosPendientes = context.spGiros_leer_cantidad_giros_pendientes(idAgenciaDestino, ref cantGirosPendientes);
  24. return Convert.ToInt32(cantGirosPendientes);
  25. }
  26. catch (Exception ex)
  27. {
  28. transaccion.Rollback();
  29. context.Connection.Close();
  30. log.Error("NegGiros.cs:LeerCantidadGirosPendientes", ex);
  31. throw ex;
  32. }
  33.  
  34. }
  35.  
  36. [global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.spGiros_leer_cantidad_giros_pendientes")]
  37. public int spGiros_leer_cantidad_giros_pendientes([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Int")] System.Nullable<int> idAgencia, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Int")] ref System.Nullable<int> cantGirosPendientes)
  38. {
  39. IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), idAgencia, cantGirosPendientes);
  40. cantGirosPendientes = ((System.Nullable<int>)(result.GetParameterValue(1)));
  41. return ((int)(result.ReturnValue));
  42. }
Add Comment
Please, Sign In to add comment