Пример #1
0
        private void btnWeb_Click(object sender, RoutedEventArgs e)
        {
            Front.FIssue  issue    = ((FrameworkElement)sender).DataContext as Front.FIssue;
            string        link     = _servers[_serverIndex].Address;
            StringBuilder sbuilder = new StringBuilder(link);

            if (sbuilder[sbuilder.Length - 1] != '/')
            {
                sbuilder.Append("/");
            }
            link = sbuilder.ToString() + "issues/" + issue.Id.ToString();
            System.Diagnostics.Process.Start(link);
        }
Пример #2
0
        /// <summary>
        /// Starts tracking work on an issue.
        /// </summary>
        /// <param name="issue">Issue on which the user is working.</param>
        private void startTracking(Front.FIssue issue)
        {
            issue.startWork();
            _servers[_serverIndex].Ds[0].startWatch();
            _current                 = issue;
            issue.IsSelected         = false;
            btnStartStop.Background  = (SolidColorBrush)(new BrushConverter().ConvertFrom("#F4ABBA"));
            btnStartStop.BorderBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#E6808A"));
            lblStartStop.Text        = "Parar";
            lblWorkingOnIssue.Text   = issue.Id.ToString() + " - " + issue.Name.Substring(0, Math.Min(20, issue.Name.Length)) + (issue.Name.Length >= 20 ? "...":string.Empty);
            _servers[_serverIndex].CurrentProjetI = cbProjects.SelectedIndex;
            _stopTracking.Enabled = true;

            dgHistory.Items.Refresh();
        }
Пример #3
0
        private static FTTW.Front.FIssue getFromRAIssue(FTTW.RedmineApi.Issue rAIssue, Persistency.DataManager dataManager)
        {
            FIssue issue = new FIssue();

            issue._pIssue      = rAIssue;
            issue._author      = rAIssue.AuthorName;
            issue._dueDate     = rAIssue.DueDate;
            issue._id          = rAIssue.Id;
            issue._name        = rAIssue.Subject;
            issue._description = rAIssue.Description;
            issue._priority    = rAIssue.PriorityName;
            issue._status      = rAIssue.StatusName;
            issue._tracker     = rAIssue.TrackerName;
            issue._manager     = dataManager;
            issue._projectId   = rAIssue.Project.Id;
            //issue._time = TimeSpan.FromSeconds(WSCom.ExchangeData.getWorkedIssueSeconds(rAIssue, dataManager));
            issue._time = TimeSpan.FromSeconds(rAIssue.TimeSpent);
            return(issue);
        }
Пример #4
0
        private static FProject getFromRAProject(RedmineApi.Project pProject, Persistency.DataManager manager)
        {
            FProject project = new FProject();

            project._type        = pProject.Type;
            project._description = pProject.Description;
            project._id          = pProject.Id;
            project._issues      = FIssue.getFrontIssueList(pProject.Issues, manager);
            project._manager     = manager;
            project._name        = pProject.Name;
            project._time        = new TimeSpan();

            foreach (FIssue issue in project._issues)
            {
                project._time += issue.Time;
            }

            return(project);
        }
Пример #5
0
        /// <summary>
        /// The button used to start/stop tracking an issue, located on the datagrid, was clicked.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPlay_Click(object sender, RoutedEventArgs e)
        {
            Front.IStartEnd startEnd = ((FrameworkElement)sender).DataContext as Front.IStartEnd;
            Front.FIssue    issue    = startEnd.getIssue();

            if (_isStarted)
            {
                stopTracking();
                _isStarted = false;
                if (_current.Id != issue.Id)
                {
                    startTracking(issue);
                    _isStarted = true;
                }
            }
            else
            {
                startTracking(issue);
                _isStarted = true;
            }
            dgTasks.Items.Refresh();
            dgTasks.UnselectAll();
        }
Пример #6
0
        public static void addHistory(FIssue fIssue, List <History> historyList)
        {
            if (historyList == null)
            {
                historyList = new List <History>();
            }
            History instance = null;

            foreach (History history in historyList)
            {
                if (history._fIssue == fIssue)
                {
                    instance = history;
                    historyList.Remove(instance);
                    break;
                }
            }

            if (instance == null)
            {
                instance = new History(fIssue);
            }
            historyList.Insert(0, instance);
        }