Esempio n. 1
0
 public override void Delete(ILocation entity)
 {
     using (Context = new SysInventoryLinqSqlContextDataContext())
     {
         Context.GetTable <Location>().DeleteOnSubmit(Context.GetTable <Location>().First(x => x.Id == entity.Id));
         Context.SubmitChanges();
     }
 }
Esempio n. 2
0
 public override void Delete(ILogEntry entity)
 {
     using (Context = new SysInventoryLinqSqlContextDataContext())
     {
         Context.Logs.DeleteOnSubmit(Context.Logs.First(l => l.LogId == entity.Id));
         Context.SubmitChanges();
     }
 }
Esempio n. 3
0
 public override void Add(ILocation entity)
 {
     using (Context = new SysInventoryLinqSqlContextDataContext())
     {
         entity.Id = Guid.NewGuid();
         Context.GetTable <Location>().InsertOnSubmit((Location)entity);
         Context.SubmitChanges();
     }
 }
Esempio n. 4
0
 public override void Update(ILocation entity)
 {
     using (Context = new SysInventoryLinqSqlContextDataContext())
     {
         var found = Context.GetTable <Location>().First(e => e.Id == entity.Id);
         found.ParentId = entity.ParentId;
         found.PoDId    = entity.PoDId;
         found.Name     = entity.Name;
         Context.SubmitChanges();
     }
 }