예제 #1
0
        //
        // CUSTOM FUNCTION
        //
        public DTO.SearchFilterData GetSearchFilter(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.SearchFilterData data = new DTO.SearchFilterData();
            data.Factories           = new List <Support.DTO.Factory>();
            data.InternalCompanies   = new List <Support.DTO.InternalCompany>();
            data.InternalDepartments = new List <Support.DTO.InternalDepartment>();
            data.JobLevels           = new List <Support.DTO.JobLevel>();
            data.Locations           = new List <Support.DTO.Location>();
            data.Offices             = new List <Support.DTO.Office>();
            data.UserGroups          = new List <Support.DTO.UserGroup>();

            //try to get data
            try
            {
                data.Factories           = supportFactory.GetFactory().ToList();
                data.InternalCompanies   = supportFactory.GetInternalCompany().ToList();
                data.InternalDepartments = supportFactory.GetInternalDepartment().ToList();
                data.JobLevels           = supportFactory.GetJobLevel().ToList();
                data.Locations           = supportFactory.GetLocation().ToList();
                data.Offices             = supportFactory.GetOffice().ToList();
                data.UserGroups          = supportFactory.GetUserGroup().ToList();
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }