//Updates the edited user private void UpdateButton_Click(object sender, RoutedEventArgs e) { if (CheckInput()) { if (CheckForDuplicate()) { NewUser(); if (((User)ListBoxUsers.SelectedItem != null)) { ((User)ListBoxUsers.SelectedItem).Name = TextBoxName.Text; ((User)ListBoxUsers.SelectedItem).Email = TextBoxEmail.Text; ListBoxUsers.Items.Remove(ListBoxUsers.SelectedItem); } else if (((User)ListBoxAdmins.SelectedItem != null)) { ((User)ListBoxAdmins.SelectedItem).Name = TextBoxName.Text; ((User)ListBoxAdmins.SelectedItem).Email = TextBoxEmail.Text; ListBoxAdmins.Items.Remove(ListBoxAdmins.SelectedItem); } ButtonsDisabled(); UpdateButton.IsEnabled = false; ButtonCreateUser.IsEnabled = true; ListBoxUsers.IsEnabled = true; ListBoxAdmins.IsEnabled = true; TextBoxName.Clear(); TextBoxEmail.Clear(); } } }
/// <summary> /// Helper methods to display information in the Results textbox. /// </summary> private void ResultsClear() { TextBoxResults.Clear(); TextBoxLeadID.Clear(); TextBoxCapturedBy.Clear(); TextBoxCapturedDate.Clear(); TextBoxRegID.Clear(); TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxTitle.Clear(); TextBoxCompany.Clear(); TextBoxCompany2.Clear(); TextBoxAddress.Clear(); TextBoxAddress2.Clear(); TextBoxAddress3.Clear(); TextBoxCity.Clear(); TextBoxStateCode.Clear(); TextBoxZipCode.Clear(); TextBoxCountryCode.Clear(); TextBoxEmail.Clear(); TextBoxPhone.Clear(); TextBoxPhoneExt.Clear(); TextBoxFax.Clear(); TextBoxNotes.Clear(); dgvDemographics.DataSource = null; }
private void ButtonAjouter_OnClick(object sender, RoutedEventArgs e) { if (TextBoxNom.Text != "" & TextBoxPrenom.Text != "" & TextBoxSociete.Text != "" & TextBoxTelephone.Text != "" & TextBoxEmail.Text != "") // Si les champs ne sont pas vides, la création est impossible { SqlConnection connection = new SqlConnection(ConString); connection.Open(); // Ouvertue de la connexion SqlCommand cmdSqlCommand = new SqlCommand( "INSERT INTO dbo.Clients(Nom,Prenom,Societe,Telephone,Email) Values(@Nom, @Prenom, @Societe, @Telephone, @Email)", connection); // Requête d'insertion d'un nouveau client cmdSqlCommand.Parameters.AddWithValue("@Nom", TextBoxNom.Text); // Paramètre du Nom du client cmdSqlCommand.Parameters.AddWithValue("@Prenom", TextBoxPrenom.Text); // Paramètre du Prenom du client cmdSqlCommand.Parameters.AddWithValue("@Societe", TextBoxSociete.Text); // Paramètre de la Societe du client cmdSqlCommand.Parameters.AddWithValue("@Telephone", TextBoxTelephone.Text); // Paramètre du numéro de Telephone du client cmdSqlCommand.Parameters.AddWithValue("@Email", TextBoxEmail.Text); // Paramètre de l'Email du client cmdSqlCommand.ExecuteNonQuery(); // Execution de la requête MessageBox.Show("Le client " + TextBoxNom.Text + " " + TextBoxPrenom.Text + " " + "de la société " + TextBoxSociete.Text + " a été créé"); // Affichage du message après execution de la requête FillDataGrid(); // Recharge la table Clients TextBoxNom.Clear(); // Vide le champs Nom TextBoxPrenom.Clear(); // Vide le champs Prenom TextBoxSociete.Clear(); // Vide le champs Societe TextBoxTelephone.Clear(); // Vide le champs Telephone TextBoxEmail.Clear(); // Vide le champs Email connection.Close(); // Fermeture de la connexion } }
private void Resetuj(bool rez) { TextBoxAutomobilId.Clear(); TextBoxTipId.Clear(); TextBoxTipGoriva.Clear(); TextBoxBrend.Clear(); TextBoxModel.Clear(); TextBoxGodProizvodnje.Clear(); TextBoxBoja.Clear(); TextBoxKapacitet.Clear(); TextBoxBrVrata.Clear(); TextBoxVrstaMenjaca.Clear(); TextBoxRezervacijaId.Clear(); DateDatumIznajmljivanja.SelectedDate = DateTime.Today; DateDatumVracanja.SelectedDate = DateDatumIznajmljivanja.SelectedDate.Value.AddDays(1); TextBoxCenaAuta.Clear(); TextBoxCenaRezervoara.Clear(); TextBoxUkupnaCena.Clear(); TextBoxOpis.Clear(); if (rez) { TextBoxImeKlijenta.Clear(); comboKlijenti.SelectedIndex = -1; TextBoxImePrezime.Clear(); TextBoxDatum_rodjenja.Clear(); TextBoxEmail.Clear(); TextBoxBroj_telefona.Clear(); TextBoxBr_vozacke_dozvole.Clear(); TextBoxId.Clear(); } }
private void ButtonEffacer_OnClick(object sender, RoutedEventArgs e) { if (TextBoxNom.Text != "" & TextBoxPrenom.Text != "" & TextBoxSociete.Text != "" & TextBoxTelephone.Text != "" & TextBoxEmail.Text != "") // Si les champs ne sont pas vides, la création est impossible { SqlConnection connection = new SqlConnection(ConString); connection.Open(); // Ouvertue de la connexion SqlCommand cmdSqlCommand = new SqlCommand( "DELETE FROM dbo.Clients WHERE Id=@Id", connection); // Requête de suppression du client cmdSqlCommand.Parameters.AddWithValue("@Id", TextBoxId.Text); // Paramètre de l'Email du client if (MessageBox.Show("Oui ou Non", "Êtes vous sûr de vouloir supprimer ce client ?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) // Boite de dialogue demandant la confirmation pour la suppression du client { cmdSqlCommand.ExecuteNonQuery(); // Execution de la requête MessageBox.Show("Le client " + TextBoxNom.Text + " " + TextBoxPrenom.Text + " " + "de la société " + TextBoxSociete.Text + " a été supprimé"); // Affichage du message après execution de la requête } FillDataGrid(); // Recharge la table Clients TextBoxId.Clear(); TextBoxNom.Clear(); // Vide le champs Nom TextBoxPrenom.Clear(); // Vide le champs Prenom TextBoxSociete.Clear(); // Vide le champs Societe TextBoxTelephone.Clear(); // Vide le champs Telephone TextBoxEmail.Clear(); // Vide le champs Email connection.Close(); // Fermeture de la connexion } }
/// <summary> /// Allows the other pages to return to this initial screen. /// </summary> public void GoBack() { TextBoxEmail.Clear(); TextBoxPassword.Clear(); LabelAlert.Content = ""; Content = content; }
private void TextBoxEmail_Enter(object sender, EventArgs e) { if (TextBoxEmail.ForeColor == Color.DimGray && TextBoxEmail.Text == "Email") { TextBoxEmail.Clear(); TextBoxEmail.ForeColor = Color.Black; } }
public void CLearFields() { TextBoxSurname.Clear(); TextBoxName.Clear(); MaskedTBPhone.Clear(); TextBoxEmail.Clear(); LabelNumber.Text = ""; }
private void Resetuj() { TextBoxId.Clear(); TextBoxIme.Clear(); TextBoxPrezime.Clear(); TextBoxEmail.Clear(); ComboBox1.SelectedIndex = -1; }
private void ClearTextBoxes() { TextBoxFirst.Clear(); TextBoxLast.Clear(); TextBoxEmail.Clear(); PasswordBoxPassword.Clear(); TextBoxFirst.Focus(); }
private void ButtonRaz_OnClick(object sender, RoutedEventArgs e) { TextBoxId.Clear(); // Vide le champs ID TextBoxNom.Clear(); // Vide le champs Nom TextBoxPrenom.Clear(); // Vide le champs Prenom TextBoxSociete.Clear(); // Vide le champs Societe TextBoxTelephone.Clear(); // Vide le champs Telephone TextBoxEmail.Clear(); // Vide le champs Email }
public void ClearInputs() { TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxAge.Clear(); TextBoxEmail.Clear(); TextBoxAddress.Clear(); TextBoxSSN.Clear(); ComboBoxGender.SelectedIndex = -1; }
internal void ClearControls() { TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxCitizenID.Clear(); TextBoxContact.Clear(); DateTimeHireStaff.ResetText(); TextBoxAddress.Clear(); TextBoxCity.Clear(); TextBoxZipCode.Clear(); TextBoxEmail.Clear(); }
private void btnRecargar_Click(object sender, EventArgs e) { comboTipoDoc.SelectedIndex = -1; comboCargo.SelectedIndex = -1; TextBoxTelefono.Clear(); TextBoxApellido.Clear(); TextBoxNombre.Clear(); TextBoxDocumento.Clear(); TextBoxEmail.Clear(); RadioHombre.Checked = false; RadioMujer.Checked = false; }
//Create user button private void ButtonCreateUser_Click(object sender, RoutedEventArgs e) { if (CheckInput()) { if (CheckForDuplicate()) { NewUser(); TextBoxName.Clear(); TextBoxEmail.Clear(); } } ListBoxUsers.UnselectAll(); ListBoxAdmins.UnselectAll(); ButtonsDisabled(); }
private void SetControls(bool isEnabled) { if (InvokeRequired) { Invoke(new SetControlsDelegate(SetControls), isEnabled); } else { TextBoxEmail.Enabled = isEnabled; ButtonAddAdmin.Enabled = isEnabled; if (isEnabled) { TextBoxEmail.Clear(); } } }
private void ButtonModifier_OnClick(object sender, RoutedEventArgs e) { if (TextBoxId.Text != "" & TextBoxNom.Text != "" & TextBoxPrenom.Text != "" & TextBoxSociete.Text != "" & TextBoxTelephone.Text != "" & TextBoxEmail.Text != "") // Si les champs ne sont pas vides, la modification est impossible { SqlConnection connection = new SqlConnection(ConString); connection.Open(); // Ouvertue de la connexion SqlCommand cmdSqlCommand = new SqlCommand( "UPDATE dbo.Clients SET Nom=@Nom, Prenom=@Prenom ,Societe=@Societe, Telephone=@Telephone, Email=@Email WHERE Id=@Id" , connection); // Requête d'insertion d'un nouveau client cmdSqlCommand.Parameters.AddWithValue("@Id", TextBoxId.Text); // Paramètre de l'ID du client cmdSqlCommand.Parameters.AddWithValue("@Nom", TextBoxNom.Text); // Paramètre du Nom du client cmdSqlCommand.Parameters.AddWithValue("@Prenom", TextBoxPrenom.Text); // Paramètre du Prenom du client cmdSqlCommand.Parameters.AddWithValue("@Societe", TextBoxSociete.Text); // Paramètre de la Societe du client cmdSqlCommand.Parameters.AddWithValue("@Telephone", TextBoxTelephone.Text); // Paramètre du numéro de Telephone du client cmdSqlCommand.Parameters.AddWithValue("@Email", TextBoxEmail.Text); // Paramètre de l'Email du client cmdSqlCommand.ExecuteNonQuery(); // Execution de la requête int rows = cmdSqlCommand.ExecuteNonQuery(); // Variable qui stocke le nombre de requêtes effectuées if (rows > 1) { MessageBox.Show(rows + " requêtes ont bien été effectuées"); // Affichage du message après execution de la requête (dans le cas où il y en a plusieurs) } else { MessageBox.Show(rows + " requête a bien été effectuée"); // Affichage du message après execution de la requête (dans le cas où il n'y en a qu'une seule) } FillDataGrid(); // Recharge la table Clients TextBoxNom.Clear(); // Vide le champs Nom TextBoxPrenom.Clear(); // Vide le champs Prenom TextBoxSociete.Clear(); // Vide le champs Societe TextBoxTelephone.Clear(); // Vide le champs Telephone TextBoxEmail.Clear(); // Vide le champs Email connection.Close(); // Fermeture de la connexion } }
private void TextBoxEmail_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { TextBoxEmail.Clear(); }
private void ToolsStatus() { if (_TypeOperation == ClassPublicVar.TypeOperation.Show) { TextBoxID.ReadOnly = true; TextBoxGroupID.ReadOnly = true; TextBoxGroupName.ReadOnly = true; TextBoxNameLng1.ReadOnly = true; TextBoxNameLng2.ReadOnly = true; TextBoxAddress.ReadOnly = true; TextBoxCity.ReadOnly = true; TextBoxEmail.ReadOnly = true; TextBoxTelephone1.ReadOnly = true; TextBoxTelephone2.ReadOnly = true; TextBoxFax.ReadOnly = true; TextBoxMobile.ReadOnly = true; TextBoxCreditLimit.ReadOnly = true; TextBoxDebitTrans.ReadOnly = true; TextBoxCreditTrans.ReadOnly = true; TextBoxBalance.ReadOnly = true; ButtonNew.Enabled = true; ButtonEdit.Enabled = true; ButtonSave.Enabled = false; ButtonDelete.Enabled = true; ButtonPrint.Enabled = true; ButtonSearch.Enabled = true; ButtonCancel.Enabled = false; ButtonExit.Enabled = true; TreeViewMain.Enabled = true; RadioBtnGroup.Enabled = false; RadioBtnNotGroup.Enabled = false; buttonGroupSearch.Enabled = false; ButtonExit.Enabled = true; ButtonLast.Enabled = true; ButtonNext.Enabled = true; ButtonPrevious.Enabled = true; ButtonFirst.Enabled = true; TextBoxID.Clear(); TextBoxGroupID.Clear(); TextBoxGroupName.Clear(); TextBoxNameLng1.Clear(); TextBoxNameLng2.Clear(); TextBoxAddress.Clear(); TextBoxCity.Clear(); TextBoxEmail.Clear(); TextBoxTelephone1.Clear(); TextBoxTelephone2.Clear(); TextBoxFax.Clear(); TextBoxMobile.Clear(); TextBoxCreditLimit.Clear(); TextBoxDebitTrans.Clear(); TextBoxCreditTrans.Clear(); TextBoxBalance.Clear(); } else if (_TypeOperation == ClassPublicVar.TypeOperation.Add) { TextBoxID.ReadOnly = false; TextBoxGroupID.ReadOnly = false; TextBoxGroupName.ReadOnly = true; TextBoxNameLng1.ReadOnly = false; TextBoxNameLng2.ReadOnly = false; TextBoxAddress.ReadOnly = false; TextBoxCity.ReadOnly = false; TextBoxEmail.ReadOnly = false; TextBoxTelephone1.ReadOnly = false; TextBoxTelephone2.ReadOnly = false; TextBoxFax.ReadOnly = false; TextBoxMobile.ReadOnly = false; TextBoxCreditLimit.ReadOnly = false; TextBoxDebitTrans.ReadOnly = false; TextBoxCreditTrans.ReadOnly = false; TextBoxBalance.ReadOnly = false; ButtonNew.Enabled = true; ButtonEdit.Enabled = false; ButtonSave.Enabled = true; ButtonDelete.Enabled = false; ButtonPrint.Enabled = false; ButtonSearch.Enabled = false; ButtonCancel.Enabled = true; ButtonExit.Enabled = false; TreeViewMain.Enabled = false; RadioBtnGroup.Enabled = true; RadioBtnNotGroup.Enabled = true; buttonGroupSearch.Enabled = true; ButtonExit.Enabled = false; ButtonLast.Enabled = false; ButtonNext.Enabled = false; ButtonPrevious.Enabled = false; ButtonFirst.Enabled = false; TextBoxID.Clear(); TextBoxGroupID.Clear(); TextBoxGroupName.Clear(); TextBoxNameLng1.Clear(); TextBoxNameLng2.Clear(); TextBoxAddress.Clear(); TextBoxCity.Clear(); TextBoxEmail.Clear(); TextBoxTelephone1.Clear(); TextBoxTelephone2.Clear(); TextBoxFax.Clear(); TextBoxMobile.Clear(); TextBoxCreditLimit.Clear(); TextBoxDebitTrans.Clear(); TextBoxCreditTrans.Clear(); TextBoxBalance.Clear(); } else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit) { TextBoxID.ReadOnly = true; TextBoxGroupID.ReadOnly = false; TextBoxGroupName.ReadOnly = true; TextBoxNameLng1.ReadOnly = false; TextBoxNameLng2.ReadOnly = false; TextBoxAddress.ReadOnly = false; TextBoxCity.ReadOnly = false; TextBoxEmail.ReadOnly = false; TextBoxTelephone1.ReadOnly = false; TextBoxTelephone2.ReadOnly = false; TextBoxFax.ReadOnly = false; TextBoxMobile.ReadOnly = false; TextBoxCreditLimit.ReadOnly = false; TextBoxDebitTrans.ReadOnly = false; TextBoxCreditTrans.ReadOnly = false; TextBoxBalance.ReadOnly = false; ButtonNew.Enabled = true; ButtonEdit.Enabled = false; ButtonSave.Enabled = true; ButtonDelete.Enabled = false; ButtonPrint.Enabled = false; ButtonSearch.Enabled = false; ButtonCancel.Enabled = true; ButtonExit.Enabled = false; TreeViewMain.Enabled = false; RadioBtnGroup.Enabled = true; RadioBtnNotGroup.Enabled = true; buttonGroupSearch.Enabled = true; ButtonLast.Enabled = false; ButtonNext.Enabled = false; ButtonPrevious.Enabled = false; ButtonFirst.Enabled = false; //TextBoxID.Clear(); //TextBoxGroupID.Clear(); //TextBoxGroupName.Clear(); //TextBoxNameLng1.Clear(); //TextBoxNameLng2.Clear(); //TextBoxAddress.Clear(); //TextBoxCity.Clear(); //TextBoxEmail.Clear(); //TextBoxTelephone1.Clear(); //TextBoxTelephone2.Clear(); //TextBoxFax.Clear(); //TextBoxMobile.Clear(); //TextBoxCreditLimit.Clear(); //TextBoxDebitTrans.Clear(); //TextBoxCreditTrans.Clear(); //TextBoxBalance.Clear(); } }