Exemplo n.º 1
0
        private void addUserMenuItem_Click(object sender, RoutedEventArgs e)
        {
            // Create new user information
            CreateUserInfo newUserInfo = new CreateUserInfo();

            // Instantiate the dialog box
            CreateUserDialog dlg = new CreateUserDialog();

            // Configure the dialog box
            dlg.Owner            = this;
            dlg.DataContext      = newUserInfo;
            newUserInfo.Username = "";

            // Open the dialog box modally
            dlg.ShowDialog();

            // Process data entered by user if dialog box is accepted
            if (dlg.DialogResult == true)
            {
                // Try to add this new user to the database
                if (userDataModel.AddNewUser(newUserInfo))
                {
                }
                else
                {
                }
            }
        }
Exemplo n.º 2
0
        private void addUserMenuItem_Click(object sender, RoutedEventArgs e)
        {
            // Create new user information
            CreateUserInfo newUserInfo = new CreateUserInfo();

            // Instantiate the dialog box
            CreateUserDialog dlg = new CreateUserDialog();

            // Configure the dialog box
            dlg.Owner = this;
            dlg.DataContext = newUserInfo;
            newUserInfo.Username = "";

            // Open the dialog box modally 
            dlg.ShowDialog();

            // Process data entered by user if dialog box is accepted
            if (dlg.DialogResult == true)
            {
                // Try to add this new user to the database
                if (userDataModel.AddNewUser(newUserInfo))
                {
                }
                else
                {
                }
            }
        }