Exemplo n.º 1
0
        public void insertNewTrener(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
            {
                TRENERZY trener = new TRENERZY()
                {
                    IMIE     = NTImieText.Text.ToUpper(),
                    NAZWISKO = NTNazwiskoText.Text.ToUpper(),
                };

                strzelnicaEntities.TRENERZY.Add(trener);
                strzelnicaEntities.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public void editTrener(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                int      id     = (int)ETWybNum.Value;
                TRENERZY trener = strz.TRENERZY.Find(id);

                if (ETImieText.Text != "")
                {
                    trener.IMIE = ETImieText.Text.ToUpper();
                }

                if (ETNazwiskoText.Text != "")
                {
                    trener.NAZWISKO = ETNazwiskoText.Text.ToUpper();
                }


                strz.SaveChanges();
                this.Close();
            }
        }