Exemple #1
0
        public AuditTrail GetData(int ID)
        {
            AuditTrail           mod = new AuditTrail(_context);
            ApplicationDbContext ent = new ApplicationDbContext();
            Conflict             rec = ent.Conflict.FirstOrDefault(s => s.Id == ID);

            if (rec != null)
            {
                mod.Id             = rec.Id;
                mod.AdminRole      = rec.AdminRole;
                mod.ConflictDate   = rec.ConflictDate;
                mod.ConflictStatus = rec.ConflictStatus;
                mod.CreatedBy      = rec.CreatedBy;
                mod.EmailID        = rec.EmailID;
                //mod.Journals = rec.Journals;
                mod.MostrecentjournalDate = rec.MostrecentjournalDate;
                mod.Question1             = rec.Question1;
                mod.Question2             = rec.Question2;
                mod.Question3             = rec.Question3;
                mod.Question4             = rec.Question4;
                mod.Question5             = rec.Question5;
                mod.Question6             = rec.Question6;
            }
            return(mod);
        }
Exemple #2
0
        public List <AuditTrail> GetAllData(bool ShowDeleted)
        {
            List <AuditTrail>    rslt          = new List <AuditTrail>();
            ApplicationDbContext ent           = new ApplicationDbContext();
            List <Conflict>      SearchResults = new List <Conflict>();

            //if (ShowDeleted)
            SearchResults = ent.Conflict.ToList();
            //else
            //    SearchResults = ent.Conflict.Where(s => s.Deleted == false).ToList();

            foreach (var record in SearchResults)
            {
                AuditTrail rec = new AuditTrail(_context);
                rec.Id             = record.Id;
                rec.ConflictDate   = record.ConflictDate;
                rec.ConflictStatus = record.ConflictStatus;
                rec.EmailID        = record.EmailID;
                rec.CreatedBy      = record.CreatedBy;
                // rec.Journals = record.Journals;
                rec.MostrecentjournalDate = record.MostrecentjournalDate;
                rec.Question1             = record.Question1;
                rec.Question2             = record.Question2;
                rec.Question3             = record.Question3;
                rec.Question4             = record.Question4;
                rec.Question5             = record.Question5;
                rec.Question6             = record.Question6;
                //rec. = record.Journals;
                rslt.Add(rec);
            }
            return(rslt);
        }