예제 #1
0
        public List <ModelViewUsers> GetAllList()
        {
            var NegocioEmpleado = new BusinessEmployee();
            var NegocioModulos  = new BusinessModuleService();
            var usuarios        = GetAll();
            var empleados       = NegocioEmpleado.GetAll();
            var modulos         = NegocioModulos.GetAll();
            var lt = (from a in usuarios
                      join b in empleados on a.UserID equals b.FK_UserID
                      join c in modulos on b.FK_ModuleID equals c.ModuleID
                      select new ModelViewUsers()
            {
                UserID = a.UserID,
                ProfileID = a.ProfileID,
                UserName = a.UserName,
                Name = a.Name,
                Email = a.Email,
                Status = a.Status,
                DateCreate = a.DateCreate,
                DateLastAccess = a.DateLastAccess,
                DateModification = a.DateModification,
                EmployyeID = b.EmployeeID,
                Module = c.ID + " - " + c.Base
            }).ToList();

            return(lt);
        }
        public List <ModelViewUserNotification> GetAllNotificationUsers(string ModuleID, string Name)
        {
            var NegocioUsuario     = new BusinessUsers();
            var NegocioEmpleado    = new BusinessEmployee();
            var NegocioModulosMabe = new BusinessModuleService();
            // var usuarios = NegocioUsuario.GetActives().Where(p=> p.ProfileID == 4);
            var empleados = NegocioEmpleado.GetAll();
            var modulos   = new List <EntityModuleService>();
            var usuarios  = new List <ModelViewUserList>();

            if (ModuleID != null)
            {
                int[] nums = ModuleID.Split(',').Select(int.Parse).ToArray();
                modulos = NegocioModulosMabe.GetAll().Where(p => nums.Contains(p.ModuleID)).ToList();
            }
            else
            {
                modulos = NegocioModulosMabe.GetAll();
            }

            if (Name != "")
            {
                usuarios = NegocioUsuario.GetActives().Where(p => p.ProfileID == 4 && (p.Name.ToLower().Contains(Name.ToLower()) || p.UserName.Contains(Name))).ToList();
            }
            else
            {
                usuarios = NegocioUsuario.GetActives();
            }

            return((from a in usuarios
                    join b in empleados on a.UserID equals b.FK_UserID
                    join c in modulos on b.FK_ModuleID equals c.ModuleID
                    select new ModelViewUserNotification()
            {
                UserID = a.UserID,
                Name = "(" + a.UserName + ")" + " " + b.FirstName + " " + b.LastName + " " + c.ID + " - " + c.Base
            }).ToList());
        }
        public List <ModelViewUserNotification> GetAllNotificationUsers(string Employee)
        {
            var NegocioUsuario     = new BusinessUsers();
            var NegocioEmpleado    = new BusinessEmployee();
            var NegocioModulosMabe = new BusinessModuleService();
            var empleados          = NegocioEmpleado.GetAll();
            var modulos            = new List <EntityModuleService>();
            var usuarios           = new List <ModelViewUserList>();

            modulos = NegocioModulosMabe.GetAll();

            int[] nums = Employee.Split(',').Select(int.Parse).ToArray();
            usuarios = NegocioUsuario.GetActives().Where(p => nums.Contains(p.UserID)).ToList();

            return((from a in usuarios
                    join b in empleados on a.UserID equals b.FK_UserID
                    join c in modulos on b.FK_ModuleID equals c.ModuleID
                    select new ModelViewUserNotification()
            {
                UserID = a.UserID,
                Name = "(" + a.UserName + ")" + " " + b.FirstName + " " + b.LastName + " " + c.ID + " - " + c.Base
            }).ToList());
        }