private async void LoadForm(string transaction, TaxonClass tclass = null) { ClassForm form = new ClassForm() { TransactionForm = transaction, ClassData = (tclass == null) ? new TaxonClass() : tclass, PrimaryButtonText = (transaction == "Add Class") ? "Save" : "Update" }; var result = await form.ShowAsync(); if (result == ContentDialogResult.Primary) { string message = ""; switch (form.TransactionResult) { case 0: message = (form.TransactionForm == "Add Class") ? "Class Inserted to the Database" : "Class Updated in the Database"; break; case 1: message = "The System had run to an Error"; break; case 2: message = "Information is Already Exists in the Database"; break; } MessageDialog dialog = new MessageDialog(message); await dialog.ShowAsync(); this.InitializePage(); } }
private void ClearForm() { msgPhylumName.Visibility = Visibility.Collapsed; msgClassName.Visibility = Visibility.Collapsed; ClassData = new TaxonClass(); VerifiedClasses = new TaxonClass().GetVerifiedClasses(); cbxPhylumName.ItemsSource = new TaxonPhylum().GetPhylumList(); TransactionForm = "Add Class"; PrimaryButtonText = "Save"; }