Esempio n. 1
0
        private void newExpMenuItem_Click(object sender, RoutedEventArgs e)
        {
            // Create new experiment information
            CreateExperimentInfo newExperimentInfo = new CreateExperimentInfo();

            newExperimentInfo.CreatorID = userDataModel.User.UserID;

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

            // Configure the dialog box
            dlg.Owner       = this;
            dlg.DataContext = newExperimentInfo;

            // 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 (experimentDataModel.AddNewExperiment(newExperimentInfo))
                {
                    // Reload the experiments
                    experimentDataModel.LoadUserExperiments(userDataModel.User);
                }
            }
        }
        private void newExpMenuItem_Click(object sender, RoutedEventArgs e)
        {
            // Create new experiment information
            CreateExperimentInfo newExperimentInfo = new CreateExperimentInfo();
            newExperimentInfo.CreatorID = userDataModel.User.UserID;

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

            // Configure the dialog box
            dlg.Owner = this;
            dlg.DataContext = newExperimentInfo;

            // 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 (experimentDataModel.AddNewExperiment(newExperimentInfo))
                {
                    // Reload the experiments
                    experimentDataModel.LoadUserExperiments(userDataModel.User);
                }
            }
        }