예제 #1
0
        public void edytujKategoriePrzepisow(string edytowanaKategoria, string nazwa)
        {
            Kategorie_Przepisy org = context.Kategorie_Przepisy.First(x => x.P_NAZWA == edytowanaKategoria);

            org.P_NAZWA = nazwa;
            context.SaveChanges();
        }
예제 #2
0
        public void usunKategoriePrzepisow(string nazwa)
        {
            Kategorie_Przepisy kp = context.Kategorie_Przepisy.First(x => x.P_NAZWA == nazwa);

            context.Kategorie_Przepisy.Remove(kp);
            context.SaveChanges();
        }
예제 #3
0
        public int dodajKategoriePrzepisow(string nazwa)
        {
            Kategorie_Przepisy kp = new Kategorie_Przepisy();

            kp.P_NAZWA = nazwa;
            context.Kategorie_Przepisy.Add(kp);
            context.SaveChanges();
            return(kp.P_ID_KATEGORII);
        }