internal void SyncHersteller(Hersteller item) { HerstellerEntity ent = new HerstellerEntity() { HerstellerId = item.HerstellerId, Name = item.Name }; switch (item.SyncOperation) { case "INSERT": { dataHandler.InsertHersteller(ent); } break; case "UPDATE": { dataHandler.UpdateHersteller(ent); } break; case "DELETE": { dataHandler.DeleteHersteller(ent); } break; } }
public void DeleteHersteller(HerstellerEntity herstellerEntity) { hersteller result = (from x in db.hersteller where x.hersteller_id == herstellerEntity.HerstellerId select x).SingleOrDefault(); db.hersteller.Remove(result); db.SaveChanges(); }
public void UpdateHersteller(HerstellerEntity herstellerEntity) { hersteller result = (from x in db.hersteller where x.hersteller_id == herstellerEntity.HerstellerId select x).SingleOrDefault(); result.hersteller_id = Convert.ToInt32(herstellerEntity.HerstellerId); result.name = herstellerEntity.Name; db.SaveChanges(); }
public void InsertHersteller(HerstellerEntity herstellerEntity) { hersteller h = new hersteller() { hersteller_id = Convert.ToInt32(herstellerEntity.HerstellerId), name = herstellerEntity.Name }; db.hersteller.Add(h); db.SaveChanges(); }