public DownloadFileAuthority Update(DownloadFileAuthority downloadFileAuthority) { downloadFileAuthority.LastModifyTime = System.DateTime.Now; downloadFileAuthority.LastModifyUserName = UserInfo.UserName; m_db.Update(m_defaultTableName, m_defaultPrimaryKey, downloadFileAuthority.GetTableObject(), downloadFileAuthority.Id); return(downloadFileAuthority); }
public DownloadFileAuthority Create(int projectId, string userName, DownloadFileAuthorityType authorityType) { var now = System.DateTime.Now; var authority = new DownloadFileAuthority { Guid = System.Guid.NewGuid().ToString(), ProjectId = projectId, UserName = userName, DownloadFileAuthorityType = authorityType, CreateTime = now, CreateUserName = UserInfo.UserName, LastModifyTime = now, LastModifyUserName = UserInfo.UserName, RecordStatus = Models.RecordStatus.Valid }; authority.Id = (int)m_db.Insert(m_defaultTableName, m_defaultPrimaryKey, true, authority.GetTableObject()); return(authority); }