private List <OptionList> LoadRoles()
        {
            var lst = new List <OptionList>();

            foreach (Rol rol in crudRol.RetrieveAll <Rol>())
            {
                var option = new OptionList
                {
                    ListId = "LST_ROL",
                    Codigo = rol.Codigo,
                    Nombre = rol.Nombre
                };
                lst.Add(option);
            }
            return(lst);
        }
        public List <OptionList> RetrieveById(OptionList option)
        {
            try
            {
                if (dicListOptions.ContainsKey(option.ListId))
                {
                    return(dicListOptions[option.ListId]);
                }
                else
                {
                    //    //BUSCA EN OTRO MANAGER
                    if (option.ListId.Equals("TROL"))
                    {
                        var crudRol = new RolCrudFactory();
                        var lst     = crudRol.RetrieveAll <Rol>();

                        var lstResult = new List <OptionList>();

                        foreach (var c in lst)
                        {
                            if (c.estadoRol.Equals("Activo"))
                            {
                                var newOption = new OptionList
                                {
                                    ListId      = option.ListId,
                                    Value       = c.nombreRol,
                                    Description = c.idRol.ToString()
                                };
                                lstResult.Add(newOption);
                            }
                        }
                        return(lstResult);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }

            return(new List <OptionList>());;
        }
Esempio n. 3
0
 public List <Rol> RetrieveAll()
 {
     return(crudRol.RetrieveAll <Rol>());
 }