Example #1
0
        internal void SyncHauspaketAttribut(HauspaketAttribut item)
        {
            HauspaketAttributEntity ent = new HauspaketAttributEntity()
            {
                AttributId         = Convert.ToInt32(item.AttributId),
                AttributTyp        = item.AttributTyp,
                AttributTypAnzeige = item.AttributTypAnzeige
            };

            switch (item.SyncOperation)
            {
            case "INSERT":
            {
                dataHandler.InsertHauspaketAttribut(ent);
            }
            break;

            case "UPDATE":
            {
                dataHandler.UpdateHauspaketAttribut(ent);
            }
            break;

            case "DELETE":
            {
                dataHandler.DeleteHauspaketAttribut(ent);
            }
            break;
            }
        }
Example #2
0
        public void DeleteHauspaketAttribut(HauspaketAttributEntity hauspaketAttributEntity)
        {
            hauspaket_attribut result = (from x in db.hauspaket_attribut
                                         where x.attribut_id == hauspaketAttributEntity.AttributId
                                         select x).SingleOrDefault();

            db.hauspaket_attribut.Remove(result);
            db.SaveChanges();
        }
Example #3
0
        public void UpdateHauspaketAttribut(HauspaketAttributEntity hauspaketAttributEntity)
        {
            hauspaket_attribut result = (from x in db.hauspaket_attribut
                                         where x.attribut_id == hauspaketAttributEntity.AttributId
                                         select x).SingleOrDefault();

            result.attribut_id          = hauspaketAttributEntity.AttributId;
            result.attribut_typ         = hauspaketAttributEntity.AttributTyp;
            result.attribut_typ_anzeige = hauspaketAttributEntity.AttributTypAnzeige;

            db.SaveChanges();
        }
Example #4
0
        public void InsertHauspaketAttribut(HauspaketAttributEntity hauspaketAttributEntity)
        {
            hauspaket_attribut h = new hauspaket_attribut()
            {
                attribut_id          = hauspaketAttributEntity.AttributId,
                attribut_typ         = hauspaketAttributEntity.AttributTyp,
                attribut_typ_anzeige = hauspaketAttributEntity.AttributTypAnzeige
            };

            db.hauspaket_attribut.Add(h);
            db.SaveChanges();
        }