Beispiel #1
0
        public void UpdateHauspaket(HauspaketEntity hauspaketEntity)
        {
            hauspaket result = (from x in db.hauspaket
                                where x.hauspaket_id == hauspaketEntity.HauspaketId
                                select x).SingleOrDefault();

            result.hauspaket_id  = hauspaketEntity.HauspaketId;
            result.benutzer_id   = hauspaketEntity.BenutzerId;
            result.berater_id    = hauspaketEntity.BeraterId;
            result.hersteller_id = hauspaketEntity.HerstellerId;
            result.bezeichnung   = hauspaketEntity.Bezeichnung;
            result.grundflaeche  = hauspaketEntity.Grundflaeche;
            result.wohnflaeche   = hauspaketEntity.Wohnflaeche;
            result.stockwerke    = hauspaketEntity.Stockwerke;
            result.preis         = hauspaketEntity.Preis;
            result.archived      = hauspaketEntity.Archived;


            db.SaveChanges();

            InsertSyncJn(new SyncJnEntity()
            {
                JnId        = Convert.ToInt32(DateTime.Now.Ticks),
                JnOperation = "update",
                JnPk        = hauspaketEntity.HauspaketId,
                JnTable     = "hauspaket",
                Synced      = false
            });
        }
Beispiel #2
0
        public void DeleteHauspaket(HauspaketEntity hauspaketEntity)
        {
            hauspaket result = (from x in db.hauspaket
                                where x.hauspaket_id == hauspaketEntity.HauspaketId
                                select x).SingleOrDefault();

            db.hauspaket.Remove(result);
            db.SaveChanges();
        }
Beispiel #3
0
        public void InsertHauspaket(HauspaketEntity hauspaketEntity)
        {
            hauspaket h = new hauspaket()
            {
                hauspaket_id  = hauspaketEntity.HauspaketId,
                benutzer_id   = hauspaketEntity.BenutzerId,
                berater_id    = hauspaketEntity.BeraterId,
                hersteller_id = hauspaketEntity.HerstellerId,
                bezeichnung   = hauspaketEntity.Bezeichnung,
                grundflaeche  = hauspaketEntity.Grundflaeche,
                wohnflaeche   = hauspaketEntity.Wohnflaeche,
                stockwerke    = hauspaketEntity.Stockwerke,
                preis         = hauspaketEntity.Preis,
                archived      = hauspaketEntity.Archived
            };

            db.hauspaket.Add(h);
            db.SaveChanges();
        }
Beispiel #4
0
        public HauspaketEntity GetHauspaket(int hid)
        {
            hauspaket h = (from x in db.hauspaket
                           where x.hauspaket_id == hid
                           select x).SingleOrDefault();

            return(new HauspaketEntity()
            {
                Archived = Convert.ToBoolean(h.archived),
                BenutzerId = Convert.ToInt32(h.benutzer_id),
                BeraterId = Convert.ToInt32(h.berater_id),
                Bezeichnung = h.bezeichnung,
                Grundflaeche = Convert.ToDecimal(h.grundflaeche),
                HauspaketId = h.hauspaket_id,
                HerstellerId = Convert.ToInt32(h.hersteller_id),
                Preis = Convert.ToDecimal(h.preis),
                Stockwerke = Convert.ToInt32(h.stockwerke),
                Wohnflaeche = Convert.ToDecimal(h.wohnflaeche)
            });
        }