private void btnuredi_Click(object sender, RoutedEventArgs e)
        {
            grid.Visibility = Visibility.Hidden;
            bool   uspesnost = false;
            int    id        = int.Parse(txt1.Text);
            int    stevilka  = int.Parse(txt2.Text);
            string ime       = txt3.Text;

            ServiceReference1.Studentski_dom dom = new ServiceReference1.Studentski_dom();

            dom.Id            = id;
            dom.Stevilka_Doma = stevilka;
            dom.Ime           = ime;
            if (id.ToString() != "" && stevilka.ToString() != "" && ime != "")
            {
                uspesnost = StudentskiDomovi.UrediDom(dom.Id, dom.Ime, dom.Stevilka_Doma);
            }
            if (uspesnost == true)
            {
                MessageBox.Show("Uspešno");
                txt1.Text = "";
                txt2.Text = "";
                txt3.Text = "";
            }
            else
            {
                MessageBox.Show("Napaka");
                txt1.Text = "";
                txt2.Text = "";
                txt3.Text = "";
            }
            grid.Visibility = Visibility.Visible;
            NapolniTabeloDomov();
        }
Exemplo n.º 2
0
        private void btnpotrdi_Click(object sender, RoutedEventArgs e)
        {
            bool   uspesnost    = false;
            string ime          = txt1.Text;
            int    stevilka     = int.Parse(txt2.Text);
            int    letonastanka = int.Parse(txt3.Text);


            ServiceReference1.Studentski_dom dom = new ServiceReference1.Studentski_dom();

            dom.Stevilka_Doma = stevilka;
            dom.Ime           = ime;
            dom.Leto_Nastanka = letonastanka;


            if (stevilka.ToString() != "" && ime != "" && letonastanka.ToString() != "")
            {
                uspesnost = StudentskiDomovi.DodajStudentskiDom(dom.Id, dom.Ime, dom.Leto_Nastanka);
            }
            if (uspesnost == true)
            {
                MessageBox.Show(" Uspešno!");

                txt1.Text = "";
                txt2.Text = "";
                txt3.Text = "";
            }
            else
            {
                MessageBox.Show(" Napaka!");

                txt1.Text = "";
                txt2.Text = "";
                txt3.Text = "";
            }
        }