Esempio n. 1
0
        private bool LogNotificacion()
        {
            _Notificacion = Notificacion.getNotificacion(base.Afiliado.nAF_Id);
            HelperEnvioCorreo.BuscarCamposCorreo(base.sCod, base.Afiliado.sCO_Nombres, base.Afiliado.CO_Email, new decimal(0), string.Empty, this._Notificacion.FechaInicio, string.Empty, string.Empty, string.Empty, this._Notificacion.PaisNombre, string.Empty, this._Notificacion.FechaFin, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
            bool flag = false;

            try
            {
                DataLog dataLog = new DataLog()
                {
                    NAF_Id            = base.Afiliado.nAF_Id,
                    SAF_NombreUsuario = (string.IsNullOrEmpty(base.Afiliado.sAF_NombreUsuario) ? string.Empty : base.Afiliado.sAF_NombreUsuario),
                    DtFecha_Trans     = DateTime.Now.Date,
                    STime_Trans       = DateTime.Now.ToLongTimeString()
                };

                if (Opcion.Equals("Notificacion"))
                {
                    dataLog.SCod_Trans = "ANOVA";
                    dataLog.SConcepto  = string.Concat("Agregar Notificación de Viaje");
                }
                else if (Opcion.Equals("Destino"))
                {
                    dataLog.SCod_Trans = "ANODA";
                    dataLog.SConcepto  = string.Concat("Agregar Destino");
                }
                else if (Opcion.Equals("EETDC"))
                {
                    throw new IBException("SE EJECUTO LA ACCION");
                }

                dataLog.SAF_IP              = (string.IsNullOrEmpty(base.Afiliado.sIP) ? string.Empty : base.Afiliado.sIP);
                dataLog.SBanco              = string.Concat("Salida: ", _Notificacion.FechaInicio);;
                dataLog.SCuenta_Origen      = string.Concat("Notificación ID: ", _Notificacion.NotificacionId);
                dataLog.SCuenta_Destino     = string.Concat("Destino ID: ", _Notificacion.DestinoId);
                dataLog.SMonto              = string.Empty;
                dataLog.STipo_Tarjeta       = string.Concat("Retorno: ", _Notificacion.FechaFin);
                dataLog.SBeneficiario       = string.Empty;
                dataLog.SCedula_Id_B        = string.Empty;
                dataLog.SSerial_Chequera    = string.Empty;
                dataLog.SCheques            = string.Empty;
                dataLog.STitular            = string.Empty;
                dataLog.ICantidad           = 0;
                dataLog.SReferencia         = string.Empty;
                dataLog.SMotivo_Suspension  = string.Empty;
                dataLog.SDir_Envio_Chequera = string.Empty;
                flag = HelperGlobal.LogTransAdd(dataLog);
            }
            catch (IBException bException)
            {
            }
            return(flag);
        }
Esempio n. 2
0
        public static Notificacion getNotificacion(long AF_Id)
        {
            long     num;
            long     num1;
            long     num2;
            string   str;
            DateTime dateTime1;
            DateTime dateTime2;

            Notificacion notificacion  = new Notificacion();
            Notificacion notificacion1 = notificacion;

            DataSet   ds = HelperNotificacionIBP.DestinoByNotificacion(AF_Id);
            DataTable dt = ds.Tables[0];
            DataRow   dr = dt.Rows[0];

            if (dr.Table.Columns.Contains("NotificacionId"))
            {
                num = (dr.IsNull("NotificacionId") ? (long)0 : long.Parse(dr["NotificacionId"].ToString()));
            }
            else
            {
                num = (long)0;
            }
            notificacion1.NotificacionId = num;
            Notificacion notificacion2 = notificacion;

            if (dr.Table.Columns.Contains("DestinoId"))
            {
                num1 = (dr.IsNull("DestinoId") ? (long)0 : long.Parse(dr["DestinoId"].ToString()));
            }
            else
            {
                num1 = (long)0;
            }
            notificacion2.DestinoId = num1;
            Notificacion notificacion3 = notificacion;

            if (dr.Table.Columns.Contains("PaisId"))
            {
                num2 = (dr.IsNull("PaisId") ? (long)0 : long.Parse(dr["PaisId"].ToString()));
            }
            else
            {
                num2 = (long)0;
            }
            notificacion3.PaisId = num2;
            Notificacion notificacion4 = notificacion;

            if (dr.Table.Columns.Contains("PaisNombre"))
            {
                str = (dr.IsNull("PaisNombre") ? "" : dr["PaisNombre"].ToString());
            }
            else
            {
                str = "";
            }
            notificacion4.PaisNombre = str;
            Notificacion notificacion5 = notificacion;

            if (dr.Table.Columns.Contains("FechaInicio"))
            {
                dateTime1 = (dr.IsNull("FechaInicio") ? DateTime.Now : DateTime.Parse(dr["FechaInicio"].ToString()));
            }
            else
            {
                dateTime1 = DateTime.Now;
            }
            notificacion5.FechaInicio = dateTime1.ToString("dd - MMM - yyyy");
            Notificacion notificacion6 = notificacion;

            if (dr.Table.Columns.Contains("FechaFin"))
            {
                dateTime2 = (dr.IsNull("FechaFin") ? DateTime.Now : DateTime.Parse(dr["FechaFin"].ToString()));
            }
            else
            {
                dateTime2 = DateTime.Now;
            }
            notificacion6.FechaFin = dateTime2.ToString("dd - MMM - yyyy");

            return(notificacion);
        }