Beispiel #1
0
        private void ImportProjects()
        {
            Projects.Clear();
            var projectsData = group == null?projects.GetProjects() : projects.GetProjects(group.ID);

            foreach (var project in projectsData)
            {
                string gpName = string.Empty;
                if (group == null)
                {
                    var gp = project.GroupID > 0 ? groupService.GetGroup(project.GroupID) : null;
                    if (gp != null)
                    {
                        gpName = gp.Name;
                    }
                }
                Projects.Add(new Controls.ItemSelect.Models.ItemModel
                {
                    ID          = project.ID,
                    Title       = project.ProjectName,
                    Description = project.ProjectDescription,
                    Icon        = project.Icon,
                    Tag         = gpName
                });
            }
        }
        private void PopulateFieldData()
        {
            var role = Claims[3].Value.ToString();

            Enum.TryParse(role, out Role userRole);
            if (userRole == Role.User)
            {
                Users.Clear();
                Projects.Clear();
                Users.Add(UserRepository.GetUser(Claims[0].Value.ToString()));
                var assignedProject = ProjectUserRepository.GetAssignedProject(Claims[0].Value.ToString());
                if (assignedProject != null)
                {
                    Projects.Add(assignedProject.ProjectRef);
                }
            }
            else
            {
                Users    = UserRepository.GetUsers();
                Projects = ProjectRepository.GetProjects();
            }
            LogHistoryFilterModel.StartDate = DateTime.Now.AddDays(-7);
            LogHistoryFilterModel.EndDate   = DateTime.Now;
            var project = ProjectUserRepository.GetAssignedProject(Claims[0].Value);

            if (project != null)
            {
                LogHistoryFilterModel.Project = project.ProjectRef.Name ?? project.ProjectRef.Name;
            }
            LogHistoryFilterModel.UserName = Claims[1].Value;
        }
Beispiel #3
0
        public void Start()
        {
            Initialize();

            try
            {
                if (!string.IsNullOrEmpty(_serverUsername) && !string.IsNullOrEmpty(_serverPassword) && _serverUsername != "guest")
                {
                    _client.Connect(_serverUsername, _serverPassword);
                    _isGuest = false;
                }
                else
                {
                    _client.ConnectAsGuest();
                    _isGuest = true;
                }

                _projects = _client.Projects.All();

                Projects.Clear();
                foreach (Project project in _projects)
                {
                    Projects.Add(new TeamCityProject(project.Id, project.Name, true));
                }
            }
            catch (Exception ex)
            {
                // TODO Error logging
                Console.WriteLine(ex.Message);
            }
        }
        private void Filter()
        {
            Projects.Clear();
            DBRepository <Project>     dBProject = new DBRepository <Project>(new BuildEntities());
            DBRepository <User>        dBUser    = new DBRepository <User>(new BuildEntities());
            DBRepository <UserProject> dbUP      = new DBRepository <UserProject>(new BuildEntities());

            if (CurUser == null)
            {
                foreach (var item in dbUP.GetAll().ToList())
                {
                    var user    = dBUser.GetAll().First(s => s.ID_User == item.ID_User);
                    var project = dBProject.GetAll().First(s => s.ID_Project == item.ID_Project);
                    if (user.Login.Contains(Find) || project.ID_Project.ToString().Contains(Find) || project.Project_name.Contains(Find) || project.Date_of_change.ToString().Contains(find))
                    {
                        Projects.Add(new UserProj(dBUser.GetAll().First(s => s.ID_User == item.ID_User), dBProject.GetAll().First(s => s.ID_Project == item.ID_Project)));
                    }
                }
            }
            else
            {
                foreach (var item in dbUP.GetAll().Where(s => s.ID_User == CurUser.ID_User))
                {
                    var project = dBProject.GetAll().First(s => s.ID_Project == item.ID_Project);
                    if (CurUser.Login.Contains(Find) || project.ID_Project.ToString().Contains(Find) || project.Project_name.Contains(Find) || project.Date_of_change.ToString().Contains(find))
                    {
                        Projects.Add(new UserProj(dBUser.GetAll().First(s => s.ID_User == item.ID_User), dBProject.GetAll().First(s => s.ID_Project == item.ID_Project)));
                    }
                }
            }
            dBProject.Dispose();
            dBUser.Dispose();
            dbUP.Dispose();
        }
        private void OpenFileDialog(object sender, RoutedEventArgs e)
        {
            if (Projects.Count != 0)
            {
                MessageBox.Show("Существующий проект будет закрыт!");
            }

            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.DefaultExt = "ras";
            openFileDialog.Filter     = "Файлы ReliabilityAnalysis|*.ras";
            openFileDialog.ShowDialog();



            if (openFileDialog.FileName != "")
            {
                var project = Project.OpenProject(openFileDialog.FileName);
                if (project != null)
                {
                    Projects.Clear();
                    Projects.Add(project);
                    TreeViewElements.ItemsSource = Projects;
                    GridProp.ItemsSource         = Projects[0].Property.Concat(Projects[0].Results);
                    GridProp.Items.Refresh();
                }
                else
                {
                    MessageBox.Show("Ошибка чтения файла");
                }
            }
        }
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Projects.Clear();
                var items = await ProjectDataStore.GetItemsAsync(true);

                foreach (var item in items)
                {
                    Projects.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        async Task LoadProjectsFromDb()
        {
            var projects = await GetStorageService().GetProjects(Id);

            foreach (var asanaProject in projects)
            {
                var tasksCount = await SetProjectInfo(asanaProject);

                asanaProject.TasksCount        = tasksCount.Item1;
                asanaProject.OverdueTasksCount = tasksCount.Item2;
            }


            Dispatcher.RunAsync(() =>
            {
                Projects.Clear();
                Projects.AddRange(projects);
                Workspace.ProjectsCount = projects.Count(x => !x.archived);

                if (IsPinned)
                {
                    //PinService.CreateUpdateStartTileAsync(Workspace.name, Workspace.ProjectsCountText, PinService.GetWorkspaceDetailsUri(Id), false);
                }
            });
        }
Beispiel #8
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Projects.Clear();

                var client   = new WebClient();
                var response = await client.GetProjects();

                IsVisibleProjects = response.Response.Items.Count > 0;

                foreach (var item in response.Response.Items)
                {
                    Projects.Add(ProjectConverter.Convert(item));
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #9
0
 public override void RemoveAllReferences()
 {
     Projects.Clear();
     Maintenances.Clear();
     Files.Clear();
     Safeties.Clear();
 }
        private void BuildExecute()
        {
            LogVisible = false;

            if (BuildButtonText == "Build")
            {
                if (!IsMSBuildPathValid())
                {
                    BuildCompleted = true;
                    BuildSucceeded = false;
                    BuildStatus    = $"MSBuild.exe path not found '{MSBuildPath}'";
                    return;
                }

                _cancel            = false;
                BuildCompleted     = false;
                BuildSucceeded     = false;
                BuildButtonEnabled = false;
                BuildButtonText    = "Cancel";
                _buildLogText      = null;

                Projects.Clear();
                Task.Run(() => BuildExecuteThreaded());
            }
            else if (BuildButtonText == "Cancel")
            {
                BuildButtonText = "Cancelling";

                _cancel = true;
            }
        }
        public async void Initialize(ViewRequest viewRequest)
        {
            model.GetConfiguration((viewRequest as KanbanViewRequest)?.ConfigurtaionName);

            var filtersData = await Task
                              .Run(() => model.LoadFiltersData())
                              .ConfigureAwait(true);

            Projects.Clear();
            foreach (var project in filtersData.Projects)
            {
                Projects.Add(project);
            }


            Priorities.Clear();
            foreach (var priority in filtersData.Priorities)
            {
                Priorities.Add(priority);
            }


            if (model.Configuration != null &&
                model.Configuration.ProjectId.HasValue)
            {
                CurrentProject = Projects.FirstOrDefault(x => x.Id == model.Configuration.ProjectId);
            }

            await DoRefresh();
        }
Beispiel #12
0
            public void Refresh()
            {
                WaveguideDB wgDB = new WaveguideDB();

                bool success = wgDB.GetAllProjects(ShowArchivedProjects);

                if (success)
                {
                    Projects.Clear();

                    for (int i = 0; i < wgDB.m_projectList.Count(); i++)
                    {
                        ProjectItem pitem = new ProjectItem();
                        pitem.ProjectName = wgDB.m_projectList[i].Description;
                        pitem.ProjectID   = wgDB.m_projectList[i].ProjectID;
                        pitem.Archived    = wgDB.m_projectList[i].Archived;
                        pitem.TimeStamp   = wgDB.m_projectList[i].TimeStamp;

                        bool IsAssigned = new bool();
                        IsAssigned = false;
                        success    = wgDB.IsUserAssignedToProject(User.UserID, pitem.ProjectID, ref IsAssigned);
                        if (success)
                        {
                            pitem.AssignedToProject = IsAssigned;
                        }

                        Projects.Add(pitem);
                    }
                }
            }
        public async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Projects.Clear();
                var projects = await ApiClient.Instance.GetProjects();

                if (projects.Count > 0)
                {
                    foreach (var item in projects)
                    {
                        if (item.uuid != null)
                        {
                            Projects.Add(item);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #14
0
        async Task ExecuteLoadProjectsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Projects.Clear();
                var projects = await DataStore.GetProjectsAsync();

                foreach (var project in projects)
                {
                    Projects.Add(project);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        private async Task LoadCompany()
        {
            try
            {
                Company = await _adminService.ReadCompanyByIdAsync(_globalModel.CurrentUser.CompanyId);

                var projects = await _adminService.ReadProjectsForCompanyAsync(Company);

                Projects.Clear();
                Projects.AddRange(projects);

                var users = await _adminService.ReadAllUsersForCompanyAsync(Company.CompanyId);

                Users.Clear();
                Users.AddRange(users);

                _canCreateNewProject = await _adminService.CanCreateNewProject(Company.CompanyId);

                NewProject.RaiseCanExecuteChanged();
            }
            catch (TimeoutException timeoutEx)
            {
                _eventAggregator.GetEvent <TimeoutErrorEvent>().Publish(timeoutEx);
            }

            IsCompanyEditorVisible = false;
            IsProjectEditorVisible = false;
            IsUserEditorVisible    = false;
        }
Beispiel #16
0
 private void onSignout(object item)
 {
     autoReconnect = true;
     Projects.Clear();
     Config.local.password = Config.local.ProtectString("BadPassword");
     _ = global.webSocketClient.Close();
 }
Beispiel #17
0
        private void UpdateShowingProjects()
        {
            Projects.Clear();

            var showingProjects = _projects.Where(p =>
            {
                if (SearchText == "")
                {
                    return(true);
                }
                if (p.Name.Contains(SearchText))
                {
                    return(true);
                }
                else if (p.Key.Contains(SearchText))
                {
                    return(true);
                }
                return(false);
            });

            if (CanCreateProject)
            {
                Projects.Add(null);
            }
            Projects.AddRange(showingProjects);
        }
Beispiel #18
0
 public void Load(Dictionary <string, FolderModel> projects)
 {
     Projects.Clear();
     foreach (var value in projects.Values)
     {
         Projects.Add(value);
     }
 }
Beispiel #19
0
 public static void LoadProjectDatas()
 {
     Projects.Clear();
     foreach (ProjectData project in ProjectModel.FindAll())
     {
         Projects.Add(project.Key, project);
     }
 }
 private void PopulateCollections(IEnumerable <Repository> items)
 {
     Projects.Clear();
     foreach (var project in items) // TODO: .Where(p => p.HasIssues)
     {
         Projects.Add(project);
     }
 }
 public void InitializeProjects(IEnumerable <Project> newProjects)
 {
     Projects.Clear();
     foreach (var newProject in newProjects.OrderBy(x => x.Name))
     {
         Projects.Add(newProject);
     }
 }
Beispiel #22
0
 private async void FillProjects()
 {
     Projects.Clear();
     foreach (Project project in (await _jira.Projects.GetProjectsAsync()).OrderBy(x => x.Name))
     {
         _projects.Add(project);
     }
 }
        public void OpenProject(string filepath)
        {
            Projects.Clear();
            Runtime.Instance.FileTree.Nodes.Clear();
            var p = new Project(filepath);

            Projects.Add(p.ProjName, p);
            Runtime.Instance.FileTree.Nodes.Add(p);
        }
Beispiel #24
0
        public async Task LoadAsync()
        {
            var lookup = await _projectLookupDataService.GetProjectLookupAsync();

            Projects.Clear();
            foreach (var item in lookup)
            {
                Projects.Add(new NavigationItemViewModel(item.Id, item.DisplayMember, _eventAggregator));
            }
        }
Beispiel #25
0
        private async void OnRefreshList()
        {
            var lookup = await _projectRepository.GetAllAsync();

            Projects.Clear();
            foreach (var item in lookup)
            {
                Projects.Add(new ProjectWrapper(item));
            }
        }
Beispiel #26
0
        public async Task LoadAsync()
        {
            var lookup = await _projectRepository.GetAllAsync();

            Projects.Clear();
            foreach (var item in lookup)
            {
                Projects.Add(new ProjectWrapper(item));
            }
        }
Beispiel #27
0
 protected virtual void ClearNavigationProperties()
 {
     CustomerInvoiceGroups.Clear();
     User = null;
     TimeEntryTypes.Clear();
     Projects.Clear();
     Tags.Clear();
     UsersCustomers.Clear();
     Users = null;
 }
 public void Initialize(YouTrackProxy proxy)
 {
     Proxy = proxy;
     Projects.Clear();
     Projects.Add(new ShortProject("", "Everything"));
     foreach (var project in Proxy.Projects("")) // TODO we can filter projects
     {
         Projects.Add(project);
     }
     CurrentProjectShortName = "";
 }
Beispiel #29
0
		public void ReloadProjects()
		{
			Projects.Clear();
			foreach (var project in projects.OrderBy(p => p.Description))
			{
				Projects.Add(new ProjectItemViewModel
				{
					Description = project.Description,
					ProjectId = project.ProjectId,
				});
			}
		}
Beispiel #30
0
        private void SortProjects()
        {
            var selectedProject = SelectedProject;
            var orderedProjects = Projects.OrderBy(p => p.Name.ToLowerInvariant()).ToList();

            Projects.Clear();
            foreach (var project in orderedProjects)
            {
                Projects.Add(project);
            }
            SelectedProject = selectedProject;
        }