コード例 #1
0
        private async void LoadForm(string transaction, TaxonPhylum phylum = null)
        {
            PhylumForm form = new PhylumForm()
            {
                TransactionForm   = transaction,
                PhylumData        = (phylum == null) ? new TaxonPhylum() : phylum,
                PrimaryButtonText = (transaction == "Add Phylum") ? "Save" : "Update"
            };
            var result = await form.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                string message = "";

                switch (form.TransactionResult)
                {
                case 0:
                    message = (form.TransactionForm == "Add Phylum") ? "Phylum Inserted to the Database" : "Phylum 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();
            }
        }
コード例 #2
0
        private void ClearForm()
        {
            msgDomainName.Visibility  = Visibility.Collapsed;
            msgKingdomName.Visibility = Visibility.Collapsed;
            msgPhylumName.Visibility  = Visibility.Collapsed;

            PhylumData    = new TaxonPhylum();
            VerifiedPhyla = new TaxonPhylum().GetVerifiedPhyla();

            chkIsKingdomPlant.IsChecked = true;
            chkIsKingdomPlant_CheckChanged(chkIsKingdomPlant, null);

            TransactionForm   = "Add Phylum";
            PrimaryButtonText = "Save";
        }