private void btnShowProperties_Click(object sender, EventArgs e)
 {
     if (this.PropertyList.Properties.Count > 0)
     {
         PropertiesView plv = new PropertiesView(this.PropertyList.Properties.InOrder(), null);
         plv.ShowDialog();
     }
     else
     {
         MessageBox.Show("This should not happen");
     }
 }
示例#2
0
        private void btnShowProperties_Click(object sender, EventArgs e)
        {
            if (this.Person.PropertyLists.Count > 0)
            {
                InputDialog id = new InputDialog("Catastral area name:", "", true);
                id.onDispose += (search) =>
                {
                    LinkedList <PropertyList> pl = new LinkedList <PropertyList>();
                    if (search != "")
                    {
                        if (Int32.TryParse(search, out int ss))
                        {
                            this.Person.PropertyLists.PreOrder((p) =>
                            {
                                if (p.CadastralArea.ID == ss)
                                {
                                    pl.AddLast(p);
                                }
                            });
                        }
                        else
                        {
                            pl = this.Person.PropertyLists.PreOrder((p) =>
                            {
                                if (p.CadastralArea.Name == search)
                                {
                                    pl.AddLast(p);
                                }
                            });
                        }
                    }
                    else
                    {
                        pl = this.Person.PropertyLists.PreOrder();
                    }

                    if (pl.Count > 0)
                    {
                        PropertiesView plv = new PropertiesView(pl, this.Person);
                        plv.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("There is no properties in this cadastral area");
                    }
                };
                id.ShowDialog();
            }
            else
            {
                MessageBox.Show("This should not happen");
            }
        }