Пример #1
0
        public Task <ResponseControl> ObtenerFormaPago(int idBanco, string idProceso)
        {
            List <OracleParameter>   parameters    = new List <OracleParameter>();
            ResponseControl          Response      = new ResponseControl(ResponseControl.Status.Ok);
            List <ListaConciliacion> ListFormaPago = new List <ListaConciliacion>();
            ListaConciliacion        conciliacion;

            try
            {
                parameters.Add(new OracleParameter("P_SIDPROCESS", OracleDbType.Varchar2, idProceso, ParameterDirection.Input));
                parameters.Add(new OracleParameter("P_NIDBANK", OracleDbType.Int16, idBanco, ParameterDirection.Input));

                var pCode     = new OracleParameter("P_NCODE", OracleDbType.Int16, ParameterDirection.Output);
                var p_Message = new OracleParameter("P_SMESSAGE", OracleDbType.NVarchar2, ParameterDirection.Output);
                var table     = new OracleParameter("C_TABLE", OracleDbType.RefCursor, ParameterDirection.Output);
                p_Message.Size = 2500;
                table.Size     = 4000;
                parameters.Add(pCode);
                parameters.Add(p_Message);
                parameters.Add(table);
                //_connectionBase.ExecuteByStoredProcedure("PKG_SCTR_COBRANZAS.SPS_GENERA_PLANILLA_DOCUMENTO", parameters, ConnectionBase.enuTypeDataBase.OracleConciliacion);
                using (OracleDataReader dr = (OracleDataReader)_connectionBase.ExecuteByStoredProcedure("PKG_SCTR_COBRANZAS.SPS_PLANILLA_AUTOMATICA", parameters, ConnectionBase.enuTypeDataBase.OracleConciliacion))
                {
                    while (dr.Read())
                    {
                        conciliacion = new ListaConciliacion
                        {
                            IdMoneda        = (dr["NIDCURRENCY"] != null ? dr["NIDCURRENCY"].ToString() : string.Empty),
                            IdTipoPago      = (dr["NIDPAIDTYPE"] != null ? dr["NIDPAIDTYPE"].ToString() : string.Empty),
                            IdCuentaBanco   = (dr["NIDACCOUNTBANK"] != null ? dr["NIDACCOUNTBANK"].ToString() : string.Empty),
                            IdBanco         = (dr["NIDBANK"] != null ? dr["NIDBANK"].ToString() : string.Empty),
                            NumeroOperacion = (dr["SOPERATION_NUMBER"] != null ? dr["SOPERATION_NUMBER"].ToString() : string.Empty),
                            FechaOperacion  = (dr["DOPERATION_DATE"] != null ? dr["DOPERATION_DATE"].ToString() : string.Empty),
                            Referencia      = (dr["SREFERENCE"] != null ? dr["SREFERENCE"].ToString() : string.Empty),
                            MontoFormaPago  = (dr["NAMOUNT"] != null ? dr["NAMOUNT"].ToString() : string.Empty),
                        };
                        ListFormaPago.Add(conciliacion);
                    }
                    Response.Data    = ListFormaPago;
                    Response.message = p_Message.Value.ToString();
                    if (!(pCode.Value.ToString() == "0"))
                    {
                        Response.Code = pCode.Value.ToString();
                        throw new Exception(p_Message.Value.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(Task.FromResult <ResponseControl>(Response));
        }
Пример #2
0
        public Task <ResponseControl> Validar_Planilla_Factura(ListaConciliacion listaConciliacions)
        {
            ResponseControl response = new ResponseControl(ResponseControl.Status.Ok);

            try
            {
                List <OracleParameter> parameters = new List <OracleParameter>();
                parameters.Add(new OracleParameter("P_SIDPROCESS", OracleDbType.Varchar2, listaConciliacions.IdProceso ?? string.Empty, ParameterDirection.Input));
                var nnoBills = new OracleParameter("P_NNOBILLS", OracleDbType.Int16, ParameterDirection.Output);
                parameters.Add(nnoBills);
                _connectionBase.ExecuteByStoredProcedure("PKG_SCTR_COBRANZAS.SPS_VALIDA_PLANILLA", parameters, ConnectionBase.enuTypeDataBase.OracleConciliacion);
                response.Data = nnoBills.Value.ToString() == "1" ? true : false;
            }
            catch (Exception ex)
            {
                response.message = ex.Message;
                response.Code    = "1";
            }
            return(Task.FromResult <ResponseControl>(response));
        }