Exemple #1
0
 public void Insert(AuditView model)
 {
     using (var rep = new AuditRepository())
        {
        rep.Insert(ConvertToAudit(model));
        }
 }
Exemple #2
0
 public List<AuditView> Search(string SearchString)
 {
     using (var patientrepo = new AuditRepository())
        {
        return patientrepo.GetAll().Select(x => new AuditView() { UserName = x.UserName, Event = x.Event, TimeAccessed = x.TimeAccessed, AuditID = x.AuditID }).Where(s => s.UserName.ToUpper().Contains(SearchString.ToUpper())
        || s.UserName.ToUpper().Contains(SearchString.ToUpper())).ToList();
        }
 }
Exemple #3
0
 //public void Update(AuditViewModel modelView)
 //{
 //    using (var rep = new AuditRepository())
 //    {
 //        var dev = rep.GetById(modelView.AuditID);
 //        if (dev != null)
 //        {
 //         dev.UserName = modelView.UserName;
 //         dev.Event = modelView.Event;
 //         dev.TimeAccessed = modelView.TimeAccessed;
 //            rep.Update(dev);
 //        }
 //    }
 //}
 public void Delete(int model)
 {
     using (var rep = new AuditRepository())
        {
        var dev = rep.GetById(model);
        rep.Delete(dev);
        }
 }
Exemple #4
0
 public List<AuditView> ViewAll()
 {
     using (var rep = new AuditRepository())
        {
        return rep.GetAll().Select(x => new AuditView
        {
            AuditID = x.AuditID,
            UserName = x.UserName,
            Event = x.Event,
            TimeAccessed = x.TimeAccessed,
        }).ToList();
        }
 }