BExIS.Web.Shell.Areas.DCM.Controllers.CreateDatasetController.LoadDatasetViewList C# (CSharp) Method

LoadDatasetViewList() public method

public LoadDatasetViewList ( ) : List
return List
        public List<ListViewItem> LoadDatasetViewList()
        {
            PermissionManager pm = new PermissionManager();
            SubjectManager subjectManager = new SubjectManager();
            DatasetManager datasetManager = new DatasetManager();
            List<ListViewItem> temp = new List<ListViewItem>();

            //get all datasetsid where the current userer has access to
            long userid = -1;
            if (subjectManager.ExistsUsername(GetUsernameOrDefault()))
                userid = subjectManager.GetUserByName(GetUsernameOrDefault()).Id;

            if (userid != -1)
            {
                foreach (long id in pm.GetAllDataIds(userid, 1, RightType.Update))
                {
                    if (datasetManager.IsDatasetCheckedIn(id))
                    {
                        string title = XmlDatasetHelper.GetInformation(id, NameAttributeValues.title);
                        string description = XmlDatasetHelper.GetInformation(id, NameAttributeValues.description);

                        temp.Add(new ListViewItem(id, title, description));
                    }
                }
            }

            return temp.OrderBy(p => p.Title).ToList();
        }