public static void dodajNeNastavnoLice(NeNastavnoLiceBasic n) { try { ISession s = DataLayer.GetSession(); NeNastavnoOsoblje o = new NeNastavnoOsoblje(); o.LIme = n.Ime; o.ImeRoditelja = n.Ime_Roditelja; o.Prezime = n.Prezime; o.Jmbg = n.Jmbg; o.Adresa = n.Adresa; o.Sprema = n.sprema; o.Sektor = n.sektor; o.DatumRodjenja = n.DatumRodjenja; s.SaveOrUpdate(o); s.Flush(); s.Close(); } catch (Exception ec) { //handle exceptions } }
public static NeNastavnoLiceBasic azurirajNeNastavnoLice(NeNastavnoLiceBasic n) { try { ISession s = DataLayer.GetSession(); NeNastavnoOsoblje o = s.Load <NeNastavnoOsoblje>(n.Id); o.LIme = n.Ime; o.ImeRoditelja = n.Ime_Roditelja; o.Prezime = n.Prezime; o.Jmbg = n.Jmbg; o.Adresa = n.Adresa; o.Sektor = n.sektor; o.Sprema = n.sprema; o.DatumRodjenja = n.DatumRodjenja; s.Update(o); s.Flush(); s.Close(); } catch (Exception ec) { //handle exceptions } return(n); }
private void btnIzmeni_Click(object sender, EventArgs e) { if (listaNenastavnogOsoblja.SelectedItems.Count == 0) { MessageBox.Show("Izaberite nenastavno lice koje zelite da izmenite!"); return; } int idOsobe = Int32.Parse(listaNenastavnogOsoblja.SelectedItems[0].SubItems[0].Text); NeNastavnoLiceBasic n = DTOManager.vratiNeNastavnoLice(idOsobe); DodajNeNastavnoLiceForm forma = new DodajNeNastavnoLiceForm(n); forma.ShowDialog(); popuniTabeluPodacima(); }
public static NeNastavnoLiceBasic vratiNeNastavnoLice(int id) { NeNastavnoLiceBasic ob = new NeNastavnoLiceBasic(); try { ISession s = DataLayer.GetSession(); NeNastavnoOsoblje o = s.Load <NeNastavnoOsoblje>(id); ob = new NeNastavnoLiceBasic(o.Id, o.LIme, o.ImeRoditelja, o.Prezime, o.Jmbg, o.Adresa, o.Sektor, o.Sprema, o.DatumRodjenja); s.Close(); } catch (Exception ec) { //handle exceptions } return(ob); }
public DodajNeNastavnoLiceForm(NeNastavnoLiceBasic n) { InitializeComponent(); this.osoblje = n; btnSacuvaj.Text = "Izmeni"; }
public DodajNeNastavnoLiceForm() { InitializeComponent(); btnSacuvaj.Text = "Dodaj"; this.osoblje = new NeNastavnoLiceBasic(); }