Beispiel #1
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            ModifyCarPresenter modifyCarPresenter = new ModifyCarPresenter(this);

            if (modifyCarPresenter.SaveModification().Keys.Contains(false))
            {
                this.ShowWarning(modifyCarPresenter.SaveModification()[false]);
            }
            else
            {
                this.ShowSuccessInfo("Dane samochodu zostały zmodyfikowane!");
                this.saveButton.Enabled = false;
            }
        }
Beispiel #2
0
        private void SearchButton_Click(object sender, EventArgs e)
        {
            AddCarPresenter addCarPresenter = new AddCarPresenter(this);

            addCarPresenter.ClearCarData();

            ModifyCarPresenter modifyCarPresenter = new ModifyCarPresenter(this);

            modifyCarPresenter.ValidateSearchCriteria();

            if (ValidationResult.Keys.Contains(false))
            {
                this.ShowWarning(ValidationResult[false]);
                this.saveButton.Enabled = false;
            }
            else if (ValidationResult.Keys.Contains(true))
            {
                modifyCarPresenter.LoadCarData();
                this.saveButton.Enabled = true;
            }
        }