예제 #1
0
        public ActionResult TU1sdEZJ(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        var AgenciaBancaria = new BLBanco().ListarAgencia(id);
                        globalResponse.DATA = AgenciaBancaria;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult Tk1hVEVk(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();
            string     _err           = string.Empty;

            if (User != null)
            {
                try
                {
                    var         idp       = Peach.DecriptText(sid);
                    BEParametro parametro = new BEParametro();
                    parametro.Id = Convert.ToInt16(idp);

                    globalResponse.DATA = new BLParametro().ListarDetalle(parametro);
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }

            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
        public PartialViewResult GetCustomMenu(string selectController, string selectMethod)
        {
            CustomMenuModel model = new CustomMenuModel();

            if (Request.IsAuthenticated)
            {
                try
                {
                    if (User.CID != null)
                    {
                        // Obtener el perfil del usuario
                        var IdPerfil = Convert.ToInt16(Peach.DecriptText(User.Perfil_CID));

                        model.ItemsMenu        = new BLMenu().getMenu_byPerfil(IdPerfil).Where(e => e.IsVisible.IntValue == 1).ToList();
                        model.selectController = (selectController != null) ? selectController : string.Empty;
                        model.selectMethod     = (selectMethod != null) ? selectMethod : string.Empty;
                    }
                    else
                    {
                        AddToastMessage(string.Empty, "Su sesión expiró. Ingrese nuevamente a la aplicación.", BootstrapAlertType.danger);
                    }
                }
                catch (Exception ex)
                {
                    AddToastMessage(string.Empty, ex.Message, BootstrapAlertType.danger);
                }
            }
            else
            {
                AddToastMessage(string.Empty, "Su sesión expiró. Ingrese nuevamente a la aplicación.", BootstrapAlertType.danger);
            }
            return(PartialView("_CustomMenu", model));
        }
예제 #4
0
        public ActionResult OvEIqYav(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        IEnumerable <SelectListItem> personas = new BLPersonalLocal().Listar_Directivo_toSelect_byOse(id)
                                                                .Select(q => new SelectListItem {
                            Text = q.Apellidos, Value = q.CID
                        });

                        globalResponse.DATA = personas;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public ActionResult TU1sdEZJ(string sid)
        {
            /*
             * Obs:    Se convierte en IEnumerable<SelectListItem> para factorizar las funciones javascript "fillxxx "
             *      en documento que lo invoca
             */
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        IEnumerable <SelectListItem> monedas = new BLMoneda().Listar_Select_byOSE(id)
                                                               .Select(p => new SelectListItem {
                            Text = p.Nombre, Value = p.CID
                        });

                        globalResponse.DATA = monedas;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #6
0
        public ActionResult NVdqVjlt(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        IEnumerable <SelectListItem> agencias = new BLBanco().ListarAgencia_ToSelect_ByOse(id)
                                                                .Select(p => new SelectListItem {
                            Text = p.Nombre, Value = p.CID
                        });

                        globalResponse.DATA = agencias;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #7
0
        public ActionResult OUlSU3Ez(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();

            if (User != null)
            {
                try
                {
                    var id = Peach.DecriptText(sid);

                    BEParametro parametro = new BEParametro();
                    parametro.Id      = 0;
                    parametro.Detalle = new BEParametroItem
                    {
                        Id = Convert.ToInt16(id)
                    };

                    BEParametroItem detalle = new BLParametro().ListarDetalle_byId(parametro);
                    globalResponse.DATA = detalle;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
                return(Json(globalResponse, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
        }
예제 #8
0
        /// <summary>
        /// Devuelve las cuentas corrientes de un organo de servicio exterior específico
        /// </summary>
        /// <returns></returns>
        public ActionResult Cuentas()
        {
            if (User != null)
            {
                if (this.IsPermitido())
                {
                    if (User.OrganoServicio_CID == string.Empty)
                    {
                        return(View());
                    }

                    // Obtiene los datos del usuario
                    var U = System.Web.HttpContext.Current.User;

                    // Obtiene la misión del usuario
                    var osesid = Peach.DecriptText(User.OrganoServicio_CID);
                    ViewBag.OSESID = Peach.EncriptToBase64(osesid);
                    ViewBag.OSE    = User.OrganoServicio_Nombre;

                    return(View());
                }
                else
                {
                    AddToastMessage("No permitido", "Esta opcion no esta permitida para su perfil.", BootstrapAlertType.danger);
                    return(RedirectToAction("Index", "Home"));
                }
            }
            else
            {
                return(RedirectToAction("Login", "Account", new { act = "timeout" }));
            }
        }
예제 #9
0
        public ActionResult TjQxYWpE(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();
            BEPais     Pais           = new BEPais();

            string _err = string.Empty;

            if (User != null)
            {
                try
                {
                    string Id = Peach.DecriptText(sid);

                    Pais = new BLPais().Listar_byId(Convert.ToInt16(Id));
                    globalResponse.DATA = Pais;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #10
0
        protected void Application_PostAuthenticateRequest(Object sender, EventArgs e)
        {
            HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];

            if (authCookie != null)
            {
                JavaScriptSerializer      serializer = new JavaScriptSerializer();
                FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);
                var data = Peach.DecriptText(authTicket.UserData);
                CustomPrincipalTicket _dataTicket          = serializer.Deserialize <CustomPrincipalTicket>(data);
                CustomPrincipal       CustomPrincipalLogin = new CustomPrincipal(authTicket.Name);

                CustomPrincipalLogin.CID     = _dataTicket.CID;
                CustomPrincipalLogin.Usuario = _dataTicket.Usuario;

                CustomPrincipalLogin.Unidad_CID    = _dataTicket.Unidad_CID;
                CustomPrincipalLogin.Unidad_Nombre = _dataTicket.Unidad_Nombre;

                CustomPrincipalLogin.OrganoServicio_CID    = _dataTicket.OrganoServicio_CID;
                CustomPrincipalLogin.OrganoServicio_Nombre = _dataTicket.OrganoServicio_Nombre;
                CustomPrincipalLogin.OrganoServicio_Abr    = _dataTicket.OrganoServicio_Abr;

                if (_dataTicket.Perfil_CID != null)
                {
                    CustomPrincipalLogin.Perfil_CID    = _dataTicket.Perfil_CID;
                    CustomPrincipalLogin.Perfil_Nombre = _dataTicket.Perfil_Nombre;
                }

                HttpContext.Current.User = CustomPrincipalLogin;
            }
        }
예제 #11
0
        public ActionResult Tk5obGw4(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int i_sid    = Convert.ToInt16(Peach.DecriptText(sid));
                        var Regiones = new BLPais().Listar_Regiones_byContinente(i_sid)
                                       .Select(p => new SelectListItem {
                            Value = p.CID, Text = p.Nombre
                        }).ToList();

                        globalResponse.DATA = Regiones;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #12
0
        public ActionResult Y2ZTaUlU(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var nom = model[0].Trim().ToUpper();
                    var grp = model[1];
                    var des = model[2].Trim().ToUpper();
                    var sid = model[3].Trim();

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre para el parámetro.";
                    }
                    else if (grp == null)
                    {
                        globalResponse.ERR = "No ha seleccionado un grupo para el parámetro.";
                    }
                    else
                    {
                        BEParametro parametro = new BEParametro
                        {
                            Id     = (sid != string.Empty) ? Convert.ToInt16(Peach.DecriptText(sid)) : 0,
                            Nombre = nom,
                            Grupo  = new BEParametroGrupo
                            {
                                Id = Convert.ToInt16(Peach.DecriptText(grp))
                            },
                            Descripcion = des,
                            RowAudit    = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };
                        oResponse           = new BLParametro().Grabar(parametro);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #13
0
        public ActionResult enNBUT09(List <string> dat)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var nom = dat[0].Trim().ToUpper();
                    var url = dat[1].Trim().ToUpper();
                    var sit = dat[2];
                    var sid = dat[3];

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre para el banco";
                    }
                    else
                    {
                        BEBanco Banco = new BEBanco
                        {
                            Id        = (sid != "") ? Convert.ToInt16(Peach.DecriptFromBase64(sid)) : 0,
                            Nombre    = nom,
                            Url       = url,
                            Situacion = new ItemGenerico {
                                IntValue = Convert.ToByte(sit)
                            },

                            RowAudit = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };

                        oResponse           = new BLBanco().Grabar(Banco);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #14
0
        /// <summary>
        /// Devuelve una cadena con el nombre del directorio activo configurado desde el Web.Config
        /// </summary>
        /// <returns></returns>
        public static string GetActiveDirectory()
        {
            string Key = string.Empty;

            try
            {
                Key = getActiveDirectoryKey(getActiveDirectoryEntorno());
                return(Peach.DecriptText(Convert.ToString(System.Configuration.ConfigurationManager.AppSettings.Get(Key))));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #15
0
        // Tree de Perfiles

        /// <summary>
        /// Devuelve todas las opciones del menu, con las opciones del perfil seleccionado
        /// </summary>
        /// <param name="sid">Id del perfil</param>
        /// <returns></returns>
        public ActionResult XVxJ3pT0(string sid)
        {
            CustomJSON         globalResponse = new CustomJSON();
            ResponserData      oResponse      = new ResponserData();
            List <BEMenuItem>  Items          = new List <BEMenuItem>();
            List <JsTreeModel> jsTree         = new List <JsTreeModel>();

            string _err = string.Empty;

            if (User != null)
            {
                try
                {
                    var id = Peach.DecriptText(sid);
                    Items = new BLMenu().ListarInterfaz(Convert.ToInt16(id)).ToList();

                    foreach (BEMenuItem menu in Items)
                    {
                        jsTree.Add(new JsTreeModel
                        {
                            id     = menu.Id.ToString(),
                            parent = (menu.Padre.IntValue == 0) ? "#" : menu.Padre.IntValue.ToString(),
                            text   = menu.Nombre,
                            data   = new JsTreeModel_data
                            {
                                idp = (menu.Padre.IntValue == 0) ? "#" : menu.Padre.IntValue.ToString(),
                                nop = menu.Padre.Texto,
                            },
                            state = new JsTreeModelState
                            {
                                opened   = true,
                                selected = (menu.IsAuth.IntValue == 1)
                            }
                        });
                    }
                    globalResponse.DATA = jsTree;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(jsTree, JsonRequestBehavior.AllowGet));
        }
예제 #16
0
        /// <summary>
        /// Exportacion de datos : usuario de servicio exterior
        /// </summary>
        /// <returns></returns>
        public FileContentResult PLus9XJE()
        {
            string TituloWorksheet = "Cuentas Corrientes";
            string NombreFileExcel = "CuentasCorrientes.xlsx";

            //string[] columns = { "OrganoServicio", "NumeroCuenta", "Moneda", "BancoAgencia", "SwiftBIC", "IBAN", "ABA", "RIB", "CBU", "BSB", "ABI", "CAB", "DestinoCuenta", "FechaApertura", "FechaCierre", "Autorizacion", "FechaAut", "Apoderado", "Beneficiario", "Domicilio1", "Domicilio2", "Domicilio3", "TransferenciaCtaOrigen", "TransferenciaTpDestino", "TransferenciaBancoInt", "TransferenciaRuteoInt", "Observaciones" };
            string[] columns = { "OrganoServicio", "NumeroCuenta", "Moneda", "BancoAgencia", "SwiftBIC", "IBAN", "ABA", "RIB", "CBU", "BSB", "ABI", "CAB", "DestinoCuenta", "FechaApertura", "FechaCierre", "Autorizacion", "FechaAut", "Apoderado", "Beneficiario", "Domicilio1", "Domicilio2", "Domicilio3", "Observaciones" };

            if (User != null)
            {
                if (this.IsPermitido())
                {
                    try
                    {
                        int OrganoServicio = Convert.ToInt16(Peach.DecriptText(User.OrganoServicio_CID));

                        List <RPCuentasCorrientes> Cuentas = new BLCuentaCorriente().ExportarCuentas(OrganoServicio).ToList();
                        if (Cuentas.Count > 0)
                        {
                            byte[] filecontent = ExcelExportHelper.ExportExcel(
                                Cuentas, TituloWorksheet,
                                String.Format("Exportado por {0} el {1} a las {2}.", User.Usuario, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString()),
                                true,
                                columns);

                            return(File(filecontent, ExcelExportHelper.ExcelContentType, NombreFileExcel));
                        }
                        else
                        {
                            return(File(Encoding.UTF8.GetBytes("No hay datos"), "text/plain", string.Format("Reporte.txt")));
                        }
                    }
                    catch (Exception ex)
                    {
                        return(File(Encoding.UTF8.GetBytes(ex.Message), "text/plain", string.Format("Error.txt")));
                    }
                }
                else
                {
                    return(File(Encoding.UTF8.GetBytes("Lo sentimos, no tiene permisos para exportar el reporte."), "text/plain", string.Format("Reporte.txt")));
                }
            }
            else
            {
                return(File(Encoding.UTF8.GetBytes("Error. No ha ingresado correctamente a la aplicación."), "text/plain", string.Format("Reporte.txt")));
            }
        }
예제 #17
0
        public ActionResult SVkwTXVC(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            int id = 0;

            if (User != null)
            {
                try
                {
                    if (sid != string.Empty)
                    {
                        id = Convert.ToInt16(Peach.DecriptText(sid));
                    }
                    BEParametroItem detalle = new BEParametroItem
                    {
                        Id       = Convert.ToInt16(id),
                        RowAudit = new IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        }
                    };
                    oResponse           = new BLParametro().EliminarDetalle(detalle);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }

            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #18
0
        /// <summary>
        /// Valida si el usuario tiene permisos para acceder al método y controlador
        /// </summary>
        /// <returns></returns>
        public bool IsPermitido()
        {
            if (User.CID != null)
            {
                var _perfil = Peach.DecriptText(User.Perfil_CID);

                bool _IsPermitido = new BLPerfil().ValidaPermisoPerfil(Convert.ToInt16(_perfil),
                                                                       this.Controlador(), this.Metodo());

                if (!_IsPermitido)
                {
                    AddToastMessage(string.Empty, "No tiene los permisos necesarios para acceder a esta opción.", BootstrapAlertType.danger);
                }

                return(_IsPermitido);
            }
            else
            {
                RedirectToAction("Login", "Account", new { m = "NotAuthenticated" });
                return(false);
            }
        }
예제 #19
0
        public ActionResult aytQVy91(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var id = (model[3] == "0") ? model[3] : Peach.DecriptText(model[3]);

                    BEPerfil Perfil = new BEPerfil
                    {
                        Nombre      = model[0].Trim().ToUpper(),
                        Abreviatura = model[1].Trim().ToUpper(),
                        Descripcion = model[2].Trim().ToUpper(),
                        Id          = Convert.ToInt16(id),
                        RowAudit    = new Entidad.Primitivos.IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        }
                    };

                    oResponse           = new BLPerfil().Grabar(Perfil);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #20
0
        public ActionResult bi8wZz09(List <string> dat, string[] mnd)
        {
            CustomJSON      globalResponse = new CustomJSON();
            ResponserData   oResponse      = new ResponserData();
            List <BEMoneda> Monedas        = new List <BEMoneda>();
            BEPais          Pais           = new BEPais();

            if (User != null)
            {
                try
                {
                    var nom = dat[0].Trim().ToUpper();
                    var ofi = dat[1].Trim().ToUpper();
                    var gen = dat[2].Trim().ToUpper();
                    var m49 = dat[3].Trim().ToUpper();
                    var iso = dat[4].Trim().ToUpper();
                    var reg = dat[5];
                    var sid = (dat[6] == "0") ? dat[6] : Peach.DecriptText(dat[6]);

                    Pais.Nombre     = nom;
                    Pais.Oficial    = ofi;
                    Pais.Gentilicio = gen;
                    Pais.M49        = m49;
                    Pais.ISOA3      = iso;

                    Pais.Region = new BERegion {
                        Id = Convert.ToInt16(Peach.DecriptText(reg))
                    };
                    Pais.Id = Convert.ToInt16(sid);

                    if (mnd != null)
                    {
                        foreach (var m in mnd)
                        {
                            string sidm = Peach.DecriptText(m);
                            Monedas.Add(new BEMoneda {
                                Id = Convert.ToInt16(sidm)
                            });
                        }
                    }

                    Pais.Monedas  = Monedas;
                    Pais.RowAudit = new IRowAudit
                    {
                        IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                        IP   = Common.PageUtility.GetUserIpAddress()
                    };

                    oResponse           = new BLPais().Grabar(Pais);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #21
0
        public ActionResult Signup(SignUpViewModel model)
        {
            try
            {
                var usr = model.Usuario;
                int ose = Convert.ToInt16(Peach.DecriptText(model.Usuario.OrganoServicio.CID));

                if (ose == 0)
                {
                    model.OrganosDeServicio = GetOrganosServicio();
                    AddToastMessage(string.Empty, "Debe seleccionar un Órgano de Servicio.", BootstrapAlertType.danger);
                    return(View(model));
                }
                else if (!model.Usuario.Email.ToUpper().Contains("@RREE.GOB.PE"))
                {
                    model.OrganosDeServicio = GetOrganosServicio();
                    AddToastMessage(string.Empty, "Debe ingresar su correo institucional incluido @RREE.GOB.PE", BootstrapAlertType.danger);
                    return(View(model));
                }
                else
                {
                    var arr_user = model.Usuario.Email.Split('@');
                    var lanusr   = arr_user[0];

                    model.Usuario.Apellidos = model.Usuario.Apellidos.Trim().ToUpper();
                    model.Usuario.Nombres   = model.Usuario.Nombres.Trim().ToUpper();
                    model.Usuario.Email     = model.Usuario.Email.Trim().ToUpper();
                    model.Usuario.Login     = new BELogin
                    {
                        user = lanusr.ToUpper(),
                        pass = Peach.EncriptText(Crypto.CryptoProvider.TripleDES, "Z")
                    };

                    model.Usuario.OrganoServicio = new BEOrganoServicio {
                        Id = ose
                    };
                    model.Usuario.RowAudit = new IRowAudit
                    {
                        IUsr = 1,
                        IP   = Common.PageUtility.GetUserIpAddress()
                    };

                    ResponserData oResponse = new BLUsuario().GrabarSolicitud(model.Usuario);
                    if (oResponse.Estado == ResponserEstado.Ok)
                    {
                        AddToastMessage(string.Empty, oResponse.Mensaje, oResponse.TipoAlerta);
                        return(View("Login"));
                    }
                    else
                    {
                        model.OrganosDeServicio = GetOrganosServicio();
                        AddToastMessage(string.Empty, oResponse.Mensaje, oResponse.TipoAlerta);
                        return(View(model));
                    }
                }
            }
            catch (Exception ex)
            {
                AddToastMessage(string.Empty, ex.Message, BootstrapAlertType.danger);
                return(View("Login"));
            }
        }
예제 #22
0
        public ActionResult enNBUT09(List <string> dat)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();
            BEMoneda      Moneda         = new BEMoneda();

            if (User != null)
            {
                try
                {
                    var nom = dat[0].Trim().ToUpper();
                    var abr = dat[1].Trim();
                    var suf = dat[2].Trim();
                    var sim = dat[3].Trim();
                    var iso = dat[4].Trim().ToUpper();
                    var asg = dat[5];
                    var sid = dat[6];

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado el nombre";
                    }
                    else if (iso == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado el ISO";
                    }
                    else
                    {
                        var i_sid = (sid == "0") ? 0 : Convert.ToInt16(Peach.DecriptText(sid));

                        Moneda.Nombre         = nom;
                        Moneda.Abreviatura    = abr;
                        Moneda.SufijoContable = suf;
                        Moneda.Simbolo        = sim;
                        Moneda.ISO4217        = iso;
                        Moneda.Asignable      = new ItemGenerico {
                            IntValue = Convert.ToInt16(asg)
                        };
                        Moneda.Id = i_sid;

                        Moneda.RowAudit = new IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        };

                        oResponse           = new BLMoneda().Grabar(Moneda);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #23
0
        /// <summary>
        /// Graba las opciones del menu asociadas a un perfil
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult ZFppSXFj(List <string[]> model)
        {
            CustomJSON        globalResponse = new CustomJSON();
            ResponserData     oResponse      = new ResponserData();
            List <BEMenuItem> Items          = new List <BEMenuItem>();
            BEPerfil          perfil         = new BEPerfil();

            if (User != null)
            {
                try
                {
                    var sid = Peach.DecriptText(model[0][0].ToString());
                    var seleccion_determinada = model[1];

                    if (seleccion_determinada.Length > 0)
                    {
                        foreach (string s in seleccion_determinada)
                        {
                            Items.Add(new BEMenuItem
                            {
                                Id       = Convert.ToInt16(s),
                                RowAudit = new IRowAudit
                                {
                                    IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                    IP   = Common.PageUtility.GetUserIpAddress()
                                }
                            });
                        }

                        // No determinadas
                        if (model.Count > 2)
                        {
                            var seleccion_nodeterminada = model[2];
                            foreach (string s in seleccion_nodeterminada)
                            {
                                Items.Add(new BEMenuItem
                                {
                                    Id       = Convert.ToInt16(s),
                                    RowAudit = new IRowAudit
                                    {
                                        IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                        IP   = Common.PageUtility.GetUserIpAddress()
                                    }
                                });
                            }
                        }

                        // resto de datos

                        perfil.Id           = Convert.ToInt16(sid);
                        perfil.OpcionesMenu = Items;
                        perfil.RowAudit     = new IRowAudit {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        };

                        oResponse           = new BLMenu().Grabar_byPerfil(perfil);
                        globalResponse.DATA = oResponse;
                    }
                    else
                    {
                        globalResponse.ERR = "No existen opciones seleccionadas.";
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #24
0
        public ActionResult VUyNXUxV(List <string> dat)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var mnd = dat[0];
                    var bic = dat[1].Trim().ToUpper();
                    var rib = dat[2].Trim().ToUpper();

                    var abi = dat[3].Trim().ToUpper();
                    var ini = dat[4].Trim();
                    var doc = dat[5].Trim().ToUpper();

                    var cta = dat[6].Trim().ToUpper();
                    var des = dat[7];
                    var iba = dat[8].Trim().ToUpper();
                    var cbu = dat[9].Trim().ToUpper();
                    var cab = dat[10].Trim().ToUpper();
                    var fin = dat[11].Trim().ToUpper();
                    var fdo = dat[12].Trim();

                    var age = dat[13];
                    var rut = dat[14];
                    var aba = dat[15].Trim().ToUpper();
                    var bsb = dat[16].Trim().ToUpper();

                    var apo = dat[17];
                    var obs = dat[18].Trim().ToUpper();

                    var ben = dat[19].Trim().ToUpper();
                    var di1 = dat[20].Trim().ToUpper();
                    var di2 = dat[21].Trim().ToUpper();
                    var di3 = dat[22].Trim().ToUpper();
                    var sid = dat[23];


                    if (cta == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un número de cuenta";
                    }
                    else if (mnd == null)
                    {
                        globalResponse.ERR = "No ha seleccionado una moneda";
                    }
                    else if (age == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el banco / agencia";
                    }
                    else if (rut == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el código de ruteo";
                    }
                    else
                    {
                        int _Id  = Convert.ToInt16(Peach.DecriptFromBase64(sid));
                        int _mnd = Convert.ToInt16(Peach.DecriptText(mnd));
                        int _age = Convert.ToInt16(Peach.DecriptText(age));
                        int _rut = Convert.ToInt16(Peach.DecriptText(rut));
                        int _des = Convert.ToInt16(Peach.DecriptText(des));

                        BETransferenciaPlantilla oPlantilla = new BETransferenciaPlantilla();

                        BECuentaCorriente Cuenta = new BECuentaCorriente
                        {
                            Id           = _Id,
                            NumeroCuenta = cta,
                            Moneda       = new BEMoneda
                            {
                                Id = _mnd
                            },
                            Agencia = new BEAgenciaBancaria
                            {
                                Id = _age
                            },
                            CodigoRuteo = new ItemGenerico
                            {
                                IntValue = _rut
                            },
                            Iban  = iba,
                            Swift = bic,
                            ABA   = aba,

                            RIB = rib,
                            ABI = abi,
                            CBU = cbu,
                            CAB = cab,
                            BSB = bsb,

                            Destino = new ItemGenerico
                            {
                                IntValue = _des
                            },
                            FechaApertura = ini,
                            FechaCierre   = fin,
                            Documento     = new BEDocumento
                            {
                                Numero = doc,
                                Fecha  = fdo
                            },
                            EsCompartida = new ItemGenerico
                            {
                                IntValue = 0
                            },
                            Apoderado = new ItemGenerico
                            {
                                IntValue = (apo == "0" || apo == null) ? 0 : Convert.ToInt16(Peach.DecriptText(apo))
                            },
                            Observacion = obs,

                            BeneficiarioNombre = ben,
                            BeneficiarioDir1   = di1,
                            BeneficiarioDir2   = di2,
                            BeneficiarioDir3   = di3,

                            Plantilla = oPlantilla,
                            RowAudit  = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };

                        // Validación
                        if (User.Perfil_Nombre == "RINDENTE")
                        {
                            Cuenta.Situacion = new ItemGenerico {
                                IntValue = (int)SitReg_Cuentas.PendienteDeAprobacion
                            };
                        }
                        else
                        {
                            Cuenta.Situacion = new ItemGenerico {
                                IntValue = (int)SitReg_Cuentas.RegistroAprobado
                            };
                        }

                        oResponse           = new BLCuentaCorriente().GrabarObservacion(Cuenta);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #25
0
        public ActionResult NGZIbEEr(List <string> dat)
        {
            //  L0hWZz09
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var nom  = dat[0].Trim().ToUpper();
                    var dir1 = dat[1].Trim().ToUpper();
                    var dir2 = dat[2].Trim().ToUpper();
                    var tpo  = dat[3];
                    var pai  = dat[4];
                    var agen = dat[5];
                    var banc = dat[6];

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre para la agencia";
                    }
                    else if (tpo == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el Tipo";
                    }
                    else if (pai == null)
                    {
                        globalResponse.ERR = "No ha seleccionado un País";
                    }
                    else
                    {
                        BEBanco Banco = new BEBanco
                        {
                            Id      = Convert.ToInt16(Peach.DecriptFromBase64(banc)),
                            Agencia = new BEAgenciaBancaria
                            {
                                Id         = (agen == "0") ? 0 : Convert.ToInt16(Peach.DecriptFromBase64(agen)),
                                Nombre     = nom,
                                Direccion1 = dir1,
                                Direccion2 = dir2,
                                Tipo       = new ItemGenerico {
                                    IntValue = Convert.ToInt16(Peach.DecriptText(tpo))
                                },
                                Pais = new BEPais {
                                    Id = Convert.ToInt16(Peach.DecriptText(pai))
                                }
                            },
                            RowAudit = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };

                        oResponse           = new BLBanco().GrabarAgencia(Banco);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #26
0
        public ActionResult RUJJa3Np(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            string _err = string.Empty;
            int    idp  = 0;
            int    idd  = 0;
            int    ord  = 0;

            if (User != null)
            {
                try
                {
                    var sip  = model[0].Trim();
                    var tex  = model[1].Trim().ToUpper();
                    var val  = model[2].Trim().ToUpper();
                    var ayu  = model[3].Trim().ToUpper();
                    var _ord = model[4].Trim();
                    var grp  = model[5];
                    var sid  = model[6].Trim();

                    if (tex == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado el texto del parámetro";
                    }
                    else
                    {
                        if (_ord != string.Empty)
                        {
                            bool isnum = int.TryParse(_ord, out ord);
                            if (!isnum)
                            {
                                ord = 0;
                            }
                        }

                        if (sip != string.Empty)
                        {
                            idp = Convert.ToInt16(Peach.DecriptText(sip));
                        }
                        if (sid != string.Empty)
                        {
                            idd = Convert.ToInt16(Peach.DecriptText(sid));
                        }

                        BEParametro parametro = new BEParametro()
                        {
                            Id      = idp,
                            Detalle = new BEParametroItem
                            {
                                Id      = idd,
                                Texto   = tex,
                                Valor   = val,
                                Ayuda   = ayu,
                                Orden   = ord,
                                IsGrupo = new ItemGenerico
                                {
                                    IntValue = (grp == "True") ? 1 : 0
                                },
                            },
                            RowAudit = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };
                        oResponse           = new BLParametro().GrabarDetalle(parametro);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #27
0
        /// <summary>
        /// Devuelve los datos de un usuario
        /// </summary>
        /// <param name="Id">Id del usuario</param>
        /// <returns>Objeto Usuario</returns>
        public BEUsuario Listar_byId(int Id)
        {
            BEUsuario Usuario = new BEUsuario();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_byId, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_idu", SqlDbType.Int).Value = Id;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Usuario.CID       = Peach.EncriptText(DataUtil.ObjectToString(dr["i_usrsid"]));
                            Usuario.Apellidos = DataUtil.ObjectToString(dr["s_usrape"]);
                            Usuario.Nombres   = DataUtil.ObjectToString(dr["s_usrnom"]);
                            Usuario.Email     = DataUtil.ObjectToString(dr["s_usrema"]);
                            Usuario.Telefono  = DataUtil.ObjectToString(dr["s_usrtel"]);
                            Usuario.IsDominio = DataUtil.ObjectToByte(dr["i_usrdom"]);

                            Usuario.Login      = new BELogin();
                            Usuario.Login.user = DataUtil.ObjectToString(dr["s_usrlan"]);
                            if (Usuario.IsDominio == 0)
                            {
                                Usuario.Login.pass = Peach.DecriptText(Crypto.CryptoProvider.TripleDES, DataUtil.ObjectToString(dr["s_usrpwd"]));
                            }
                            else
                            {
                                Usuario.Login.pass = DataUtil.ObjectToString(dr["s_usrpwd"]);
                            }

                            Usuario.Desde  = DataUtil.ObjectToString(dr["s_usrini"]);
                            Usuario.Hasta  = DataUtil.ObjectToString(dr["s_usrfin"]);
                            Usuario.Unidad = new BEUnidad
                            {
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_unisid"])),
                            };
                            Usuario.OrganoServicio = new BEOrganoServicio
                            {
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_osesid"])),
                            };
                            Usuario.Pais = new BEPais {
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_paisid"])),
                            };
                            Usuario.CambiarPwd = DataUtil.ObjectToByte(dr["i_usrchg"]);
                            Usuario.Estado     = new ItemGenerico {
                                IntValue = DataUtil.ObjectToInt(dr["i_usrest"])
                            };
                            Usuario.Rol = new ItemGenerico {
                                StrValue = Peach.EncriptText(DataUtil.ObjectToString(dr["i_usrrol"]))
                            };
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Usuario);
        }
        /// <summary>
        /// Graba los datos generales del Organo de Servicio Exterior
        /// </summary>
        /// <param name="model">Areglo con datos</param>
        /// <returns></returns>
        public ActionResult aTIya1Nr(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var nom = model[0].Trim().ToUpper();
                    var abr = model[1].Trim().ToUpper();
                    var tpo = model[2];
                    var pai = model[3];
                    var cod = model[4].Trim().ToUpper();
                    var jse = model[5];
                    var sid = model[6];

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre para el Órgano de Servicio";
                    }
                    else if (abr == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre abreviado para el Órgano de Servicio";
                    }
                    else if (tpo == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el tipo de Organo de Servicio";
                    }
                    else if (pai == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el país del Organo de Servicio";
                    }
                    else
                    {
                        BEOrganoServicio OrganoServicio = new BEOrganoServicio
                        {
                            Id          = (sid != "0") ? Convert.ToInt16(Peach.DecriptFromBase64(sid)) : 0,
                            Nombre      = nom,
                            Abreviatura = abr,
                            TipoOrgano  = new ItemGenerico {
                                Id = Convert.ToInt16(Peach.DecriptText(tpo))
                            },
                            Pais = new BEPais {
                                Id = Convert.ToInt16(Peach.DecriptFromBase64(pai))
                            },
                            CodigoInterop    = cod,
                            JefaturaServicio = new ItemGenerico {
                                Id = Convert.ToInt16(Peach.DecriptText(jse))
                            },
                            RowAudit = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };

                        oResponse           = new BLOrganoServicio().Grabar(OrganoServicio);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #29
0
        /// <summary>
        /// Graba la opción de menú
        /// </summary>
        /// <returns>Json</returns>
        public ActionResult TW5UTjZN(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var sid = model[0];
                    var pad = model[1];
                    var nom = model[2];
                    var des = model[3];
                    var con = model[4];
                    var met = model[5];
                    var par = model[6];
                    var url = model[7];
                    var ico = model[8];
                    var ord = model[9];
                    var pop = model[10];
                    var vis = model[11];
                    var grp = model[12];

                    var e = User;

                    BEMenuItem Item = new BEMenuItem
                    {
                        Id    = Convert.ToInt16(model[0]),
                        Padre = new ItemGenerico
                        {
                            Id = Convert.ToInt16(model[1])
                        },
                        Nombre      = model[2].Trim(),
                        Descripcion = model[3].Trim(),
                        Controlador = model[4].Trim(),
                        Metodo      = model[5].Trim(),
                        Parametro   = model[6].Trim(),
                        Url         = model[7].Trim(),
                        Icono       = model[8].Trim(),
                        Orden       = (model[9] == string.Empty) ? 0 : Convert.ToInt16(model[9]),
                        IsPopup     = new ItemGenerico
                        {
                            IntValue = Convert.ToInt16(model[10])
                        },
                        IsVisible = new ItemGenerico
                        {
                            IntValue = Convert.ToInt16(model[11])
                        },
                        IsGrupo = new ItemGenerico
                        {
                            IntValue = Convert.ToInt16(model[12])
                        },
                        RowAudit = new IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        }
                    };

                    oResponse           = new BLMenu().Grabar(Item);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
예제 #30
0
        public ActionResult Formato()
        {
            var strControlador = this.ControllerContext.RouteData.Values["controller"].ToString();
            var strMetodo      = this.ControllerContext.RouteData.Values["action"].ToString();

            if (User != null)
            {
                if (this.IsPermitido())
                {
                    RegistroGastoViewModel model = new RegistroGastoViewModel();
                    var OSE_CID = Peach.DecriptText(User.OrganoServicio_CID);
                    if (OSE_CID == string.Empty)
                    {
                        AddToastMessage("Restricción", "El usuario no esta asociado a un Órgano de Servicio.", BootstrapAlertType.danger);
                        return(View(model));
                    }

                    int    sid_usr = Convert.ToInt16(Peach.DecriptText(User.CID));
                    string ose     = User.OrganoServicio_Nombre;

                    int sid_ose = Convert.ToInt16(Peach.DecriptText(User.OrganoServicio_CID));

                    model.MaxRegistro = new BLFormatoEgreso().Listar_MaximoRegistro(sid_ose) + 1;

                    model.CuentasOse = new BLCuentaCorriente().ListarCuentasCargo(sid_usr)
                                       .Select(q => new SelectListItem {
                        Value = q.CID, Text = q.NumeroCuenta
                    })
                                       .ToList();

                    model.Proveedores = new BLProveedor().Listarby_OSE(sid_ose)
                                        .Select(p => new SelectListItem {
                        Value = p.CID, Text = p.Nombre
                    })
                                        .ToList();

                    model.ItemsClasificador = new BLClasificador().ListarItemsGasto();

                    model.ItemsFormaPago = new BLParametro().ListarItems_byGrupo("FORMATO_FORMA_PAGO")
                                           .Select(p => new SelectListItem {
                        Value = p.Valor, Text = p.Texto
                    })
                                           .ToList();

                    model.ItemsDestinoGasto = new BLParametro().ListarItems_byGrupo("FORMATO_DESTINO_GASTO")
                                              .Select(p => new SelectListItem {
                        Value = p.Valor, Text = p.Texto
                    })
                                              .ToList();

                    model.ItemsProgramasPoliticos = new BLProgramaPolitico().Listar_byOSE(OrganosServicioType.Consulado)
                                                    .Select(p => new SelectListItem {
                        Text = p.Nombre, Value = p.CID
                    })
                                                    .ToList();

                    //var e = Request.ClientCertificate;
                    //X509CertificateStore store = X509CertificateStore.LocalMachineStore(X509CertificateStore.MyStore);
                    //store.OpenRead();

                    return(View(model));
                }
                else
                {
                    AddToastMessage("No permitido", "Esta opcion no esta permitida para su perfil.", BootstrapAlertType.danger);
                    return(RedirectToAction("Index", "Home"));
                }
            }
            else
            {
                return(RedirectToAction("Login", "Account", new { act = "timeout" }));
            }
        }