Exemplo n.º 1
0
 public DrvoredView(Drvored d) : base(d)
 {
     Ulica       = d.Ulica;
     Duzina      = d.Duzina;
     BrojStabala = d.BrojStabala;
     VrstaDrveta = d.VrstaDrveta;
 }
Exemplo n.º 2
0
        private void btnGetZelenePovrsine_Click(object sender, EventArgs e)
        {
            try
            {
                ISession s = DataLayer.GetSession();

                String rez = "";

                IList <ZelenaPovrsina> lista = s.QueryOver <ZelenaPovrsina>().List <ZelenaPovrsina>();

                foreach (ZelenaPovrsina zp in lista)
                {
                    rez += zp.Id + ": " + zp.TipPovrsine + ", opština " + zp.Opstina + ", " + zp.ZonaUgrozenosti;
                    if (zp.GetType() == typeof(Travnjak))
                    {
                        Travnjak t = (Travnjak)zp;
                        rez += ", " + t.AdresaZgrade + (t.Povrsina == null? "" : ", površina u arima - " + t.Povrsina);
                    }
                    else if (zp.GetType() == typeof(Drvored))
                    {
                        Drvored d = (Drvored)zp;
                        rez += ", " + d.Ulica + ", " + d.VrstaDrveta
                               + (d.Duzina == null? "" : ", dužina u metrima - " + d.Duzina)
                               + (d.BrojStabala == null? "" : ", broj stabala - " + d.BrojStabala);
                    }
                    else if (zp.GetType() == typeof(Park))
                    {
                        Park p = (Park)zp;
                        rez += ", " + p.Naziv
                               + (p.Povrsina == null? "" : ", pavršina u hetarima - " + p.Povrsina);
                    }
                    rez += "\n\n";
                }

                MessageBox.Show(rez);

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