Ejemplo n.º 1
0
 public static Boolean RemoveJob(Job Job, ObservableCollection<Job> JobsCollection)
 {
     try
     {
         if (JobsCollection != null && Job != null)
         {
             project_flux.API.Job.Archive(Job.ID);
             JobsCollection.Remove(Job);
             return true;
         }
         return false;
     }
     catch
     {
         return false;
     }
 }
Ejemplo n.º 2
0
 private static async Task<List<Job>> PopulatedJobsList(Guid BoardId)
 {
     List<Job> _jobs = new List<Job>();
     try
     {
         var _onlineJobs = await project_flux.API.Job.GetJobsByBoardId(BoardId);
         foreach (var _onlineJob in _onlineJobs)
         {
             Job _newJob = new Job();
             _newJob.ID = _onlineJob.Id;
             _newJob.BoardID = _onlineJob.BoardId;
             _newJob.Name = _onlineJob.Name;
             _newJob.Cards = new ObservableCollection<Card>(await PopulatedCardsList(_onlineJob.Id));
             _jobs.Add(_newJob);
         }
     }
     catch { }
     return _jobs;
 }
Ejemplo n.º 3
0
        public static void EditJob(Job job, ObservableCollection<Job> JobsCollection)
        {

            short _counter = 0;
            try
            {
                foreach (var _job in JobsCollection)
                {
                    if (job == _job)
                    {
                        JobsCollection[_counter] = job;
                    }
                    _counter++;
                }
            }
            catch { }
            project_flux.API.Job.Update(job.ID, job.BoardID, job.Name);
            job.Name = job.Name;
        }
Ejemplo n.º 4
0
 public static Boolean AddJob(String Name, String Description, ObservableCollection<Job> JobsCollection, Guid BoardId)
 {
     try
     {
         Job _newJob = new Job();
         Task.Run(async () =>
         {
             var createdGuid = Guid.Parse(await project_flux.API.Job.Add(BoardId, Name));
             _newJob.Name = Name;
             _newJob.Description = Description;
             _newJob.ID = createdGuid;
             _newJob.BoardID = BoardId;
             _newJob.Cards = new ObservableCollection<Card>();
         }).Wait();
         JobsCollection.Add(_newJob);
         return true;
     }
     catch
     {
         return false;
     }
 }
Ejemplo n.º 5
0
        private async void EditJobPopupShow(Job Job)
        {
            if (Job != null)
            {

                var txtbxTitle = new TextBox
                {
                    Name = "txtbxTitle",
                    Margin = new Thickness(0, 0, 0, 10),
                    PlaceholderText = "Job Title.."
                };

                var panel = new StackPanel();
                
                panel.Children.Add(txtbxTitle);

                var dialog = new ContentDialog()
                {
                    Title = "Edit card",
                    Content = panel,
                    MaxWidth = this.ActualWidth
                };

                dialog.PrimaryButtonText = "Confirm";
                dialog.PrimaryButtonClick += delegate
                {
                    Job.Name = txtbxTitle.Text;
                    JobsHelper.EditJob(Job, CurrentBoard);
                };

                dialog.SecondaryButtonText = "Cancel";
                dialog.SecondaryButtonClick += delegate { };
                var result = await dialog.ShowAsync();
            }
        }
Ejemplo n.º 6
0
        private async void ArchiveJobPopupShow(Job Job)
        {
            if (Job != null)
            {
                var dialog = new ContentDialog()
                {
                    Title = "Archive card",
                    Content = "Please confirm archiving \"" + Job.Name + "\"",
                    MaxWidth = this.ActualWidth
                };

                dialog.PrimaryButtonText = "Confirm";
                dialog.PrimaryButtonClick += delegate {
                                                          JobsHelper.RemoveJob(Job, CurrentBoard);
                };

                dialog.SecondaryButtonText = "Cancel";
                dialog.SecondaryButtonClick += delegate { };
                var result = await dialog.ShowAsync();
            }
        }