Exemple #1
0
        private bool SetCurrentWI(int _wiid)
        {
            CurrentWi = RestApiHelper.GetWorkItem(_wiid);

            if (CurrentWi == null)
            {
                return(false);
            }

            CurrentWiType = RestApiHelper.GetWorkItemType(CurrentWi.Fields[WIConsts.TeamProject].ToString(), CurrentWi.Fields[WIConsts.WorkItemType].ToString());
            ActWiType     = RestApiHelper.GetWorkItemType(CurrentWi.Fields[WIConsts.WorkItemType].ToString(), Properties.Settings.Default.WIActivity);

            txtWiId.Text      = CurrentWi.Id.ToString();
            lbWiTitle.Content = CurrentWi.Fields[WIConsts.Title].ToString();
            txtActTitle.Text  = CurrentWi.Fields[WIConsts.Title].ToString();

            return(true);
        }
Exemple #2
0
        private void StopCount()
        {
            if (txtActTitle.Text == "")
            {
                MessageBox.Show("Update Activity Type", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            double _completedhours = Math.Round(CurrentMins / 60.0, 2);

            CurrentWi = RestApiHelper.GetWorkItem(CurrentWi.Id.Value);
            CreateNewActivity(_completedhours);
            UpdateParentWorkItem(_completedhours);

            CurrentState = Mode.STOPED;
            UpdateButtonsState();
            TTimer.Stop();
            HideToTray.InActive();
        }