コード例 #1
0
ファイル: CommentOperations.cs プロジェクト: fathurxzz/aleqx
        public void Insert(TaskComment taskComment)
        {
            var rolloutTracking = _session.RolloutTracking.FirstOrDefault(rt => rt.ProjectId.Equals(taskComment.ProjectId)
                                                                             && rt.SiteNumber.Equals(taskComment.SiteNumber)
                                                                             && rt.TaskId.Equals(taskComment.TaskId));
            if (rolloutTracking != null)
            {
                taskComment.CompletedDate = rolloutTracking.CompletedDate;
                taskComment.ForecastDate = rolloutTracking.ForecastDate;
            }


            _session.TaskComments.Add(taskComment);
            _session.SaveChanges();
        }
コード例 #2
0
ファイル: SiteOperationsOld.cs プロジェクト: fathurxzz/aleqx
        //TODO: Doesn't seem that this belongs here.
        private void AddAutomaticComment(string siteNumber, string taskId, string commentOn, DateTime? dateBeforeUpdate, DateTime? dateAfterUpdate, string userName, string projectId)
        {
            var automatedComment = new TaskComment();
            automatedComment.ProjectId = projectId;
            automatedComment.UserId = userName;
            automatedComment.CommentOn = commentOn;
            automatedComment.SiteNumber = siteNumber;
            automatedComment.TaskId = taskId;

            string from = (dateBeforeUpdate != null) ? ((DateTime)dateBeforeUpdate).ToShortDateString() : "null";
            string to = (dateAfterUpdate != null) ? ((DateTime)dateAfterUpdate).ToShortDateString() : "null";
            automatedComment.Comment = string.Format(SystemResources.SystemComment, from, to);


            _commentOperations.Insert(automatedComment);
        }