Beispiel #1
0
        /// <summary>
        /// Purpose: Grabs audit information based on ID
        /// Accepts: Int
        /// Returns: Nothing
        /// </summary>
        public void GetAuditByID(int id)
        {
            try
            {
                AuditData data = new AuditData();
                Hashtable hsh = new Hashtable();

                hsh = data.GetAuditByID(id);

                AuditID = id;
                AuditTypeID = Convert.ToInt32(hsh["audittypeid"]);
                UserID = Convert.ToInt32(hsh["userid"]);
                AdminID = Convert.ToInt32(hsh["adminid"]);
                Notes = hsh["notes"];
                Created = hsh["created"];
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "Audit", "GetAuditByID");
            }
        }
Beispiel #2
0
        /// <summary>
        /// Purpose: Grabs all audits
        /// Accepts: Nothing
        /// Returns: List<Audit>
        /// </summary>
        public List<Audit> GetAllAudits()
        {
            List<Audit> audits = new List<Audit>();
            try
            {
                AuditData data = new AuditData();
                List<QSRDataObjects.Audit> dataAudits = data.GetAllAudits();

                foreach (QSRDataObjects.Audit a in dataAudits)
                {
                    Audit audit = new Audit();
                    audit.AuditID = a.AuditID;
                    audit.AuditTypeID = Convert.ToInt32(a.AuditTypeID);
                    audit.UserID = Convert.ToInt32(a.UserID);
                    audit.AdminID = Convert.ToInt32(a.AdminID);
                    audit.Notes = a.Notes;
                    audit.Created = a.Created;
                    audits.Add(audit);
                }
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "Audit", "GetAllAudits");
            }
            return audits;
        }