internal void SyncHauspaketAttributWert(HauspaketAttributWert item) { HauspaketAttributWertEntity ent = new HauspaketAttributWertEntity() { Archived = (item.Archived == "0" ? false : (item.Archived == "1" ? true : false)), AttributId = Convert.ToInt32(item.AttributId), WertId = Convert.ToInt32(item.WertId), WertOrdnung = Convert.ToInt32(item.WertOrdnung), WertText = item.WertText }; switch (item.SyncOperation) { case "INSERT": { dataHandler.InsertHauspaketAttributWert(ent); } break; case "UPDATE": { dataHandler.UpdateHauspaketAttributWert(ent); } break; case "DELETE": { dataHandler.DeleteHauspaketAttributWert(ent); } break; } }
public void DeleteHauspaketAttributWert(HauspaketAttributWertEntity hauspaketAttributWertEntity) { hauspaket_attribut_wert result = (from x in db.hauspaket_attribut_wert where x.wert_id == hauspaketAttributWertEntity.WertId select x).SingleOrDefault(); db.hauspaket_attribut_wert.Remove(result); db.SaveChanges(); }
public void UpdateHauspaketAttributWert(HauspaketAttributWertEntity hauspaketAttributWertEntity) { hauspaket_attribut_wert result = (from x in db.hauspaket_attribut_wert where x.wert_id == hauspaketAttributWertEntity.WertId select x).SingleOrDefault(); result.wert_id = hauspaketAttributWertEntity.WertId; result.attribut_id = hauspaketAttributWertEntity.AttributId; result.wert_ordnung = hauspaketAttributWertEntity.WertOrdnung; result.wert_text = hauspaketAttributWertEntity.WertText; result.archived = hauspaketAttributWertEntity.Archived; db.SaveChanges(); }
public void InsertHauspaketAttributWert(HauspaketAttributWertEntity hauspaketAttributWertEntity) { hauspaket_attribut_wert h = new hauspaket_attribut_wert() { wert_id = hauspaketAttributWertEntity.WertId, attribut_id = hauspaketAttributWertEntity.AttributId, wert_ordnung = hauspaketAttributWertEntity.WertOrdnung, wert_text = hauspaketAttributWertEntity.WertText, archived = hauspaketAttributWertEntity.Archived }; db.hauspaket_attribut_wert.Add(h); db.SaveChanges(); }