Example #1
0
        public static void insert_Preturi(string nume, double pret, DateTime data)
        {
            var bd = new DataLayer.Models.ProiectBDContext();

            Preturi pr = new Preturi
            {
                Nume = nume,
                Pret = pret,
                Data = data
            };

            bd.Preturis.Add(pr);
            bd.Entry(pr).State = System.Data.Entity.EntityState.Added;
            bd.SaveChanges();
        }
Example #2
0
        public static void insert_Preturi(string nume, double pret, DateTime data)
        {
            var bd = new DataLayer.Models.ProiectBDContext();

            Preturi pr = new Preturi
            {
                Nume = nume,
                Pret = pret,
                Data = data
            };

            bd.Preturis.Add(pr);
            bd.Entry(pr).State = System.Data.Entity.EntityState.Added;
            bd.SaveChanges();
        }