private void Fill_trvAccessLevel_AccessGroups(decimal accessGroupID) { string[] retMessage = new string[4]; try { this.InitializeCulture(); string ImageUrl = "Images/TreeView/folder.gif"; string ImagePath = "Images\\TreeView\\folder.gif"; this.hfAccessLevelsList_AccessGroups.Value = string.Empty; IList <PrecardGroups> PrecardGroupsList = this.AccessGroupBusiness.GetPrecardTree(accessGroupID); foreach (PrecardGroups precardGroupsItem in PrecardGroupsList) { TreeViewNode trvNodePrecardGroups = new TreeViewNode(); trvNodePrecardGroups.Text = precardGroupsItem.Name; trvNodePrecardGroups.ID = precardGroupsItem.ID.ToString(); if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + ImagePath)) { trvNodePrecardGroups.ImageUrl = ImageUrl; } IList <Precard> PrecardList = this.AccessGroupBusiness.GetPrecardGroupChilds(precardGroupsItem.ID); PrecardList = PrecardList.Where(x => x.ContainInPrecardAccessGroup).ToList(); if (PrecardList.Count != 0) { foreach (Precard precardItem in PrecardList) { TreeViewNode trvNodePreCard = new TreeViewNode(); trvNodePreCard.Text = precardItem.Name; trvNodePreCard.ID = precardItem.ID.ToString(); if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + ImagePath)) { trvNodePreCard.ImageUrl = ImageUrl; } trvNodePrecardGroups.Nodes.Add(trvNodePreCard); } this.trvAccessLevel_AccessGroups.Nodes.Add(trvNodePrecardGroups); } else { trvNodePrecardGroups.Dispose(); } } } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_AccessLevel.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_AccessLevel.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_AccessLevel.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } }