public override void Delete(ILogEntry entity) { using (Context = new SysInventoryEntities()) { Context.LogEfs.Remove(Context.LogEfs.Find(entity.Id)); Context.SaveChanges(); } }
public override void Add(ILocation entity) { using (Context = new SysInventoryEntities()) { Context.LocationEfs.Add((LocationEf)entity); Context.SaveChanges(); } }
public override void Delete(ILocation entity) { using (Context = new SysInventoryEntities()) { var found = Context.LocationEfs.Find(entity.Id); if (found == null) { return; } Context.LocationEfs.Remove(found); Context.SaveChanges(); } }
public override void Add(Customer entity) { using (Context = new SysInventoryEntities()) { entity.Id = Guid.NewGuid(); entity.CreatedAt = DateTime.Now; entity.AddressFk = entity.Address.Id; entity.Address = null; entity.AddressTypeFk = entity.AddressType.Id; entity.AddressType = null; Context.Customers.Add(entity); Context.SaveChanges(); } }
public override void Update(ILocation entity) { using (Context = new SysInventoryEntities()) { var found = Context.LocationEfs.Find(entity.Id); if (found == null) { return; } found.ParentId = entity.ParentId; found.PoDId = entity.PoDId; found.Name = entity.Name; Context.SaveChanges(); } }
public override void Update(Customer entity) { using (Context = new SysInventoryEntities()) { var found = Context.Customers.Find(entity.Id); if (found == null) { return; } found.Mail = entity.Mail; found.Name = entity.Name; found.AddressFk = entity.Address.Id; found.AddressTypeFk = entity.AddressType.Id; Context.SaveChanges(); } }