Esempio n. 1
0
        public IssueActivity NewIssueActivity(IssueActivity issueActivity)
        {
            issueActivity.IssueActivityGuid = Guid.NewGuid().ToString();

            var newId = Insert(issueActivity.GetTableObject());

            issueActivity.IssueActivityId = newId;

            return(issueActivity);
        }
Esempio n. 2
0
        private void CreateIssueActivity(int issueId, string comment, IssueActivityType issueActivityType,
                                         Dictionary <string, List <int> > dicFileAndImageIds)
        {
            var issueActivity = new IssueActivity();

            issueActivity.IssueId             = issueId;
            issueActivity.IssueActivityTypeId = issueActivityType;
            issueActivity.Comment             = comment;
            issueActivity.CreateTime          = DateTime.Now;
            issueActivity.CreateUserName      = CurrentUserName;
            issueActivity.LastModifyTime      = DateTime.Now;
            issueActivity.LastModifyUserName  = CurrentUserName;
            issueActivity.RecordStatus        = RecordStatus.Valid;

            var newIssueActivity = m_dbAdapter.IssueActivity.NewIssueActivity(issueActivity);

            if (dicFileAndImageIds != null)
            {
                dicFileAndImageIds["file"].ForEach(x => m_dbAdapter.File.NewIssueActivityFile(newIssueActivity.IssueActivityId, x));
                dicFileAndImageIds["image"].ForEach(x => m_dbAdapter.Image.NewIssueActivityImage(newIssueActivity.IssueActivityId, x));
            }
        }
 public static ValueTask <EntityEntry <IssueActivity> > AddIssueActivity(this DbSet <IssueActivity> activities, HttpContext ctx, uint id, IssueActivity i)
 {
     i.AuthorId        = ctx.User.IsAnonymous() ? null : new uint?((uint)ctx.User.GetUserId());
     i.IssueId         = id;
     i.DateOfOccurance = DateTime.UtcNow;
     return(activities.AddAsync(i));
 }
Esempio n. 4
0
 public int DeleteIssueActivity(IssueActivity issueActivity)
 {
     issueActivity.RecordStatus = RecordStatus.Deleted;
     return(UpdateIssueActivity(issueActivity));
 }
Esempio n. 5
0
        public int UpdateIssueActivity(IssueActivity issueActivity)
        {
            var issueActivityTable = issueActivity.GetTableObject();

            return(m_db.Update(m_defaultTableName, m_defaultPrimaryKey, issueActivityTable, issueActivity.IssueActivityId));
        }