コード例 #1
0
        private bool IsInputValid()
        {
            if (string.IsNullOrEmpty(this.FirstNameTextBox.Text))
            {
                InputHelper.DisplayError("First name cannot be empty.");
                return(false);
            }

            if (string.IsNullOrEmpty(this.SurnameNameTextBox.Text))
            {
                InputHelper.DisplayError("Surname cannot be empty.");
                return(false);
            }

            if (string.IsNullOrEmpty(this.GenderComboBox.SelectedValue.ToString()))
            {
                InputHelper.DisplayError("Gender cannot be empty.");
                return(false);
            }

            if (this.BirthdayDatePicker.SelectedDate is null)
            {
                InputHelper.DisplayError("Birthday cannot be empty.");
                return(false);
            }

            return(true);
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: Semptra/HRDepartment
 private void App_DispatcherUnhandledExceptionHandler(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     InputHelper.DisplayError(e.Exception.Message);
     e.Handled = true;
 }