private void btnParticipantAdd_Click(object sender, RoutedEventArgs e) { var accountList = service.GetAllAccounts().ToList(); foreach (var acc in service.GetAccountListByProjectId(currentProject.Id)) { var ac = accountList.FirstOrDefault(a => a.Id == acc.Id); accountList.Remove(ac); } var pl = new SelectAccountWindows(service, accountList); if (pl.ShowDialog() == true) { service.AddParticipant(User.Instance.Account.Id, pl.SelectAccountId, currentProject.Id); UpdateParcitipantList(currentProject.Id); } }
private void btnExecutorAdd_Click(object sender, RoutedEventArgs e) { var accountList = service.GetAccountListByProjectId(currentTask.Project.Id).ToList(); foreach (var acc in service.GetAccountListByTaskId(currentTask.Id)) { var ac = accountList.FirstOrDefault(a => a.Id == acc.Id); accountList.Remove(ac); } var pl = new SelectAccountWindows(service, accountList); if (pl.ShowDialog() == true) { service.AddExecutor(User.Instance.Account.Id, pl.SelectAccountId, currentTask.Id); UpdateExecutorList(currentTask.Id); } }