public virtual async Task <int> CreateLoadAuditLogEntryAsync(Guid loadId, AuditTypeData auditType, Guid userId, string userName, string firstName, string lastName) { var userIdParam = new SqlParameter("@userId", userId); var loadIdParam = new SqlParameter("@loadId", loadId); var auditTypeId = new SqlParameter("@auditTypeId", auditType.ToString("G")); var topsUsername = new SqlParameter("@topsUsername", userName); var topsFirstName = new SqlParameter("@topsFirstName", firstName); var topsLastName = new SqlParameter("@topsLastName", lastName); var commandText = "exec LoadBoard.dbo.spCreateLoadAuditLogEntry @userId, @loadId, @auditTypeId, @topsUsername, @topsFirstName, @topsLastName"; return(await Database.ExecuteSqlCommandAsync(commandText, userIdParam, loadIdParam, auditTypeId, topsUsername, topsFirstName, topsLastName)); }
/// <summary> /// Purpose: Grabs audit type information based on ID /// Accepts: Int /// Returns: Nothing /// </summary> public void GetAuditTypeByID(int id) { try { AuditTypeData data = new AuditTypeData(); Hashtable hsh = new Hashtable(); hsh = data.GetAuditTypeByID(id); AuditTypeID = id; Description = hsh["description"]; IsAdmin = hsh["isadmin"]; } catch (Exception ex) { ErrorRoutine(ex, "AuditType", "GetAuditTypeByID"); } }
/// <summary> /// Purpose: Grabs all audit types /// Accepts: Nothing /// Returns: List<AuditType> /// </summary> public List <AuditType> GetAllAuditTypes() { List <AuditType> audittypes = new List <AuditType>(); try { AuditTypeData data = new AuditTypeData(); List <QSRDataObjects.AuditType> dataAudits = data.GetAllAuditTypes(); foreach (QSRDataObjects.AuditType at in dataAudits) { AuditType audittype = new AuditType(); audittype.AuditTypeID = Convert.ToInt32(at.AuditTypeID); audittype.Description = at.Description; audittype.IsAdmin = at.IsAdmin; audittypes.Add(audittype); } } catch (Exception ex) { ErrorRoutine(ex, "AuditType", "GetAllAuditTypes"); } return(audittypes); }