static void LoadUsersThread() { Thread y = new Thread(LoadCertificateAgents); y.Start(); AgentDataAccess db = new AgentDataAccess(); globalListAgents = db.LoadAllAgents(); }
static void LoadUsersThread() { //Thread y = new Thread(LoadCertificateAgents); //y.Start(); using (AgentDataAccess dbRep = new AgentDataAccess()) { globalListAgents = dbRep.LoadAllAgents(); UC_Certification.staticDataSource = UC_Certification.GetDataSourceStatic(globalListAgents.ToPagedList(1, globalListAgents.Count())); } }
private void RemoveUserFromGroup_CLick(object sender, EventArgs e) { AgentDataAccess agentDataAccess = new AgentDataAccess(); var agent = AgentDataAccess.LoadSingleUserWithMatricule(UserIDSelected); DialogResult res = MessageBox.Show("Etes-vous certain de vouloir retirer l'agent " + agent.Agent_FullName + "du groupe?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (res == DialogResult.Yes) { grpLearnearAgentRepository.RemoveAgentFromGroup(agent, SelectedGrpLearner); listAgentPaged = grpLearnearAgentRepository.LoadAgentOfSelectedGroup(SelectedGrpLearner).ToPagedList(1, 50); dgGrpAgent.DataSource = GetDataSource(listAgentPaged); } }