示例#1
0
 public override void Delete(ILogEntry entity)
 {
     using (Context = new SysInventoryEntities())
     {
         Context.LogEfs.Remove(Context.LogEfs.Find(entity.Id));
         Context.SaveChanges();
     }
 }
示例#2
0
 public override void Add(ILocation entity)
 {
     using (Context = new SysInventoryEntities())
     {
         Context.LocationEfs.Add((LocationEf)entity);
         Context.SaveChanges();
     }
 }
示例#3
0
 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();
     }
 }
示例#4
0
 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();
     }
 }
示例#5
0
 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();
     }
 }
示例#6
0
 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();
     }
 }