Ejemplo n.º 1
0
        private void Dvokrevetna_Click(object sender, EventArgs e)
        {
            try
            {
                ISession s = DataLayer.GetSession();

                Entiteti.Hotel h = s.Load <Entiteti.Hotel>(24);

                Dvokrevetna d1 = new Dvokrevetna()
                {
                    Broj          = 35,
                    Sprat         = 4,
                    Radio         = "DA",
                    Tv            = "NE",
                    Kupatilo      = "DA",
                    Klima         = "NE",
                    Slobodno      = "DA",
                    More          = "DA",
                    Frizider      = "DA",
                    PripadaHotelu = h
                };

                s.Save(d1);

                s.Close();
            }
            catch (Exception ec)
            {
                MessageBox.Show(ec.Message);
            }
        }
Ejemplo n.º 2
0
        private void Button12_Click(object sender, EventArgs e)
        {
            try
            {
                ISession s = DataLayer.GetSession();

                BPdeo1.Entiteti.Hotel h = s.Load <BPdeo1.Entiteti.Hotel>(23);

                MessageBox.Show("Ucitan je Hotel " + h.Ime + ", koji se nalazi u " + h.Grad);

                s.Close();
            }
            catch (Exception ec)
            {
                MessageBox.Show(ec.Message);
            }
        }
Ejemplo n.º 3
0
        private void KreirajSport_Click(object sender, EventArgs e)
        {
            try
            {
                ISession       s = DataLayer.GetSession();
                Entiteti.Hotel h = s.Load <Entiteti.Hotel>(25);

                SportskeAktivnosti sa = new SportskeAktivnosti();

                sa.Aktivnost     = "Plivanje";
                sa.PripadaHotelu = h;

                s.Save(sa);

                s.Flush();
                s.Close();
            }
            catch (Exception ec)
            {
                MessageBox.Show(ec.Message);
            }
        }