• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Domain.Task类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ASC.Projects.Core.Domain.Task的典型用法代码示例。如果您正苦于以下问题:C# Task类的具体用法?C# Task怎么用?C# Task使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Task类属于ASC.Projects.Core.Domain命名空间,在下文中一共展示了Task类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SimpleTaskWrapper

 public SimpleTaskWrapper(Task task)
 {
     ID = task.ID;
     Title = task.Title;
     Description = task.Description;
     Deadline = (ApiDateTime)task.Deadline;
 }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:7,代码来源:SimpleTaskWrapper.cs


示例2: ChangeStatus

        public Subtask ChangeStatus(Task task, Subtask subtask, TaskStatus newStatus)
        {
            if (subtask == null) throw new Exception("subtask.Task");
            if (task == null) throw new ArgumentNullException("task");
            if (task.Status == TaskStatus.Closed) throw new Exception("task can't be closed");

            if (subtask.Status == newStatus) return subtask;

            ProjectSecurity.DemandEdit(task, subtask);
           
            subtask.Status = newStatus;
            subtask.LastModifiedBy = SecurityContext.CurrentAccount.ID;
            subtask.LastModifiedOn = TenantUtil.DateTimeNow();
            subtask.StatusChangedOn = TenantUtil.DateTimeNow();

            if (subtask.Responsible.Equals(Guid.Empty))
                subtask.Responsible = SecurityContext.CurrentAccount.ID;

            var senders = GetSubscribers(task);

            if (task.Status != TaskStatus.Closed && newStatus == TaskStatus.Closed && !factory.DisableNotifications && senders.Count != 0)
                NotifyClient.Instance.SendAboutSubTaskClosing(senders, task, subtask);

            if (task.Status != TaskStatus.Closed && newStatus == TaskStatus.Open && !factory.DisableNotifications && senders.Count != 0)
                NotifyClient.Instance.SendAboutSubTaskResumed(senders, task, subtask);

            return subtaskDao.Save(subtask);
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:28,代码来源:SubtaskEngine.cs


示例3: TaskWrapper

        public TaskWrapper(Task task)
        {
            if (task.SubTasks != null)
                Subtasks = task.SubTasks.Select(x => new SubtaskWrapper(x, task)).ToList();

            CreatedBy = EmployeeWraper.Get(task.CreateBy);
            if (task.CreateBy != task.LastModifiedBy)
                UpdatedBy = EmployeeWraper.Get(task.LastModifiedBy);

            if (task.Responsible!=Guid.Empty)
                Responsible = EmployeeWraper.Get(task.Responsible);

            Id = task.ID;

            Updated = (ApiDateTime)task.LastModifiedOn;
            Created = (ApiDateTime)task.CreateOn;
            Deadline = (task.Deadline == DateTime.MinValue ? null : (ApiDateTime)task.Deadline);
            Priority = task.Priority;
            
            Title = task.Title;
            Status = (int)task.Status;
            Description = task.Description;
            MilestoneId = task.Milestone;
            ProjectOwner = new SimpleProjectWrapper(task.Project);
            CanEdit = ProjectSecurity.CanEdit(task);
            CanWork = ProjectSecurity.CanWork(task);

            if (task.Milestone != 0 && task.MilestoneDesc != null)
                Milestone = new SimpleMilestoneWrapper(task.MilestoneDesc);

            if (task.Responsibles != null)
                Responsibles = task.Responsibles.Select(x => EmployeeWraper.Get(x)).ToList();
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:33,代码来源:TaskWrapper.cs


示例4: Save

 public override Task Save(Task task)
 {
     if (task != null)
     {
         ResetCache(task.ID);
     }
     return base.Save(task);
 }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:8,代码来源:TaskDao.cs


示例5: TimeSpend

 public static void TimeSpend(TimeSpend timeSpend, Project project, Task relativeTask, String actionText, int actionType, int businessValue)
 {
     UserActivityPublisher.Publish<TimeLinePublisher>(
      new TimeLineUserActivity(actionText, actionType, businessValue)
      {
          ContentID = relativeTask != null ? relativeTask.ToString() : String.Empty,
          ContainerID = timeSpend.Task.Project.ID.ToString(),
          Title = relativeTask != null ? relativeTask.Title : timeSpend.Hours.ToString(),
          URL = String.Concat(VirtualPathUtility.ToAbsolute(ConfigurationManager.BaseVirtualPath + "timeTracking.aspx"), String.Format("?prjID={0}", timeSpend.Task.Project.ID)),
          AdditionalData = String.Format(AdditionalDataPattern, EntityType.TimeSpend, relativeTask != null ? relativeTask.Title : string.Empty, project.Title),
          SecurityId = string.Format(SecurityDataPattern, EntityType.TimeSpend, relativeTask != null ? relativeTask.ID.ToString() : string.Empty, project.ID)
      });
 }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:13,代码来源:TimeLinePublisher.cs


示例6: InitTaskPage

        private void InitTaskPage(Task task)
        {
            var taskDescriptionView = (TaskDescriptionView)LoadControl(PathProvider.GetFileStaticRelativePath("Tasks/TaskDescriptionView.ascx"));
            taskDescriptionView.Task = task;
            _content.Controls.Add(taskDescriptionView);

            EssenceTitle = task.Title;
            IsSubcribed = Global.EngineFactory.GetTaskEngine().IsSubscribed(task);

            if ((int)task.Status == 2)
            {
                EssenceStatus = TaskResource.Closed.ToLower();
            }

            Title = HeaderStringHelper.GetPageTitle(task.Title);
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:16,代码来源:Tasks.aspx.cs


示例7: Task

        public static void Task(Task task, Milestone milestone, String actionText, int actionType, int businessValue, bool withPreview)
        {
            //DropProjectActivitiesCache(task.Project);

            UserActivityPublisher.Publish<TimeLinePublisher>(new TimeLineUserActivity(actionText, actionType, businessValue)
            {

                ContentID = (milestone != null) ? milestone.ToString() : String.Empty,
                ContainerID = task.Project.ID.ToString(),
                Title = task.Title,
                URL = String.Concat(VirtualPathUtility.ToAbsolute(ConfigurationManager.BaseVirtualPath + "tasks.aspx").Replace("api/", ""), String.Format("?prjID={0}&id={1}", task.Project.ID, task.ID)),
                AdditionalData = String.Format(AdditionalDataPattern, EntityType.Task, (milestone != null) ? milestone.Title : String.Empty, task.Project.Title),
                SecurityId = string.Format(SecurityDataPattern, EntityType.Task, task.ID, task.Project.ID),
                HtmlPreview = withPreview ? task.Description.HtmlEncode() : null
            });
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:16,代码来源:TimeLinePublisher.cs


示例8: CanRead

        public static bool CanRead(Task task, Guid userId)
        {
            if (task == null || !CanRead(task.Project, userId)) return false;
            if (task.Responsible == userId) return true;

            if (task.Responsibles.Contains(userId)) return true;

            if (!GetTeamSecurity(task.Project, userId, ProjectTeamSecurity.Tasks)) return false;
            if (task.Milestone != 0 && !GetTeamSecurity(task.Project, userId, ProjectTeamSecurity.Milestone))
            {
                var m = GetFactory().GetMilestoneDao().GetById(task.Milestone);
                if (!CanRead(m, userId)) return false;
            }

            return true;
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:16,代码来源:ProjectSecurity.cs


示例9: TaskWrapper

        public TaskWrapper(Task task)
        {
            Id = task.ID;
            Title = task.Title;
            Description = task.Description;
            Status = (int)task.Status;

            if (task.Responsibles != null)
            {
                Responsibles = task.Responsibles.Select(EmployeeWraper.Get).OrderBy(r=> r.DisplayName).ToList();
            }


            Deadline = (task.Deadline == DateTime.MinValue ? null : new ApiDateTime(task.Deadline, TimeZoneInfo.Local));
            Priority = task.Priority;
            ProjectOwner = new SimpleProjectWrapper(task.Project);
            MilestoneId = task.Milestone;
            Created = (ApiDateTime)task.CreateOn;
            CreatedBy = EmployeeWraper.Get(task.CreateBy);
            Updated = (ApiDateTime)task.LastModifiedOn;
            StartDate = task.StartDate.Equals(DateTime.MinValue) ? null : (ApiDateTime)task.StartDate;

            if (task.CreateBy != task.LastModifiedBy)
            {
                UpdatedBy = EmployeeWraper.Get(task.LastModifiedBy);
            }

            if (task.SubTasks != null)
            {
                Subtasks = task.SubTasks.Select(x => new SubtaskWrapper(x, task)).ToList();
            }

            CanEdit = ProjectSecurity.CanEdit(task);
            CanCreateSubtask = ProjectSecurity.CanCreateSubtask(task);
            CanCreateTimeSpend = ProjectSecurity.CanCreateTimeSpend(task);
            CanDelete = ProjectSecurity.CanDelete(task);

            if (task.Milestone != 0 && task.MilestoneDesc != null)
            {
                Milestone = new SimpleMilestoneWrapper(task.MilestoneDesc);
            }

            if (task.Links.Any())
            {
                Links = task.Links.Select(r=> new TaskLinkWrapper(r));
            }
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:47,代码来源:TaskWrapper.cs


示例10: SubtaskWrapper

 public SubtaskWrapper(Subtask subtask, Task task)
 {
     Id = subtask.ID;
     Title = subtask.Title;
     Status = (int)subtask.Status;
     if (subtask.Responsible != Guid.Empty)
     {
         Responsible = EmployeeWraper.Get(subtask.Responsible);
     }
     Created = (ApiDateTime)subtask.CreateOn;
     CreatedBy = EmployeeWraper.Get(subtask.CreateBy);
     Updated = (ApiDateTime)subtask.LastModifiedOn;
     if (subtask.CreateBy != subtask.LastModifiedBy)
     {
         UpdatedBy = EmployeeWraper.Get(subtask.LastModifiedBy);
     }
     CanEdit = ProjectSecurity.CanEdit(task, subtask);
 }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:18,代码来源:SubtaskWrapper.cs


示例11: ChangeStatus

        public Subtask ChangeStatus(Task task, Subtask subtask, TaskStatus newStatus)
        {
            if (subtask == null) throw new Exception("subtask.Task");
            if (task == null) throw new ArgumentNullException("task");
            if (task.Status == TaskStatus.Closed) throw new Exception("task can't be closed");

            if (subtask.Status == newStatus) return subtask;

            ProjectSecurity.DemandEdit(task, subtask);
           
            switch (newStatus)
            {
                case TaskStatus.Closed:
                    TimeLinePublisher.Subtask(subtask, task, EngineResource.ActionText_Closed, UserActivityConstants.ActivityActionType, UserActivityConstants.ImportantActivity);
                    break;

                case TaskStatus.Open:
                    TimeLinePublisher.Subtask(subtask, task, subtask.Status == TaskStatus.Closed ? EngineResource.ActionText_Reopen : EngineResource.ActionText_Accept, UserActivityConstants.ActivityActionType, UserActivityConstants.SmallActivity);
                    break;
            }

            subtask.Status = newStatus;
            subtask.LastModifiedBy = SecurityContext.CurrentAccount.ID;
            subtask.LastModifiedOn = TenantUtil.DateTimeNow();
            subtask.StatusChangedOn = TenantUtil.DateTimeNow();

            if (subtask.Responsible.Equals(Guid.Empty))
                subtask.Responsible = SecurityContext.CurrentAccount.ID;

            var objectID = task.UniqID + "_" + task.Project.ID;
            var senders = NotifySource.Instance.GetSubscriptionProvider().GetRecipients(NotifyConstants.Event_NewCommentForTask, objectID).ToList();
            senders.RemoveAll(r => r.ID == SecurityContext.CurrentAccount.ID.ToString());

            if (task.Status != TaskStatus.Closed && newStatus == TaskStatus.Closed && !_factory.DisableNotifications && senders.Count != 0)
                NotifyClient.Instance.SendAboutSubTaskClosing(senders, task, subtask);

            if (task.Status != TaskStatus.Closed && newStatus == TaskStatus.Open && !_factory.DisableNotifications && senders.Count != 0)
                NotifyClient.Instance.SendAboutSubTaskResumed(senders, task, subtask);

            return _subtaskDao.Save(subtask);
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:41,代码来源:SubtaskEngine.cs


示例12: SaveOrUpdate

 public Task SaveOrUpdate(Task task, IEnumerable<int> attachedFileIds, bool notifyResponsible)
 {
     return SaveOrUpdate(task, attachedFileIds, notifyResponsible, false);
 }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:4,代码来源:TaskEngine.cs


示例13: CanRead

 private static bool CanRead(Task task)
 {
     return ProjectSecurity.CanRead(task);
 }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:4,代码来源:TaskEngine.cs


示例14: ChangeStatus

        public Task ChangeStatus(Task task, TaskStatus newStatus)
        {
            ProjectSecurity.DemandEdit(task);

            if (task == null) throw new ArgumentNullException("task");
            if (task.Project == null) throw new Exception("Project can't be null.");
            if (task.Project.Status == ProjectStatus.Closed) throw new Exception(EngineResource.ProjectClosedError);

            if (task.Status == newStatus) return task;

            var senders = GetSubscribers(task);

            if (newStatus == TaskStatus.Closed && !factory.DisableNotifications && senders.Count != 0)
                NotifyClient.Instance.SendAboutTaskClosing(senders, task);

            if (newStatus == TaskStatus.Open && !factory.DisableNotifications && senders.Count != 0)
                NotifyClient.Instance.SendAboutTaskResumed(senders, task);

            task.Status = newStatus;
            task.LastModifiedBy = SecurityContext.CurrentAccount.ID;
            task.LastModifiedOn = TenantUtil.DateTimeNow();
            task.StatusChangedOn = TenantUtil.DateTimeNow();

            //subtask
            if (newStatus == TaskStatus.Closed)
            {
                if (!task.Responsibles.Any())
                    task.Responsibles.Add(SecurityContext.CurrentAccount.ID);

                subtaskDao.CloseAllSubtasks(task);
            }

            return taskDao.Save(task);
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:34,代码来源:TaskEngine.cs


示例15: CheckLink

        private static void CheckLink(Task parentTask, Task dependentTask)
        {
            if (parentTask == null) throw new ArgumentNullException("parentTask");
            if (dependentTask == null) throw new ArgumentNullException("dependentTask");

            if (parentTask.ID == dependentTask.ID)
            {
                throw new Exception("it is impossible to create a link between one and the same task");
            }

/*            if (parentTask.Status == TaskStatus.Closed || dependentTask.Status == TaskStatus.Closed)
            {
                throw new Exception("Such link don't be created. Task closed.");
            }*/

            if (parentTask.Milestone != dependentTask.Milestone)
            {
                throw new Exception("Such link don't be created. Different Milestones");
            }

        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:21,代码来源:TaskEngine.cs


示例16: AddLink

        public void AddLink(Task parentTask, Task dependentTask, TaskLinkType linkType)
        {
            CheckLink(parentTask, dependentTask, linkType);

            var link = new TaskLink
            {
                ParentTaskId = parentTask.ID,
                DependenceTaskId = dependentTask.ID,
                LinkType = linkType
            };

            if (taskDao.IsExistLink(link))
                throw new Exception("link already exist");

            ProjectSecurity.DemandEdit(dependentTask);
            ProjectSecurity.DemandEdit(parentTask);

            taskDao.AddLink(link);
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:19,代码来源:TaskEngine.cs


示例17: SendReminder

        public void SendReminder(Task task)
        {
            //Don't send anything if notifications are disabled
            if (factory.DisableNotifications || task.Responsibles == null || !task.Responsibles.Any()) return;

            NotifyClient.Instance.SendReminderAboutTask(task.Responsibles.Distinct(), task);
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:7,代码来源:TaskEngine.cs


示例18: NotifyTask

        public void NotifyTask(Task task, IEnumerable<Guid> inviteToResponsibles, IEnumerable<Guid> removeResponsibles, bool isNew, bool notifyResponsible)
        {
            if (factory.DisableNotifications) return;

            var senders = GetSubscribers(task);
            senders = senders.FindAll(r => !inviteToResponsibles.Contains(new Guid(r.ID)) && !removeResponsibles.Contains(new Guid(r.ID)));

            if (senders.Any())
            {
                if (isNew)
                {
                    NotifyClient.Instance.SendAboutTaskCreating(senders, task);
                }
                else
                {
                    NotifyClient.Instance.SendAboutTaskEditing(senders, task);
                }
            }

            if (notifyResponsible)
                NotifyResponsible(task, inviteToResponsibles.ToList(), removeResponsibles.ToList());
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:22,代码来源:TaskEngine.cs


示例19: SendAboutResponsibleBySubTask

 public void SendAboutResponsibleBySubTask(Subtask subtask, Task task)
 {
     var recipient = ToRecipient(subtask.Responsible);
     if (recipient != null)
     {
         client.SendNoticeToAsync(
             NotifyConstants.Event_ResponsibleForSubTask,
             task.NotifyId,
             new[] { recipient },
             GetDefaultSenders(recipient),
             null,
             new TagValue(NotifyConstants.Tag_ProjectID, task.Project.ID),
             new TagValue(NotifyConstants.Tag_ProjectTitle, task.Project.Title),
             new TagValue(NotifyConstants.Tag_EntityTitle, task.Title),
             new TagValue(NotifyConstants.Tag_SubEntityTitle, subtask.Title),
             new TagValue(NotifyConstants.Tag_EntityID, task.ID),
             new TagValue(NotifyConstants.Tag_AdditionalData, new Hashtable { { "TaskDescription", HttpUtility.HtmlEncode(task.Description) } }),
             ReplyToTagProvider.Comment("project.task", task.ID.ToString()));
     }
 }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:20,代码来源:NotifyClient.cs


示例20: MoveToMilestone

        public Task MoveToMilestone(Task task, int milestoneID)
        {
            ProjectSecurity.DemandEdit(task);

            if (task == null) throw new ArgumentNullException("task");
            if (task.Project == null) throw new Exception("Project can be null.");

            var newMilestone = milestoneID != 0;
            var milestone = milestoneDao.GetById(newMilestone ? milestoneID : task.Milestone);

            var senders = GetSubscribers(task);

            if (!factory.DisableNotifications && senders.Count != 0)
                NotifyClient.Instance.SendAboutTaskRemoved(senders, task, milestone, newMilestone);

            task.Milestone = milestoneID;
            task.LastModifiedBy = SecurityContext.CurrentAccount.ID;
            task.LastModifiedOn = TenantUtil.DateTimeNow();

            return taskDao.Save(task);
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:21,代码来源:TaskEngine.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Domain.TaskFilter类代码示例发布时间:2022-05-24
下一篇:
C# Core.File类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap