Esempio n. 1
0
        public void DeleteHersteller(HerstellerEntity herstellerEntity)
        {
            hersteller result = (from x in db.hersteller
                                 where x.hersteller_id == herstellerEntity.HerstellerId
                                 select x).SingleOrDefault();

            db.hersteller.Remove(result);
            db.SaveChanges();
        }
Esempio n. 2
0
        public void UpdateHersteller(HerstellerEntity herstellerEntity)
        {
            hersteller result = (from x in db.hersteller
                                 where x.hersteller_id == herstellerEntity.HerstellerId
                                 select x).SingleOrDefault();

            result.hersteller_id = Convert.ToInt32(herstellerEntity.HerstellerId);
            result.name          = herstellerEntity.Name;
            db.SaveChanges();
        }
Esempio n. 3
0
        public void InsertHersteller(HerstellerEntity herstellerEntity)
        {
            hersteller h = new hersteller()
            {
                hersteller_id = Convert.ToInt32(herstellerEntity.HerstellerId),
                name          = herstellerEntity.Name
            };

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