当前位置: 首页>>代码示例>>C#>>正文


C# Issue.GetWorklogs方法代码示例

本文整理汇总了C#中Issue.GetWorklogs方法的典型用法代码示例。如果您正苦于以下问题:C# Issue.GetWorklogs方法的具体用法?C# Issue.GetWorklogs怎么用?C# Issue.GetWorklogs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Issue的用法示例。


在下文中一共展示了Issue.GetWorklogs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCurrentLoggedTimeForDate

        public TimeSpan GetCurrentLoggedTimeForDate(Issue jiraIssue, DateTime date)
        {
            var loggedTime = new TimeSpan();

            foreach (var worklog in jiraIssue.GetWorklogs().Where(worklog => worklog.StartDate.HasValue &&
                                                                             worklog.StartDate.Value.Date == date.Date &&
                                                                             worklog.Author.ToLower() == jiraConnectionSettings.JiraUsername.ToLower()))
            {
                loggedTime = loggedTime.Add(new TimeSpan(0, 0, (int)worklog.TimeSpentInSeconds));
            }

            return loggedTime;
        }
开发者ID:harrisonmeister,项目名称:Gallifrey,代码行数:13,代码来源:JiraConnection.cs

示例2: ExportTimerWindow

        public ExportTimerWindow(IBackend gallifrey, Guid timerGuid)
        {
            this.gallifrey = gallifrey;
            timerToShow = gallifrey.JiraTimerCollection.GetTimer(timerGuid);
            InitializeComponent();

            jiraIssue = gallifrey.JiraConnection.GetJiraIssue(timerToShow.JiraReference);
            var loggedTime = new TimeSpan();
            foreach (var worklog in jiraIssue.GetWorklogs())
            {
                if (worklog.StartDate.HasValue && worklog.StartDate.Value.Date == timerToShow.DateStarted.Date && worklog.Author.ToLower() == gallifrey.JiraConnectionSettings.JiraUsername.ToLower())
                {
                    loggedTime = loggedTime.Add(new TimeSpan(0, 0, (int)worklog.TimeSpentInSeconds));
                }
            }
            gallifrey.JiraTimerCollection.SetJiraExportedTime(timerGuid, loggedTime);

            timerToShow = gallifrey.JiraTimerCollection.GetTimer(timerGuid);

            if (timerToShow.TimeToExport.TotalMinutes <= 0)
            {
                MessageBox.Show("There Is No Time To Export", "Nothing To Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
                DisplayForm = false;
            }

            txtJiraRef.Text = timerToShow.JiraReference;
            txtDescription.Text = timerToShow.JiraName;
            txtTotalHours.Text = timerToShow.ExactCurrentTime.Hours.ToString();
            txtTotalMinutes.Text = timerToShow.ExactCurrentTime.Minutes.ToString();
            txtExportedHours.Text = timerToShow.ExportedTime.Hours.ToString();
            txtExportedMins.Text = timerToShow.ExportedTime.Minutes.ToString();
            txtExportHours.Text = timerToShow.TimeToExport.Hours.ToString();
            txtExportMins.Text = timerToShow.TimeToExport.Minutes.ToString();

            if (timerToShow.DateStarted.Date != DateTime.Now.Date)
            {
                calExportDate.Value = timerToShow.DateStarted.Date.AddHours(12);
            }
            else
            {
                calExportDate.Value = DateTime.Now;
            }
        }
开发者ID:harrisonmeister,项目名称:Gallifrey,代码行数:43,代码来源:ExportTimerWindow.cs

示例3: GetWorklogs

        public List<EffortLog> GetWorklogs(Issue issue)
        {
            var workLogs = new List<EffortLog>();

            var rawWorklogs = issue.GetWorklogs().ToList();

            foreach(var wl in rawWorklogs)
            {
                workLogs.Add(
                new EffortLog
                {
                    StartDate = wl.StartDate,
                    TimeSpent = wl.TimeSpent,
                    Hours = wl.TimeSpentInSeconds / 3600.0,
                    User = wl.Author

                });
            }
            return workLogs;
        }
开发者ID:JeffSolomon,项目名称:ConnectorStatus,代码行数:20,代码来源:JiraTicket.cs


注:本文中的Issue.GetWorklogs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。