Exemplo n.º 1
0
        public void Update(TrackedAction record)
        {
            List <string> recs = new List <string>();

            recs.Add(header);
            var r = list.Where(x => x.Id == record.Id).FirstOrDefault();

            list.Remove(r);
            list.Add(record);
            recs.AddRange(list.Select(x => x.Id + "," + x.IdentificationDetail + "," + x.ProcessName + "," + x.ApplicationPath + "," + x.Remarks + "," + x.HasBeenActedUpon + "," + x.CreatedAt).ToList());
            File.WriteAllLines(filePath, recs);
        }
Exemplo n.º 2
0
        public void Add(TrackedAction t)
        {
            try
            {
                using (var w = new WindowEvents())
                {
                    w.TrackedActions.Add(t);
                    w.SaveChanges();
                }
            }
            catch (Exception e)
            {

                throw;
            }
            
        }
Exemplo n.º 3
0
        public void Update(TrackedAction updated)
        {
            try
            {
                using (var w = new WindowEvents())
                {
                    var res = w.TrackedActions.Where(x => x.Id == updated.Id).FirstOrDefault();
                    res.Remarks = updated.Remarks;
                    res.HasBeenActedUpon = updated.HasBeenActedUpon;
                    w.SaveChanges();
                }
            }
            catch (Exception e)
            {

                throw;
            }

        }
Exemplo n.º 4
0
        public void WriteRecord(TrackedAction record)
        {
            var content = Environment.NewLine + record.Id + "," + record.IdentificationDetail + "," + record.ProcessName + "," + record.ApplicationPath + "," + record.Remarks + "," + record.HasBeenActedUpon + "," + record.CreatedAt;

            File.AppendAllText(filePath, content);
        }