示例#1
0
        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;
            }
        }
示例#2
0
        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();
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }