void ShowChosenActivite(string NumeroActivite) { string chosenAct = " "; MySqlCommand ChosenCommand; MySqlDataReader ChosenReader; Connection.Open(); //while (QuestionReader.Read()) if (Connection != null) { ChosenCommand = Connection.CreateCommand(); ChosenCommand.CommandText = "Select TitreActivite from activites where NumeroActivite ='" + NumeroActivite + "'"; ChosenReader = ChosenCommand.ExecuteReader(); while (ChosenReader.Read()) { chosenAct = ChosenReader["TitreActivite"].ToString(); DropDownList1.Text = chosenAct; //ddl_ajout_date.Items.Add(ActivityName); } ChosenReader.Close(); Connection.Close(); } else { //connexion non réussie Response.Redirect("Accueil.aspx"); } }
public void SetCommandOption(int option) { string message = null; switch (option) { case 1: message = "Added product to list"; break; case 2: message = "You choose to redo last added product"; break; case 3: message = "You choose to undo last added product"; break; case 4: message = "Why did you do that!?"; break; } ChosenCommand?.Invoke(this, new ChosenCommandEventArgs { message = message }); _command = CommandFactory.GetCommand(option); }
/// <summary> /// Updates the preview of the currently selected command to the new arguments /// </summary> protected void UpdatePreview() { //Only display if the system is in the correct state if (ShouldPreview) { //Remove any existing preview or suggestions from the box AuxillaryBox.RemoveAllChildren(); //Get the potential output from the selected command PText preview = ChosenCommand.Preview(Selection, Arguments); //Format the output for display preview.ConstrainWidthToTextWidth = false; preview.Width = Background.Width; preview.X = Background.Bounds.Left; preview.Y = Background.Bounds.Bottom; //Display the output AuxillaryBox.AddChild(preview); } }