예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                ISession s = DataLayer.GetSession();


                Entiteti.Zaposleni z = new Entiteti.Zaposleni();
                z.jmbg            = 1234512345;
                z.ime             = "Goran";
                z.ImeOca          = "Janko";
                z.Prezime         = "ivic";
                z.GodinaRodjenja  = new DateTime(1991, 6, 10);
                z.DatumZaposlenja = new DateTime(2011, 6, 10);
                z.RadniStaz       = 4;


                s.Save(z);


                s.Flush();
                s.Close();
            }
            catch (Exception ec)
            {
                MessageBox.Show(ec.Message);
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                ISession s = DataLayer.GetSession();


                WebHosting.Entiteti.Zaposleni z = s.Load <WebHosting.Entiteti.Zaposleni>(1602993733514);

                MessageBox.Show(z.ime);
                MessageBox.Show(z.Prezime);

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