Example #1
0
        private bool ValidateModel()
        {
            var result = true;

            if (result)
            {
                if (_view.comboBoxSection.SelectedIndex == 0)
                {
                    MessageBox.Show("Wybierz sekcje");
                    result = false;
                }
            }

            if (result)
            {
                var sectionList = _model.GetSections();

                var sectionText = (string)_view.comboBoxSection.SelectedItem;

                var section = sectionList.Where(p => p.Name == sectionText).FirstOrDefault();

                if (section == null)
                {
                    MessageBox.Show("Błąd sekcji");
                    result = false;
                }
            }

            return(result);
        }