Пример #1
0
        private async void LoadForm(string transaction, Account account = null)
        {
            AccountForm form = new AccountForm()
            {
                TransactionForm   = transaction,
                AccountData       = (account == null) ? new Account() : account,
                PrimaryButtonText = (transaction == "Add Access Account") ? "Save" : "Update",
                IsEditTrans       = (transaction == "Add Access Account")
            };
            var result = await form.ShowAsync();

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

                switch (form.TransactionResult)
                {
                case 0:
                    message = (form.TransactionForm == "Add Access Account") ? "Access Account Inserted to the Database" : "Access Account 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();
            }
        }