Example #1
0
        public static JiraInfo UpdateJiraInfo(JiraInfo PartialInfo)
        {
            JiraInfo retval = GetJiraInfo(PartialInfo.TaskID);

            retval.WorkLogID = PartialInfo.WorkLogID;
            return(retval);
        }
Example #2
0
 public TimeEntry(string Project, string Task, string Employer, DateTime Start, DateTime Stop, string Comments, JiraInfo worklog)
 {
     this.Project  = Project;
     this.Task     = Task;
     this.Employer = Employer;
     this.Start    = Start;
     this.Stop     = Stop;
     this.Comments = Comments;
     this.WorkLog  = worklog;
 }
        public frmTimeEntry(TimeEntry input)
        {
            InitializeComponent();
            this.comboProject.Text = input.Project;
            this.comboTask.Text = input.Task;
            this.comboEmployer.Text = input.Employer;
            this.dateTimePickerStart.Value = new DateTime(input.Start.Year, input.Start.Month, input.Start.Day, input.Start.Hour, input.Start.Minute, 0);
            this.dateTimePickerStop.Value = new DateTime(input.Stop.Year, input.Stop.Month, input.Stop.Day, input.Stop.Hour, input.Stop.Minute, 0);
            this.txtComments.Text = input.Comments;
            this.workLog = input.WorkLog;
            this.comboJiraTask.Text = input.WorkLog.TaskID;

            this.btnStopAtNow.Image.RotateFlip(RotateFlipType.RotateNoneFlipX);
        }
Example #4
0
        public void UpdateJira()
        {
            if (this.WorkLog.TaskID.Length > 0 && this.Stop != MIN_DATE)
            {
                this.WorkLog  = JiraInterface.UpdateWork(this.WorkLog, this.Start, this.Stop);
                this.Comments = this.WorkLog.Summary;
            }
            else if (this.WorkLog.TaskID.Length > 0)
            {
                this.WorkLog = JiraInterface.UpdateJiraInfo(this.WorkLog);
            }

            if (this.WorkLog.Summary.Trim().Length > 0)
            {
                this.Comments = this.WorkLog.Summary;
            }
        }
Example #5
0
        public static JiraInfo UpdateWork(JiraInfo current, DateTime start, DateTime stop)
        {
            if (current.WorkLogID.Length == 0)
            {
                AddWorkLog(current.TaskID, start, stop);
                current.WorkLogID = GetWorklogIDs(current.TaskID)[0];
            }
            else
            {
                try
                {
                    UpdateWorkLog(current.TaskID, current.WorkLogID, start, stop);
                }
                catch
                {
                    AddWorkLog(current.TaskID, start, stop);
                    current.WorkLogID = GetWorklogIDs(current.TaskID)[0];
                }
            }

            return(UpdateJiraInfo(current));
        }