Example #1
0
        public EditPotrebDialog(Potrebnost potrebnost)
        {
            InitializeComponent();

            Potrebnost = potrebnost ?? new PotrebKvartira();

            UpdateFiels();
        }
Example #2
0
        private void EditPotreb(Potrebnost potrebnost = null)
        {
            var dialog = new EditPotrebDialog(potrebnost);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                DataBase.Session.SaveOrUpdate(dialog.Potrebnost);
                DataBase.Session.Flush();

                UpdateList();
            }
        }
Example #3
0
        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox3.SelectedIndex)
            {
            case 0:
                Potrebnost = new PotrebKvartira();
                break;

            case 1:
                Potrebnost = new PotrebDom();
                break;

            case 2:
                Potrebnost = new PotrebZem();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            UpdateFiels();
        }