private void PopulateRecieverTreeView() { bool success = false; List <BllGroup> groups = null; while (!success) { try { IGroupGetter gg = new GroupGetter(serverInstance.server); groups = gg.GetAllGroups(); success = true; } catch { serverInstance.ConnectToServer(); success = false; } } foreach (var group in groups) { var node = treeView1.Nodes.Add(group.Name); List <BllUser> usersByGroup = new List <BllUser>(); success = false; while (!success) { try { IUserGetter ug = new UserGetter(serverInstance.server); usersByGroup = ug.GetUsersByGroupAndSignInDateRange(group, int.Parse(Properties.Resources.PERMISSIBLE_DATE_RANGE_IN_DAYS)); success = true; } catch { serverInstance.ConnectToServer(); success = false; } } foreach (var user in usersByGroup) { if (user.Id != Sender.Id) { node.Nodes.Add(user.Fullname); Users.Add(user); } } } }
private IEnumerable <BllUser> GetUserByGroups(BllGroup group) { IEnumerable <BllUser> users = null; bool success = false; while (!success) { try { IUserGetter ug = new UserGetter(serverInstance.server); users = ug.GetUsersByGroupAndSignInDateRange(group, int.Parse(Properties.Resources.PERMISSIBLE_DATE_RANGE_IN_DAYS)); success = true; } catch { serverInstance.ConnectToServer(); success = false; } } return(users); }