コード例 #1
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
 public CreditoPyme(ServicioContratacionProductos.WS_ContratacionProductosOnline ContratacionProducto, CommonSettingsManager settings,
                    wsConsultaExterna ServicioRatingEmpresarial)
 {
     _ContratacionProducto      = ContratacionProducto;
     _settings                  = settings.Config;
     _ServicioRatingEmpresarial = ServicioRatingEmpresarial;
 }
コード例 #2
0
 public CreditoPymeController(ICreditoPyme repoCreditoPyme, CommonSettingsManager settings, ICatalogoRepository repoCatalogo, IOtpRepository OtpRepo)
 {
     _repoCreditoPyme = repoCreditoPyme;
     _settings        = settings.Config;
     _repoCatalogo    = repoCatalogo;
     _OtpRepo         = OtpRepo;
 }
コード例 #3
0
        public static Mensaje getNotiMessage(string id, CommonApplicationSettings _settings)
        {
            var msj = System.Array.Find(_settings.Notificaciones.mensajes, el => el.code == id);

            if (msj == null)
            {
                msj = System.Array.Find(_settings.Notificaciones.mensajes, el => el.code == null);
            }


            if (msj.redirectTo == "")
            {
                msj.redirectTo = _settings.Notificaciones.UrlDefaultPageToRedirect;
            }

            return(msj);
        }
コード例 #4
0
 public CatalogoRepository(WS_ContratacionProductosOnline ContratacionProducto,
                           CommonSettingsManager settings)
 {
     _ContratacionProducto = ContratacionProducto;
     _settings             = settings.Config;
 }
コード例 #5
0
 public SobreGiroRepository(ServicioContratacionProductos.WS_ContratacionProductosOnline ContratacionProducto
                            , CommonSettingsManager settings)
 {
     _ContratacionProducto = ContratacionProducto;
     _settings             = settings.Config;
 }
コード例 #6
0
 public TestController(CommonSettingsManager settings, ITokenRepository tokenRepo)
 {
     _settings  = settings.Config;
     _tokenRepo = tokenRepo;
 }
コード例 #7
0
 public ErrorHandlerController(CommonSettingsManager settings)
 {
     _settings = settings.Config;
 }
コード例 #8
0
ファイル: Extentions.cs プロジェクト: JohnYsaac10/app-test
        public static bool IsValidModelSimulador(this FromFormSolicitudCreditoDto value, CommonApplicationSettings _settings, out string mensaje)
        {
            if (value == null)
            {
                mensaje = "Petición Erronea";
                return(false);
            }
            mensaje = "";
            if (string.IsNullOrEmpty(value.monto))
            {
                mensaje = "Debes Ingresar un monto para acceder a su crédito";
                return(false);
            }
            if (string.IsNullOrEmpty(value.destinoCredito.Descripcion))
            {
                mensaje = "Debes seleccionar el destino de su crédito";
                return(false);
            }
            if (string.IsNullOrEmpty(value.modoDePago.Descripcion))
            {
                mensaje = "Debes seleccionar el modo de pago de su crédito";
                return(false);
            }
            if (value.monto.Any(char.IsLetter))
            {
                mensaje = "El campo monto contiene Letras";
                return(false);
            }

            /*var valorSoli = int.Parse(value.Monto);
             * if (valorSoli > _settings.RangoDeSobregiro.valorMax || valorSoli < _settings.RangoDeSobregiro.valorMin){
             *  mensaje = "Debes ingresar un monto entre [1,000 - 40,000]";
             *  return false;
             * }*/

            if (value.modoDePago.idCodigo == 12167) //al vencimiento
            {
                DateTime temp;
                if (!(DateTime.TryParse(value.fechaPago, CultureInfo.CreateSpecificCulture("es-EC"), DateTimeStyles.None, out temp)))
                {
                    mensaje = "fecha no válida. formato fecha: " + String.Format("{0:dd/MM/yyyy}", DateTime.Today);
                    return(false);
                }

                if ((temp.DayOfWeek == DayOfWeek.Saturday) || (temp.DayOfWeek == DayOfWeek.Sunday))
                {
                    mensaje = "\n No se permiten Sábado y Domingos";
                    return(false);
                }

                var hoy     = Convert.ToDateTime(DateTime.Today.Date, new CultureInfo("es-EC"));
                var MinDate = hoy.AddDays(_settings.RangoDeCreditoPyme.minDias);
                var MaxDate = MinDate.AddDays(_settings.RangoDeCreditoPyme.maxDias);

                if (temp > MaxDate)
                {
                    mensaje = "\n  Fecha erroneo. Fecha Permitida hasta el " + String.Format("{0:dd/MM/yyyy}", MaxDate) + "\n fecha actual: " + String.Format("{0:dd/MM/yyyy}", hoy) + "\n" + "fecha introducida: " + String.Format("{0:dd/MM/yyyy}", temp);
                    return(false);
                }

                if (temp < MinDate)
                {
                    mensaje = "\n  Fecha erroneo. Fecha minima de selección: " + String.Format("{0:dd/MM/yyyy}", MinDate) + "\n fecha actual: " + String.Format("{0:dd/MM/yyyy}", hoy) + "\n" + "fecha introducida: " + String.Format("{0:dd/MM/yyyy}", temp);
                    return(false);
                }
            }

            if (value.modoDePago.idCodigo == 12168) //mensualmente
            {
                if (string.IsNullOrEmpty(value.plazoCredito.Descripcion))
                {
                    mensaje = "Debes seleccionar un plazo de su crédito";
                    return(false);
                }
                if (string.IsNullOrEmpty(value.amortizacion))
                {
                    mensaje = "Debes seleccionar el tipo de amortización";
                    return(false);
                }
                if (string.IsNullOrEmpty(value.diaDePago))
                {
                    mensaje = "Debes ingresar el dia de pago de su crédito";
                    return(false);
                }
                var dia = int.Parse(value.diaDePago);
                if (dia > 30 || dia < 1)
                {
                    mensaje = "Debes ingresar un dia entre [1-30]";
                    return(false);
                }
                if (value.amortizacion != "FRANCESA" && value.amortizacion != "ALEMANA")
                {
                    mensaje = "Tipo de amortizacion no válida";
                    return(false);
                }
            }
            return(true);
        }
コード例 #9
0
ファイル: Extentions.cs プロジェクト: JohnYsaac10/app-test
        public static bool isValidateRequisition(this SobreGiroDetalleSolicitudDto myObject, CommonApplicationSettings _settings, out string mensaje)
        {
            foreach (PropertyInfo pi in myObject.GetType().GetProperties())
            {
                if (pi.PropertyType == typeof(string))
                {
                    string value = (string)pi.GetValue(myObject);
                    if (string.IsNullOrEmpty(value) && (pi.Name != "TasaInteres" && pi.Name != "celular"))
                    {
                        mensaje = pi.Name + " no fué ingresado";
                        return(false);
                    }
                }
            }

            var cantidad = myObject.Cantidad.Replace(",", "");


            if (cantidad.Any(char.IsLetter))
            {
                mensaje = "la cantidad contenía letras";
                return(false);
            }

            if (cantidad.ToInt() < _settings.RangoDeSobregiro.valorMin || cantidad.ToInt() > _settings.RangoDeSobregiro.valorMax)
            {
                mensaje = cantidad + $" no está en el rango de ({_settings.RangoDeSobregiro.valorMin} - {_settings.RangoDeSobregiro.valorMax})";
                return(false);
            }

            var cuenta = myObject.Cuenta.Split('-');

            if (cuenta[0].Any(char.IsLetter))
            {
                mensaje = "la cuenta contiene letras";
                return(false);
            }


            if (myObject.TipoSobregiro != "82" && myObject.TipoSobregiro != "85")
            {
                mensaje = "Tipo Sobregiro no válido";
                return(false);
            }


            DateTime temp;

            if (!(DateTime.TryParse(myObject.FechaPago, CultureInfo.CreateSpecificCulture("es-EC"), DateTimeStyles.None, out temp)))
            {
                mensaje = "fecha no válida. formato fecha: " + String.Format("{0:dd/MM/yyyy}", DateTime.Today);
                return(false);
            }

            var hoy = Convert.ToDateTime(DateTime.Today.Date, new CultureInfo("es-EC"));

            if (hoy.Month != temp.Month)
            {
                mensaje = "\n  Mes erroneo. \n fecha actual: " + String.Format("{0:dd/MM/yyyy}", hoy) + "\n" + "fecha introducida: " + String.Format("{0:dd/MM/yyyy}", temp);
                return(false);
            }

            if (hoy.Year != temp.Year)
            {
                mensaje = "\n  Año erroneo. \n fecha actual: " + String.Format("{0:dd/MM/yyyy}", hoy) + "\n" + "fecha introducida: " + String.Format("{0:dd/MM/yyyy}", temp);
                return(false);
            }


            if ((temp.DayOfWeek == DayOfWeek.Saturday) || (temp.DayOfWeek == DayOfWeek.Sunday))
            {
                string dateToday = hoy.ToString("d");
                mensaje = "\n No se permiten Sábado y Domingos";
                return(false);
            }

            mensaje = "";

            return(true);
        }
コード例 #10
0
 public TokenAccessValidationController(ITokenRepository tokenRepo, CommonSettingsManager settings)
 {
     _settings  = settings.Config;
     _tokenRepo = tokenRepo;
 }
コード例 #11
0
 public SobreGiroController(ISobreGiroRepository sobregiroRepo, IOtpRepository OtpRepo, CommonSettingsManager settings)
 {
     _sobregiroRepo = sobregiroRepo;
     _OtpRepo       = OtpRepo;
     _settings      = settings.Config;
 }