Exemplo n.º 1
0
        /// <summary>
        /// Devuelve el personal directivo de una mision (diplomaticos y administrativos lima)
        /// </summary>
        /// <param name="id">Id de la cuenta corriente</param>
        /// <returns>BECuentaCorriente</returns>
        public IEnumerable <BEPersonalLocal> Listar_Directivo_toSelect_byOse(int id)
        {
            List <BEPersonalLocal> Personas = new List <BEPersonalLocal>();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Personas.Add(new BEPersonalLocal
                            {
                                CID       = Peach.EncriptText(DataUtil.ObjectToString(dr["i_persid"])),
                                Apellidos = DataUtil.ObjectToString(dr["s_pernom"])
                            });
                        }
                        ;
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Personas);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Devuelve la lista de proveedores de un organo de servicio para el control selector del formato de egreso
        /// </summary>
        /// <param name="sid_ose">Id del proveedor</param>
        /// <returns></returns>
        public IEnumerable <BEProveedor> Listarby_OSE(int sid_ose)
        {
            List <BEProveedor> Proveedores = new List <BEProveedor>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_proveedores_ose, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_sid", SqlDbType.SmallInt).Value = sid_ose;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Proveedores.Add(new BEProveedor
                            {
                                CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Nombre = DataUtil.ObjectToString(dr["s_pro"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Proveedores);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Devuelve un solo perfil de la aplicación
        /// </summary>
        /// <returns></returns>
        public BEPerfil Listar_byId(int Id)
        {
            BEPerfil Perfil = new BEPerfil();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Perfil.CID         = Peach.EncriptText(DataUtil.ObjectToString(dr["i_persid"]));
                            Perfil.Nombre      = DataUtil.ObjectToString(dr["s_pernom"]);
                            Perfil.Abreviatura = DataUtil.ObjectToString(dr["s_perabr"]);
                            Perfil.Descripcion = DataUtil.ObjectToString(dr["s_perdes"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Perfil);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Devuelve todas las entidades públicas.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <BECuentaCorriente> ListarEntidadCuentas_toSelect(int id)
        {
            List <BECuentaCorriente> CuentaCorriente = new List <BECuentaCorriente>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_entidad_cuentas_select, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            CuentaCorriente.Add(new BECuentaCorriente
                            {
                                CID          = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                NumeroCuenta = DataUtil.ObjectToString(dr["s_nro"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(CuentaCorriente);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Devuelve todas las entidades publicas.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <BEEntidadPublica> ListarEntidad_toSelect()
        {
            List <BEEntidadPublica> EntidadPublica = new List <BEEntidadPublica>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_entidad_select, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            EntidadPublica.Add(new BEEntidadPublica
                            {
                                CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Nombre = DataUtil.ObjectToString(dr["s_nom"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(EntidadPublica);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Devuelve los parametros segun el texto de su grupo
        /// </summary>
        /// <param name="Parametro"></param>
        /// <returns></returns>
        public IEnumerable <BEParametroItem> ListarItems_byGrupo(string Grupo)
        {
            List <BEParametroItem> Detalles = new List <BEParametroItem>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listaritems_grupo, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_grupo", SqlDbType.VarChar, 35).Value = Grupo;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Detalles.Add(new BEParametroItem
                            {
                                Texto = DataUtil.ObjectToString(dr["s_tex"]),
                                Valor = Peach.EncriptText(DataUtil.ObjectToString(dr["s_val"]))
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Detalles);
        }
        public ActionResult Perfil(PerfilLoginModel model)
        {
            if (ModelState.IsValid)
            {
                // Ticket de cookie
                CustomPrincipalTicket _dataTicket = new CustomPrincipalTicket
                {
                    CID                   = User.CID,
                    Usuario               = User.Usuario,
                    Unidad_Nombre         = User.Unidad_Nombre,
                    OrganoServicio_CID    = User.OrganoServicio_CID,
                    OrganoServicio_Nombre = User.OrganoServicio_Nombre,
                    OrganoServicio_Abr    = User.OrganoServicio_Abr,
                    Rol_Accion            = User.Rol_Accion,
                    Perfil_CID            = model.Perfil.CID,
                    Perfil_Nombre         = model.SelectPerfil
                };

                SessionHelper.DestroyUserSession();

                JavaScriptSerializer serializer = new JavaScriptSerializer();
                string userData = serializer.Serialize(_dataTicket);
                SessionHelper.AddUserToSession(Peach.EncriptText(userData));
            }
            else
            {
                AddToastMessage("Error", "El modelo de datos de seleccion de perfil no es válido", BootstrapAlertType.danger);
            }

            return(RedirectToAction("Index", "Home"));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Devuelve las regiones asociadas a un continente registrados en la aplicación
        /// </summary>
        /// <returns>IEnumerable BERegion</returns>
        public IEnumerable <BERegion> Listar_Regiones_byContinente(int sid)
        {
            List <BERegion> Regiones = new List <BERegion>();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Regiones.Add(new BERegion
                            {
                                CID       = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Nombre    = DataUtil.ObjectToString(dr["s_nom"]),
                                CodigoONU = DataUtil.ObjectToString(dr["s_onu"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Regiones);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Devuelve los datos de organos de servicio para un control selector
        /// </summary>
        /// <param name="Tipo">0: Todos, [1-4] Tipos de Órganos de Servicio</param>
        /// <returns></returns>
        public IEnumerable <BEOrganoServicio> Listar_ToSelect(OrganosServicioType Tipo)
        {
            List <BEOrganoServicio> OrganosServicio = new List <BEOrganoServicio>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_select, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_tip", SqlDbType.SmallInt).Value = Tipo;

                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            OrganosServicio.Add(new BEOrganoServicio
                            {
                                CID         = Peach.EncriptText(DataUtil.ObjectToString(dr["i_osesid"])),
                                Abreviatura = DataUtil.ObjectToString(dr["s_oseabr"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(OrganosServicio);
        }
Exemplo n.º 10
0
        //: Selector agencias de bancos intermedios
        /// <summary>
        /// Devuelves todas las agencias de uso intermedio para transferencias bancarias.
        /// </summary>
        public IEnumerable <BEAgenciaBancaria> ListarAgencias_BancoIntermedios_toSelect()
        {
            List <BEAgenciaBancaria> Agencias = new List <BEAgenciaBancaria>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listarintermedios_toselect, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Agencias.Add(new BEAgenciaBancaria
                            {
                                CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_agesid"])),
                                Nombre = DataUtil.ObjectToString(dr["s_agenom"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Agencias);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Devuelve todos los continentes registrados en la aplicación
        /// </summary>
        /// <returns>IEnumerable BEContinente</returns>
        public IEnumerable <BEContinente> Listar_Continentes()
        {
            List <BEContinente> Continentes = new List <BEContinente>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_continentes, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Continentes.Add(new BEContinente
                            {
                                CID       = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Nombre    = DataUtil.ObjectToString(dr["s_nom"]),
                                CodigoONU = DataUtil.ObjectToString(dr["s_onu"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Continentes);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Devuelve las cuentas de cargo para el formato de egreso
        /// </summary>
        /// <returns></returns>
        public IEnumerable <BECuentaCorriente> ListarCuentasCargo(int sid_usr)
        {
            List <BECuentaCorriente> Cuentas = new List <BECuentaCorriente>();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Cuentas.Add(new BECuentaCorriente
                            {
                                CID          = Peach.EncriptText(DataUtil.ObjectToString(dr["i_ctasid"])),
                                NumeroCuenta = DataUtil.ObjectToString(dr["s_resumn"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Cuentas);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Devuelve las monedas vinculadas al pais del personal local
        /// </summary>
        /// <param name="id">Id del Personal Local</param>
        /// <returns>IEnumerables Moneda</returns>
        public IEnumerable <BEMoneda> Listar_Select_byPL(int id)
        {
            List <BEMoneda> Monedas = new List <BEMoneda>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_byPersonalLocal, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_sid", SqlDbType.SmallInt).Value = id;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Monedas.Add(new BEMoneda
                            {
                                CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Nombre = DataUtil.ObjectToString(dr["s_nom"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Monedas);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Devuelve la lista completa de paises para el control selector
        /// </summary>
        /// <returns></returns>
        public IEnumerable <BEPais> Listar_ToSelect()
        {
            List <BEPais> Paises = new List <BEPais>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Paises.Add(new BEPais
                            {
                                CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Nombre = DataUtil.ObjectToString(dr["s_pai"]),
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Paises);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Devuelve la lista de organos de servicio exterior.
        ///
        /// </summary>
        /// <returns></returns>
        /// TODO: Factorizar el  método en la capa de negocios
        public List <SelectListItem> GetOrganosServicio()
        {
            SelectListItem NingunOSE = new SelectListItem {
                Text = "- OFICINA LIMA - ", Value = Peach.EncriptText("0")
            };
            List <SelectListItem> IOrganosServicio = new List <SelectListItem>();

            IOrganosServicio.Add(NingunOSE);
            IOrganosServicio.AddRange(new SelectList(
                                          new BLOrganoServicio().Listar_ToSelect(OrganosServicioType.Todos), "CID", "Abreviatura"));
            return(IOrganosServicio);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Devuelve todos los paises para llenar el control datatable
        /// </summary>
        /// <param name="pageNumber">Número de página</param>
        /// <param name="pageRows">Cantidad de registros por página</param>
        /// <param name="search">Buscador</param>
        /// <param name="sort">Orden</param>
        /// <param name="dir">Dirección del orden</param>
        /// <param name="totalRows">Total de registros</param>
        /// <returns></returns>
        public IEnumerable <BEPais> Listar_toDataTables(int pageNumber, int pageRows, string search, int sort, string dir, ref int totalRows)
        {
            List <BEPais> Paises = new List <BEPais>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_toDT, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_page_nmber", SqlDbType.Int).Value          = pageNumber;
                    oComando.Parameters.Add("@p_page_rows", SqlDbType.Int).Value           = pageRows;
                    oComando.Parameters.Add("@p_page_search", SqlDbType.VarChar, 35).Value = search;
                    oComando.Parameters.Add("@p_page_sort", SqlDbType.Int).Value           = sort;
                    oComando.Parameters.Add("@p_page_dir", SqlDbType.VarChar, 4).Value     = dir;

                    oComando.Parameters.Add("@p_rows_totl", SqlDbType.Int).Direction = ParameterDirection.Output;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Paises.Add(new BEPais
                            {
                                Row = DataUtil.ObjectToInt(dr["i_row"]),
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),

                                Nombre  = DataUtil.ObjectToString(dr["s_pai"]),
                                Oficial = DataUtil.ObjectToString(dr["s_nof"]),
                                Region  = new BERegion
                                {
                                    Nombre     = DataUtil.ObjectToString(dr["s_rnm"]),
                                    Continente = new BEContinente
                                    {
                                        Nombre = DataUtil.ObjectToString(dr["s_cnm"]),
                                    }
                                },
                            });
                        }
                    }
                    totalRows = DataUtil.ObjectToInt(oComando.Parameters["@p_rows_totl"].Value);
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Paises);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Devuelve un órgano de servicio especificado por el Id
        /// </summary>
        /// <param name="IdOrganoServicio">Id principal</param>
        /// <returns></returns>
        public BEOrganoServicio Listar_byId(int IdOrganoServicio)
        {
            BEOrganoServicio OrganosDeServicio = new BEOrganoServicio();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            OrganosDeServicio = new BEOrganoServicio
                            {
                                Nombre      = DataUtil.ObjectToString(dr["s_osenom"]),
                                Abreviatura = DataUtil.ObjectToString(dr["s_oseabr"]),

                                Pais = new BEPais {
                                    CID    = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_paisid"])),
                                    Nombre = DataUtil.ObjectToString(dr["s_painom"])
                                },

                                JefaturaServicio = new ItemGenerico
                                {
                                    StrValue = Peach.EncriptText(DataUtil.ObjectToString(dr["i_osejef"])),
                                    Texto    = DataUtil.ObjectToString(dr["s_osejef"])
                                },

                                CodigoInterop = DataUtil.ObjectToString(dr["i_osecod"]),

                                TipoOrgano = new ItemGenerico {
                                    StrValue = Peach.EncriptText(DataUtil.ObjectToString(dr["i_tipsid"])),
                                    Texto    = DataUtil.ObjectToString(dr["s_tipnom"])
                                },
                            };
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(OrganosDeServicio);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Devuelve todos las monedas para llenar el control datatable
        /// </summary>
        /// <param name="pageNumber">Número de página</param>
        /// <param name="pageRows">Cantidad de registros por página</param>
        /// <param name="search">Buscador</param>
        /// <param name="sort">Orden</param>
        /// <param name="dir">Dirección del orden</param>
        /// <param name="totalRows">Total de registros</param>
        /// <returns></returns>
        public IEnumerable <BEMoneda> Listar_toDataTables(int pageNumber, int pageRows, string search, int sort, string dir, ref int totalRows)
        {
            List <BEMoneda> Monedas = new List <BEMoneda>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_toDT, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_page_nmber", SqlDbType.Int).Value          = pageNumber;
                    oComando.Parameters.Add("@p_page_rows", SqlDbType.Int).Value           = pageRows;
                    oComando.Parameters.Add("@p_page_search", SqlDbType.VarChar, 35).Value = search;
                    oComando.Parameters.Add("@p_page_sort", SqlDbType.Int).Value           = sort;
                    oComando.Parameters.Add("@p_page_dir", SqlDbType.VarChar, 4).Value     = dir;

                    oComando.Parameters.Add("@p_rows_totl", SqlDbType.Int).Direction = ParameterDirection.Output;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Monedas.Add(new BEMoneda
                            {
                                Row = DataUtil.ObjectToInt(dr["i_row"]),
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),

                                Nombre         = DataUtil.ObjectToString(dr["s_nom"]),
                                Abreviatura    = DataUtil.ObjectToString(dr["s_abr"]),
                                SufijoContable = DataUtil.ObjectToString(dr["s_suf"]),
                                Simbolo        = DataUtil.ObjectToString(dr["s_sim"]),
                                ISO4217        = DataUtil.ObjectToString(dr["s_iso"]),
                                Asignable      = new ItemGenerico
                                {
                                    Texto    = DataUtil.ObjectToString(dr["s_asg"]),
                                    IntValue = DataUtil.ObjectToInt(dr["i_asg"])
                                }
                            });
                        }
                    }
                    totalRows = DataUtil.ObjectToInt(oComando.Parameters["@p_rows_totl"].Value);
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Monedas);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Devuelve la lista completa de paises
        /// </summary>
        /// <returns></returns>
        public IEnumerable <BEPais> Listar()
        {
            List <BEPais> Paises = new List <BEPais>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Paises.Add(new BEPais
                            {
                                Row = DataUtil.ObjectToInt(dr["i_row"]),
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),

                                Nombre     = DataUtil.ObjectToString(dr["s_pai"]),
                                Oficial    = DataUtil.ObjectToString(dr["s_nof"]),
                                Gentilicio = DataUtil.ObjectToString(dr["s_gen"]),
                                M49        = DataUtil.ObjectToString(dr["s_m49"]),
                                ISOA3      = DataUtil.ObjectToString(dr["s_iso"]),
                                Region     = new BERegion
                                {
                                    CID        = Peach.EncriptText(DataUtil.ObjectToString(dr["i_rid"])),
                                    Nombre     = DataUtil.ObjectToString(dr["s_rnm"]),
                                    CodigoONU  = DataUtil.ObjectToString(dr["s_ron"]),
                                    Continente = new BEContinente
                                    {
                                        CID       = Peach.EncriptText(DataUtil.ObjectToString(dr["i_cid"])),
                                        Nombre    = DataUtil.ObjectToString(dr["s_cnm"]),
                                        CodigoONU = DataUtil.ObjectToString(dr["s_con"])
                                    }
                                },
                                Monedas_Asg = DataUtil.ObjectToString(dr["s_mas"]),
                                Monedas_Lcl = DataUtil.ObjectToString(dr["s_mlc"])
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Paises);
        }
Exemplo n.º 20
0
        /// <summary>
        /// Devuelve la lista de aportes y descuentos para el trabajador del OSE
        /// </summary>
        /// <param name="IdContrato"></param>
        /// <returns></returns>
        public IEnumerable <BEAporteDeduccion> Listar_AportesDescuentos(int IdContrato)
        {
            List <BEAporteDeduccion> Aportes = new List <BEAporteDeduccion>();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Aportes.Add(new BEAporteDeduccion
                            {
                                CID      = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Concepto = new ItemGenerico
                                {
                                    Texto = DataUtil.ObjectToString(dr["s_con"])
                                },
                                Descripcion = DataUtil.ObjectToString(dr["s_des"]),
                                Operacion   = new ItemGenerico
                                {
                                    Texto = DataUtil.ObjectToString(dr["s_inc"])
                                },
                                Afectacion = new ItemGenerico
                                {
                                    Texto = DataUtil.ObjectToString(dr["s_afe"])
                                },
                                TipoAfectacion = new ItemGenerico
                                {
                                    Texto = DataUtil.ObjectToString(dr["s_tpo"])
                                },
                                MontoAfectacion = DataUtil.ObjectToString(dr["i_mon"])
                            });
                        }
                        ;
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Aportes);
        }
Exemplo n.º 21
0
        public ActionResult Signup()
        {
            SignUpViewModel model     = new SignUpViewModel();
            SelectListItem  NingunOSE = new SelectListItem {
                Text = "- NINGUNO - ", Value = Peach.EncriptText("0")
            };
            List <SelectListItem> IOrganosServicio = new List <SelectListItem>();

            IOrganosServicio.Add(NingunOSE);
            IOrganosServicio.AddRange(new SelectList(
                                          new BLOrganoServicio().Listar_ToSelect(OrganosServicioType.Todos), "CID", "Abreviatura"));

            model.OrganosDeServicio = IOrganosServicio;
            return(View(model));
        }
Exemplo n.º 22
0
        /// <summary>
        /// Devuelve todos las unidades orgánicas para llenar el control datatable
        /// </summary>
        /// <param name="pageNumber">Número de página</param>
        /// <param name="pageRows">Cantidad de registros por página</param>
        /// <param name="search">Buscador</param>
        /// <param name="sort">Orden</param>
        /// <param name="dir">Dirección del orden</param>
        /// <param name="totalRows">Total de registros</param>
        /// <returns></returns>
        public IEnumerable <BEUnidad> Listar_toDataTables(int pageNumber, int pageRows, string search, int sort, string dir, ref int totalRows)
        {
            List <BEUnidad> Unidades = new List <BEUnidad>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_toDT, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_page_nmber", SqlDbType.Int).Value          = pageNumber;
                    oComando.Parameters.Add("@p_page_rows", SqlDbType.Int).Value           = pageRows;
                    oComando.Parameters.Add("@p_page_search", SqlDbType.VarChar, 35).Value = search;
                    oComando.Parameters.Add("@p_page_sort", SqlDbType.Int).Value           = sort;
                    oComando.Parameters.Add("@p_page_dir", SqlDbType.VarChar, 4).Value     = dir;

                    oComando.Parameters.Add("@p_rows_totl", SqlDbType.Int).Direction = ParameterDirection.Output;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Unidades.Add(new BEUnidad
                            {
                                Row = DataUtil.ObjectToInt(dr["i_row"]),
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_idu"])),

                                Nombre         = DataUtil.ObjectToString(dr["s_nom"]),
                                Abreviatura    = DataUtil.ObjectToString(dr["s_abr"]),
                                Descripcion    = DataUtil.ObjectToString(dr["s_des"]),
                                UnidadSuperior = new ItemGenerico
                                {
                                    StrValue = DataUtil.ObjectToString(dr["s_usp"])
                                }
                            });
                        }
                    }
                    totalRows = DataUtil.ObjectToInt(oComando.Parameters["@p_rows_totl"].Value);
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Unidades);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Devuelve los datos de un Pais
        /// </summary>
        /// <param name="sid">Id del País</param>
        /// <returns></returns>
        public BEPais Listar_byId(int sid)
        {
            BEPais Pais = new BEPais();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Pais.CID        = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"]));
                            Pais.Nombre     = DataUtil.ObjectToString(dr["s_pai"]);
                            Pais.Oficial    = DataUtil.ObjectToString(dr["s_nof"]);
                            Pais.Gentilicio = DataUtil.ObjectToString(dr["s_gen"]);
                            Pais.M49        = DataUtil.ObjectToString(dr["s_m49"]);
                            Pais.ISOA3      = DataUtil.ObjectToString(dr["s_iso"]);
                            Pais.Region     = new BERegion
                            {
                                CID        = Peach.EncriptText(DataUtil.ObjectToString(dr["i_rid"])),
                                Nombre     = DataUtil.ObjectToString(dr["s_rnm"]),
                                Continente = new BEContinente
                                {
                                    CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_cid"])),
                                    Nombre = DataUtil.ObjectToString(dr["s_cnm"])
                                }
                            };
                        }
                    }
                    Pais.Monedas = new DAMoneda().Listar_byPais(sid);
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Pais);
        }
        /// <summary>
        /// Devuelve las Jefaturas de Servicio (Consulados)
        /// </summary>
        /// <param name="sid">Código de País</param>
        /// <returns></returns>
        public ActionResult dklHc0hk(string sid)
        {
            /*
             * Nota:
             * - Sólo los consulados son considerados Jefaturas de Servicios
             */

            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        string s_sid = (sid != "0") ? Peach.DecriptFromBase64(sid) : "0";
                        int    i_sid = Convert.ToInt16(s_sid);

                        // Jefatura de Servicio
                        List <SelectListItem> Items = new List <SelectListItem>();
                        Items.Add(new SelectListItem {
                            Text = "- NINGUNO -", Value = Peach.EncriptText("0")
                        });
                        Items.AddRange(
                            new BLOrganoServicio().Listar_byTipoPais_ToSelect(OrganosServicioType.Consulado, i_sid)
                            .Select(p => new SelectListItem {
                            Text = p.Abreviatura, Value = p.CID
                        })
                            .ToList());

                        globalResponse.DATA = Items;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 25
0
        //: Agencias


        /// <summary>
        /// Devuelve todas las agencias bancarias asociadas a un banco o solo una.
        /// </summary>
        /// <param name="idb">Id banco</param>
        public IEnumerable <BEAgenciaBancaria> ListarAgencias(int idb)
        {
            List <BEAgenciaBancaria> Agencias = new List <BEAgenciaBancaria>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_agencia, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_ida", SqlDbType.Int).Value = 0;
                    oComando.Parameters.Add("@p_idb", SqlDbType.Int).Value = idb;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Agencias.Add(new BEAgenciaBancaria
                            {
                                Row        = DataUtil.ObjectToInt(dr["i_row"]),
                                CID        = Peach.EncriptText(DataUtil.ObjectToString(dr["i_age"])),
                                Nombre     = DataUtil.ObjectToString(dr["s_nom"]),
                                Direccion1 = DataUtil.ObjectToString(dr["s_di1"]),
                                Direccion2 = DataUtil.ObjectToString(dr["s_di2"]),
                                Tipo       = new ItemGenerico
                                {
                                    Texto = DataUtil.ObjectToString(dr["s_tip"])
                                },
                                Pais = new BEPais
                                {
                                    Nombre = DataUtil.ObjectToString(dr["s_pai"])
                                }
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Agencias);
        }
Exemplo n.º 26
0
        /// <summary>
        /// Devuelve los datos de una agencia especificada por su Id.
        /// </summary>
        /// <param name="ida">Id agencia</param>
        public BEAgenciaBancaria ListarAgencia(int ida)
        {
            BEAgenciaBancaria AgenciaBancaria = new BEAgenciaBancaria();
            string            id = string.Empty;

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar_agencia, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_idb", SqlDbType.Int).Value = 0;
                    oComando.Parameters.Add("@p_ida", SqlDbType.Int).Value = ida;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            AgenciaBancaria.CID        = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_age"]));
                            AgenciaBancaria.Nombre     = DataUtil.ObjectToString(dr["s_nom"]);
                            AgenciaBancaria.Direccion1 = DataUtil.ObjectToString(dr["s_di1"]);
                            AgenciaBancaria.Direccion2 = DataUtil.ObjectToString(dr["s_di2"]);
                            AgenciaBancaria.Tipo       = new ItemGenerico
                            {
                                StrValue = Peach.EncriptText(DataUtil.ObjectToString(dr["i_tip"])),
                                Texto    = DataUtil.ObjectToString(dr["s_tip"])
                            };
                            AgenciaBancaria.Pais = new BEPais
                            {
                                CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_pai"])),
                                Nombre = DataUtil.ObjectToString(dr["s_pai"])
                            };
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(AgenciaBancaria);
        }
Exemplo n.º 27
0
        /// <summary>
        /// Devuelve todas las monedas registradas en la aplicación
        /// </summary>
        /// <returns>IEnumerable BEPais</returns>
        public IEnumerable <BEMoneda> Listar()
        {
            List <BEMoneda> Monedas = new List <BEMoneda>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Monedas.Add(new BEMoneda
                            {
                                Row = DataUtil.ObjectToInt(dr["i_row"]),
                                CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),

                                Nombre         = DataUtil.ObjectToString(dr["s_nom"]),
                                Abreviatura    = DataUtil.ObjectToString(dr["s_abr"]),
                                SufijoContable = DataUtil.ObjectToString(dr["s_suf"]),
                                Simbolo        = DataUtil.ObjectToString(dr["s_sim"]),
                                ISO4217        = DataUtil.ObjectToString(dr["s_iso"]),
                                Asignable      = new ItemGenerico
                                {
                                    Texto    = DataUtil.ObjectToString(dr["s_asg"]),
                                    IntValue = DataUtil.ObjectToInt(dr["i_asg"])
                                }
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Monedas);
        }
Exemplo n.º 28
0
        /// <summary>
        /// Lista los items correspondientes a un parámetro especificado en el enumerador
        /// </summary>
        /// <param name="Parametro">Enumerador parámetro</param>
        /// <returns>Lista de items pertenecientes al parámetro</returns>
        public IEnumerable <BEParametroItem> ListarDetalle(Parametros Parametro)
        {
            List <BEParametroItem> Detalles = new List <BEParametroItem>();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_listarDetalle, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;
                    oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value = Parametro;
                    oComando.Parameters.Add("@p_idd", SqlDbType.Int).Value = 0;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Detalles.Add(new BEParametroItem
                            {
                                CID     = Peach.EncriptText(DataUtil.ObjectToString(dr["i_idd"])),
                                Texto   = DataUtil.ObjectToString(dr["s_tex"]),
                                Valor   = Peach.EncriptText(DataUtil.ObjectToString(dr["s_val"])),
                                Ayuda   = DataUtil.ObjectToString(dr["s_ayu"]),
                                Orden   = DataUtil.ObjectToInt(dr["i_ord"]),
                                IsGrupo = new ItemGenerico
                                {
                                    Texto    = DataUtil.ObjectToString(dr["s_gru"]),
                                    IntValue = DataUtil.ObjectToInt(dr["i_gru"])
                                }
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Detalles);
        }
Exemplo n.º 29
0
        // Lista todos los parametros de la aplicación
        public IEnumerable <BEParametro> Listar()
        {
            List <BEParametro> Parametros = new List <BEParametro>();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Parametros.Add(new BEParametro
                            {
                                Row         = DataUtil.ObjectToInt(dr["i_row"]),
                                CID         = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])),
                                Nombre      = DataUtil.ObjectToString(dr["s_nom"]),
                                Descripcion = DataUtil.ObjectToString(dr["s_des"]),
                                Grupo       = new BEParametroGrupo
                                {
                                    CID    = Peach.EncriptText(DataUtil.ObjectToString(dr["i_grp"])),
                                    Nombre = DataUtil.ObjectToString(dr["s_grp"])
                                }
                            });
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Parametros);
        }
Exemplo n.º 30
0
        /// <summary>
        /// Devuelve los datos de una moneda según su id
        /// </summary>
        /// <param name="id">Id de la moneda</param>
        /// <returns>BEMoneda</returns>
        public BEMoneda Listar_byId(int id)
        {
            BEMoneda Moneda = new BEMoneda();

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

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Moneda.CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"]));

                            Moneda.Nombre         = DataUtil.ObjectToString(dr["s_nom"]);
                            Moneda.Abreviatura    = DataUtil.ObjectToString(dr["s_abr"]);
                            Moneda.SufijoContable = DataUtil.ObjectToString(dr["s_suf"]);
                            Moneda.Simbolo        = DataUtil.ObjectToString(dr["s_sim"]);
                            Moneda.ISO4217        = DataUtil.ObjectToString(dr["s_iso"]);
                            Moneda.Asignable      = new ItemGenerico
                            {
                                IntValue = DataUtil.ObjectToInt16(dr["i_asg"]),
                                Texto    = DataUtil.ObjectToString(dr["s_asg"])
                            };
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Moneda);
        }