public IssueActivity NewIssueActivity(IssueActivity issueActivity) { issueActivity.IssueActivityGuid = Guid.NewGuid().ToString(); var newId = Insert(issueActivity.GetTableObject()); issueActivity.IssueActivityId = newId; return(issueActivity); }
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)); }
public int DeleteIssueActivity(IssueActivity issueActivity) { issueActivity.RecordStatus = RecordStatus.Deleted; return(UpdateIssueActivity(issueActivity)); }
public int UpdateIssueActivity(IssueActivity issueActivity) { var issueActivityTable = issueActivity.GetTableObject(); return(m_db.Update(m_defaultTableName, m_defaultPrimaryKey, issueActivityTable, issueActivity.IssueActivityId)); }