Esempio n. 1
0
        internal void SyncHauspaketAttributRegel(HauspaketAttributRegel item)
        {
            HauspaketAttributRegelEntity ent = new HauspaketAttributRegelEntity()
            {
                RegelAttributLeftId  = Convert.ToInt32(item.RegelAttributLeftId),
                RegelAttributRightId = Convert.ToInt32(item.RegelAttributRightId),
                RegelErlaubt         = (item.RegelErlaubt == "0" ? false : (item.RegelErlaubt == "1" ? true : false)),
                RegelId = Convert.ToInt32(item.RegelId),
                RegelPreisModifikator = Convert.ToDecimal(item.RegelPreisModifikator)
            };

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

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

            case "DELETE":
            {
                dataHandler.DeleteHauspaketAttributRegel(ent);
            }
            break;
            }
        }
Esempio n. 2
0
        public void DeleteHauspaketAttributRegel(HauspaketAttributRegelEntity hauspaketAttributRegelEntity)
        {
            hauspaket_attribut_regel result = (from x in db.hauspaket_attribut_regel
                                               where x.regel_id == hauspaketAttributRegelEntity.RegelId
                                               select x).SingleOrDefault();

            db.hauspaket_attribut_regel.Remove(result);
            db.SaveChanges();
        }
Esempio n. 3
0
        public void UpdateHauspaketAttributRegel(HauspaketAttributRegelEntity hauspaketAttributRegelEntity)
        {
            hauspaket_attribut_regel result = (from x in db.hauspaket_attribut_regel
                                               where x.regel_id == hauspaketAttributRegelEntity.RegelId
                                               select x).SingleOrDefault();

            result.regel_id = hauspaketAttributRegelEntity.RegelId;
            result.regel_attribut_left_id  = hauspaketAttributRegelEntity.RegelAttributLeftId;
            result.regel_attribut_right_id = hauspaketAttributRegelEntity.RegelAttributRightId;
            result.regel_preis_modifikator = hauspaketAttributRegelEntity.RegelPreisModifikator;
            result.regel_erlaubt           = hauspaketAttributRegelEntity.RegelErlaubt;

            db.SaveChanges();
        }
Esempio n. 4
0
        public void InsertHauspaketAttributRegel(HauspaketAttributRegelEntity hauspaketAttributRegelEntity)
        {
            hauspaket_attribut_regel h = new hauspaket_attribut_regel()
            {
                regel_id = hauspaketAttributRegelEntity.RegelId,
                regel_attribut_left_id  = hauspaketAttributRegelEntity.RegelAttributLeftId,
                regel_attribut_right_id = hauspaketAttributRegelEntity.RegelAttributRightId,
                regel_preis_modifikator = hauspaketAttributRegelEntity.RegelPreisModifikator,
                regel_erlaubt           = hauspaketAttributRegelEntity.RegelErlaubt
            };

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