public Task <string> RegistrarComprobantePendiente(DetallePlanillaCobro planillaCertificado)
        {
            string _sMessage = string.Empty;

            List <OracleParameter> parameters = new List <OracleParameter>();

            parameters.Add(new OracleParameter("P_NIDPAYROLL", OracleDbType.Int32, planillaCertificado.IdPlanilla, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NBRANCH", OracleDbType.Int32, planillaCertificado.IdRamo, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NPRODUCT", OracleDbType.Int32, 10, planillaCertificado.IdProducto, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NPOLICY", OracleDbType.Int32, 255, planillaCertificado.VcNumeropoliza, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NCERTIF", OracleDbType.Int32, planillaCertificado.VcNumerocertificado, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_IND_BILLS", OracleDbType.Int32, planillaCertificado.IndicaComprobante, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_IND_COMMISSION", OracleDbType.Int32, planillaCertificado.IndicaComision, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NSTATE", OracleDbType.Int32, planillaCertificado.IddgEstadoDetPlanilla, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NUSERREGISTER", OracleDbType.NVarchar2, planillaCertificado.VcUsuariocreacion, ParameterDirection.Input)); //Modificado 16/07/2018
            parameters.Add(new OracleParameter("P_NRECEIPT", OracleDbType.Int64, planillaCertificado.IdProforma, ParameterDirection.Input));                 //Proyecto Kuntur

            //ParĂ¡metro de Salida
            var pResult = new OracleParameter("P_MESSAGE", OracleDbType.Varchar2, 32767, OracleDbType.Int32, ParameterDirection.Output);

            parameters.Add(pResult);

            _connectionBase.ExecuteByStoredProcedure("INSUDB.CCL_INSGENERATION_BILLS", parameters, ConnectionBase.enuTypeDataBase.OracleVTime);
            _sMessage = pResult.Value.ToString() == null ? String.Empty : pResult.Value.ToString();

            return(Task.FromResult <string>(_sMessage));
        }
        public Task <List <DetallePlanillaCobro> > ListarPlanillasConciliadas(DatosNotificacion datosNotificacion)
        {
            DetallePlanillaCobro        detallePlanillaCobroEntity = null;
            List <DetallePlanillaCobro> detallePlanillaCobroList   = new List <DetallePlanillaCobro>();

            List <OracleParameter> parameters = new List <OracleParameter>();

            parameters.Add(new OracleParameter("INDPLANILLA", OracleDbType.Int32, datosNotificacion.IndPlanilla, ParameterDirection.Input));
            parameters.Add(new OracleParameter("ID_PLANILLA", OracleDbType.NVarchar2, datosNotificacion.Planilla, ParameterDirection.Input));
            parameters.Add(new OracleParameter("RC1", OracleDbType.RefCursor, ParameterDirection.Output));

            using (OracleDataReader dr = (OracleDataReader)_connectionBase.ExecuteByStoredProcedure("CONCILIACION.CCLPROCLIQUIDACION.CCLREAPLANILLALIQUIDADA", parameters, ConnectionBase.enuTypeDataBase.OracleConciliacion))
            {
                while (dr.Read())
                {
                    detallePlanillaCobroEntity = new DetallePlanillaCobro();

                    if (dr["ID_PLANILLA"] != null && dr["ID_PLANILLA"].ToString() != "")
                    {
                        detallePlanillaCobroEntity.IdPlanilla = Convert.ToInt32(dr["ID_PLANILLA"]);
                    }

                    if (dr["ID_RAMO"] != null && dr["ID_RAMO"].ToString() != "")
                    {
                        detallePlanillaCobroEntity.IdRamo = Convert.ToInt32(dr["ID_RAMO"]);
                    }

                    if (dr["ID_PRODUCTO"] != null && dr["ID_PRODUCTO"].ToString() != "")
                    {
                        detallePlanillaCobroEntity.IdProducto = Convert.ToInt32(dr["ID_PRODUCTO"]);
                    }

                    if (dr["VC_NUMERO_POLIZA"] != null && dr["VC_NUMERO_POLIZA"].ToString() != "")
                    {
                        detallePlanillaCobroEntity.VcNumeropoliza = Convert.ToInt64(dr["VC_NUMERO_POLIZA"]);
                    }

                    if (dr["VC_NUMERO_CERTIFICADO"] != null && dr["VC_NUMERO_CERTIFICADO"].ToString() != "")
                    {
                        detallePlanillaCobroEntity.VcNumerocertificado = Convert.ToInt64(dr["VC_NUMERO_CERTIFICADO"]);
                    }
                    if (dr["ID_PROFORMA"] != null && dr["ID_PROFORMA"].ToString() != "")
                    {
                        detallePlanillaCobroEntity.IdProforma = Convert.ToInt64(dr["ID_PROFORMA"]);
                    }



                    detallePlanillaCobroEntity.VcUsuariocreacion = datosNotificacion.Usuario.ToString(); //Agregado 16/07/2018

                    detallePlanillaCobroList.Add(detallePlanillaCobroEntity);
                }
            }

            return(Task.FromResult <List <DetallePlanillaCobro> >(detallePlanillaCobroList));
        }
        public Task <string> ValidarExisteContratante(DetallePlanillaCobro planillaCertificado)
        {
            string _sExists = string.Empty;

            List <OracleParameter> parameters = new List <OracleParameter>();

            parameters.Add(new OracleParameter("P_NBRANCH", OracleDbType.Int32, planillaCertificado.IdRamo, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NPRODUCT", OracleDbType.NVarchar2, planillaCertificado.IdProducto, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NPOLICY", OracleDbType.NVarchar2, planillaCertificado.VcNumeropoliza, ParameterDirection.Input));
            parameters.Add(new OracleParameter("P_NCERTIF", OracleDbType.NVarchar2, planillaCertificado.VcNumerocertificado, ParameterDirection.Input));
            //ParĂ¡metro de Salida
            var pResult = new OracleParameter("P_EXISTS", OracleDbType.Int32, 32767, OracleDbType.Int32, ParameterDirection.Output);

            parameters.Add(pResult);

            _connectionBase.ExecuteByStoredProcedure("INSUDB.CCL_VALCLIENT", parameters, ConnectionBase.enuTypeDataBase.OracleVTime);
            _sExists = pResult.Value.ToString() == null ? String.Empty : pResult.Value.ToString();

            return(Task.FromResult <string>(_sExists));
        }
        public void ObtenerDetallePlanillaCobro(ref List <Planilla> planillaList)
        {
            string _sMessage = string.Empty;

            List <OracleParameter>      parameters = null;
            DetallePlanillaCobro        detallePlanillaCobroEntity = null;
            List <DetallePlanillaCobro> detallePlanillaCobroList   = null;

            foreach (Planilla p in planillaList)
            {
                parameters = new List <OracleParameter>();
                detallePlanillaCobroList = new List <DetallePlanillaCobro>();

                parameters.Add(new OracleParameter("NIDPAYROLL", OracleDbType.Int32, p.IdPlanilla, ParameterDirection.Input));
                parameters.Add(new OracleParameter("RC1", OracleDbType.RefCursor, ParameterDirection.Output));

                using (OracleDataReader dr = (OracleDataReader)_connectionBase.ExecuteByStoredProcedure("INSUDB.INSPROCIMPORTACION.INSREAPV_PAYROLL_DETAIL", parameters, ConnectionBase.enuTypeDataBase.OracleVTime))
                {
                    while (dr.Read())
                    {
                        detallePlanillaCobroEntity = new DetallePlanillaCobro();

                        if (dr["NIDPAYROLLDETAIL"] != null && dr["NIDPAYROLLDETAIL"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.IdDetallePlanillaCobro = Convert.ToInt32(dr["NIDPAYROLLDETAIL"]);
                        }

                        if (dr["NIDPAYROLL"] != null && dr["NIDPAYROLL"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.IdPlanilla = Convert.ToInt32(dr["NIDPAYROLL"]);
                        }

                        if (dr["NBRANCH"] != null && dr["NBRANCH"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.IdRamo = Convert.ToInt32(dr["NBRANCH"]);
                        }

                        if (dr["NPRODUCT"] != null && dr["NPRODUCT"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.IdProducto = Convert.ToInt32(dr["NPRODUCT"]);
                        }

                        if (dr["NPOLICY"] != null && dr["NPOLICY"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.VcNumeropoliza = Convert.ToInt64(dr["NPOLICY"]);
                        }

                        if (dr["NCERTIF"] != null && dr["NCERTIF"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.VcNumerocertificado = Convert.ToInt64(dr["NCERTIF"]);
                        }

                        if (dr["NRECEIPT"] != null && dr["NRECEIPT"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.IdProforma = Convert.ToInt64(dr["NRECEIPT"]);
                        }

                        if (dr["NPREMIUM"] != null && dr["NPREMIUM"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.DcMonto = Convert.ToInt32(dr["NPREMIUM"]);
                        }

                        if (dr["DUPDATE"] != null && dr["DUPDATE"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.DtFechamodificacion = Convert.ToDateTime(dr["DUPDATE"]);
                        }

                        if (dr["NUSERUPDATE"] != null && dr["NUSERUPDATE"].ToString() != "")
                        {
                            detallePlanillaCobroEntity.VcUsuariomodificacion = dr["NUSERUPDATE"].ToString();
                        }

                        detallePlanillaCobroEntity.IddgEstado            = "1001";                     //Estado de Registro - Activo
                        detallePlanillaCobroEntity.IddgEstadoDetPlanilla = "1101";                     //Estado de Planilla - Ingresado

                        detallePlanillaCobroEntity.VcUsuariocreacion = p.VcUsuariocreacion.ToString(); //Agregado 16/07/2018

                        detallePlanillaCobroList.Add(detallePlanillaCobroEntity);
                    }

                    p.DetallePlanillacobro = detallePlanillaCobroList;
                }
            }
        }