public void Refresh() { WaveguideDB wgDB = new WaveguideDB(); bool success = wgDB.GetAllUsers(); Users.Clear(); if (success) { for (int i = 0; i < wgDB.m_userList.Count(); i++) { UserItem uitem = new UserItem(); uitem.UserID = wgDB.m_userList[i].UserID; uitem.Fullname = wgDB.m_userList[i].Lastname + ", " + wgDB.m_userList[i].Firstname; uitem.AssignedToProject = false; bool IsAssigned = new bool(); IsAssigned = false; success = wgDB.IsUserAssignedToProject(wgDB.m_userList[i].UserID, ProjectID, ref IsAssigned); if (success) { uitem.AssignedToProject = IsAssigned; } Users.Add(uitem); } } }
public bool GetUserList() { bool success = true; if (m_db.GetAllUsers()) { m_vm.users = m_db.m_userList; } else { success = false; } return(success); }
public void Refresh() { Users.Clear(); bool success = wgDB.GetAllUsers(); if (success) { for (int i = 0; i < wgDB.m_userList.Count(); i++) { UserSimple user = new UserSimple(); user.Firstname = wgDB.m_userList[i].Firstname; user.Lastname = wgDB.m_userList[i].Lastname; user.Username = wgDB.m_userList[i].Username; user.Role = wgDB.m_userList[i].Role; user.UserID = wgDB.m_userList[i].UserID; user.Password = wgDB.m_userList[i].Password; Users.Add(user); ObservableCollection <ProjectContainer> projects; success = wgDB.GetAllProjectsForUser(user.UserID, out projects); if (success) { for (int j = 0; j < projects.Count(); j++) { if (!projects[j].Archived) { ProjectFullname pfn = new ProjectFullname(); pfn.Fullname = projects[j].Description; user.Projects.Add(pfn); } } } } int count = Users.Count(); } }
public bool GetUserList() { #if (SIMULATE) m_vm.users.Clear(); UserContainer user = new UserContainer(); user.Firstname = "Bryan"; user.Lastname = "Greenway"; user.Password = "******"; user.Role = GlobalVars.USER_ROLE_ENUM.ADMIN; user.UserID = 1; user.Username = "******"; m_vm.users.Add(user); user = new UserContainer(); user.Firstname = "Dave"; user.Lastname = "Weaver"; user.Password = "******"; user.Role = GlobalVars.USER_ROLE_ENUM.ADMIN; user.UserID = 2; user.Username = "******"; m_vm.users.Add(user); return(true); #else bool success = true; if (m_db.GetAllUsers()) { m_vm.users = m_db.m_userList; } else { success = false; } return(success); #endif }