Esempio n. 1
0
        //potvrdi  dodaju

        private void button5_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                ISession s = DataLayer.GetSession();



                Entiteti.Saobracaj st = new Entiteti.Saobracaj()
                {
                    IdSektora  = int.Parse(textBox10.Text),
                    NazivUlice = textBox9.Text,
                };

                s.Save(st);
                s.Flush();
                s.Close();
                MessageBox.Show("Sektor " + st.NazivUlice + " dodat.");
                OsveziGridSa();
            }
            else
            {
                if (radioButton2.Checked == true)
                {
                    ISession s = DataLayer.GetSession();



                    Entiteti.VanredneSituacije st = new Entiteti.VanredneSituacije()
                    {
                        IdSektora = int.Parse(textBox10.Text),
                    };

                    s.Save(st);
                    s.Flush();
                    s.Close();
                    MessageBox.Show("Sektor " + st.IdSektora + " dodat.");
                    OsveziGrid();
                }
            }
        }
Esempio n. 2
0
        //potvrdi izmenu
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton4.Checked == true)
            {
                ISession s = DataLayer.GetSession();

                Entiteti.Saobracaj st = s.Load <Entiteti.Saobracaj>(int.Parse(textBox2.Text));

                st.NazivUlice = textBox1.Text;
                s.Update(st);
                s.Flush();
                s.Close();
                OsveziGridSa();

                textBox1.Clear();
            }
            else
            {
                MessageBox.Show("Nije moguce menjati podatke u ovom sektoru.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }