private void newWorkerSubmit_Click(object sender, EventArgs e)
        {
            string newUserBannerId    = BannerTextBox.Text;
            string newUserFirstName   = FirstNameTextBox.Text;
            string newUserLastName    = LastNameTextBox.Text;
            string newUserPhoneNumber = PhoneNumberTextBox.Text;
            string newUserEmail       = EmailTextBox.Text;
            string newUserUserType    = UserTypeTextBox.Text;
            string newUserNotes       = NotesTextBox.Text;
            string newUserStatus      = StatusTextBox.Text;

            User newUser = new User(newUserBannerId, newUserFirstName, newUserLastName, newUserPhoneNumber, newUserEmail, newUserUserType, newUserNotes, newUserStatus);

            newUser.insert();

            BannerTextBox.Clear();
            FirstNameTextBox.Clear();
            LastNameTextBox.Clear();
            PhoneNumberTextBox.Clear();
            EmailTextBox.Clear();
            UserTypeTextBox.Clear();
            NotesTextBox.Clear();
            StatusTextBox.Clear();

            NewWorkerNotificationLabel.Text = "User added to database";
        }
Beispiel #2
0
 private void LoginButton_Click(object sender, EventArgs e)
 {
     if (registration == true)
     {
         if (LoginTextBox.Text != "" && PasswordTextBox.Text != "" && LastNameTextBox.Text != "" && EmailTextBox.Text != "" && RobotCheckBox.Checked == true && GenderComboBox.SelectedItem != null && BirthDateTimePicker.Value != null)
         {
             Users.Add(new User(LoginTextBox.Text, LastNameTextBox.Text, PasswordTextBox.Text, EmailTextBox.Text, GenderComboBox.SelectedItem, Convert.ToString(BirthDateTimePicker.Value)));
             folderBrowserDialog1.ShowDialog();
             File.AppendAllText(folderBrowserDialog1.SelectedPath + "\\Data.txt", $"Имя: {LoginTextBox.Text}, Фамилия: {LastNameTextBox.Text}, Электронная почта: {PasswordTextBox.Text}, Пароль: {EmailTextBox.Text}, Пол: {GenderComboBox.SelectedItem}, Дата рождения: {BirthDateTimePicker.Value}.\n");
             LoginTextBox.Clear();
             PasswordTextBox.Clear();
             LastNameTextBox.Clear();
             EmailTextBox.Clear();
             RobotCheckBox.Checked       = false;
             GenderComboBox.SelectedItem = "";
             BirthDateTimePicker.Value   = DateTime.Now;
         }
     }
     else
     {
         for (int i = 0; i < Users.Count; i++)
         {
             if (LoginTextBox.Text == User.GetInfo(Users[i], 0) && PasswordTextBox.Text == User.GetInfo(Users[i], 3))
             {
                 Sign sign = new Sign(User.GetInfo(Users[i], 0));
                 sign.TextLabel.Text = "Авторизация прошла успешно!";
                 sign.Show();
                 return;
             }
         }
         Sign form2 = new Sign();
         form2.TextLabel.Text = "Неправильный логин или пароль";
         form2.Show();
     }
 }
Beispiel #3
0
        /// <summary>
        /// Deletes contact information in the list and ListBox.
        /// </summary>
        private void RemoveContact()
        {
            var selectedIndex = AllContactsListBox.SelectedIndex;

            if (selectedIndex == -1)
            {
                MessageBox.Show("Select a contact from the list", "Warning",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
                //TODO: если после if-else нет никакой общей логики, тогда в if можно написать return, а else с лишней вложенностью убрать (+)
            }

            DialogResult result = MessageBox.Show("Do you really want to remove this contact?",
                                                  "Remove contact", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (result == DialogResult.OK)
            {
                var selectedContact = _contacts[selectedIndex];
                _project.Contacts.Remove(selectedContact);
                AllContactsListBox.Items.RemoveAt(selectedIndex);
                SurnameTextBox.Clear();
                NameTextBox.Clear();
                PhoneTextBox.Clear();
                EmailTextBox.Clear();
                VkIDTextBox.Clear();
                SaveToFile();
            }
            SortingFoundContacts();
        }
Beispiel #4
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            student.Name    = nameTextBox.Text;
            student.RollNo  = rollTextBox.Text;
            student.Contact = contactTextBox.Text;
            student.Email   = EmailTextBox.Text;

            if (SaveButton.Text.Equals("Update"))
            {
                manager.Update(student, roll);
                displayDataGridView.DataSource = manager.Show();
                SaveButton.Text = "Save";
                nameTextBox.Clear();
                rollTextBox.Clear();
                contactTextBox.Clear();
                EmailTextBox.Clear();
            }
            else
            {
                int isExecuted = manager.Save(student);
                if (isExecuted > 0)
                {
                    nameTextBox.Clear();
                    rollTextBox.Clear();
                    contactTextBox.Clear();
                    EmailTextBox.Clear();
                    displayDataGridView.DataSource = manager.Show();
                }
            }
        }
Beispiel #5
0
 private void resetFormToolStripMenuItem_Click(object sender, EventArgs e)
 {
     NameTextbox.Clear();
     EmailTextBox.Clear();
     MobileTextBox.Clear();
     AddressTextBox.Clear();
 }
 private bool IsFormValid()
 {
     if (NameTextBox.Text.Trim() == string.Empty)
     {
         Messages.ShowErrorMessage("Name is required");
         NameTextBox.Clear();
         NameTextBox.Focus();
         return(false);
     }
     if (EmailTextBox.Text.Trim() == string.Empty)
     {
         Messages.ShowErrorMessage("Email is required");
         EmailTextBox.Clear();
         EmailTextBox.Focus();
         return(false);
     }
     if (TelephoneTextBox.Text.Trim() == string.Empty)
     {
         Messages.ShowErrorMessage("Telephone is required");
         TelephoneTextBox.Clear();
         TelephoneTextBox.Focus();
         return(false);
     }
     return(true);
 }
 private void AddContactButtonClick(object sender, RoutedEventArgs e)
 {
     try
     {
         var contact = new Contact
         {
             Email     = EmailTextBox.Text,
             FirstName = FirstNameTextBox.Text,
             LastName  = LastNameTextBox.Text
         };
         MessageService.AddContact(contact);
         StatusBlock.Alert($"Contact {contact.Email} created successfully", StatusBlock.Success);
         EmailTextBox.Clear();
         FirstNameTextBox.Clear();
         LastNameTextBox.Clear();
     }
     catch (ItemAllreadyExistsException ex)
     {
         StatusBlock.Alert(ex.Message, StatusBlock.Danger);
     }
     catch (FormatException ex)
     {
         StatusBlock.Alert(ex.Message, StatusBlock.Warning);
     }
     catch (DbEntityValidationException)
     {
         StatusBlock.Alert("Validation failed for one of the fields", StatusBlock.Danger);
     }
     catch (Exception)
     {
         StatusBlock.Alert("Error while saving to database", StatusBlock.Danger);
     }
 }
Beispiel #8
0
 private void LimpiarObjetos()
 {
     UsuarioIdNumericUpDown.Value = 0;
     NombresTextBox.Clear();
     EmailTextBox.Clear();
     NoTelefonoMaskedTextBox.Clear();
     ContraseñaTextBox.Clear();
     MyErrorProvider.Clear();
 }
 //This method clears all textboxes and reset drop downs to default values
 private void ClearAllFields()
 {
     NameTextBox.Clear();
     AgeComboBox.SelectedItem    = 18;
     GenderComboBox.SelectedItem = "Select";
     EmailTextBox.Clear();
     CustomerStatusComboBox.SelectedItem       = "Select";
     CommunicationChannelComboBox.SelectedItem = "Select";
 }
Beispiel #10
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            nameTextBox.Clear();

            EmailTextBox.Clear();


            ConfirmTextBox.Clear();
        }
Beispiel #11
0
 private void ClearForm()
 {
     NameTextBox.Clear();
     EmailTextBox.Clear();
     PhoneTextBox.Clear();
     AddressTextBox.Clear();
     Products.Clear();
     TotalTextBox.Text = "0";
 }
Beispiel #12
0
 /// <summary>
 /// Clears all Text boxes
 /// </summary>
 private void ClearTextBoxes()
 {
     SurnameTextBox.Clear();
     NameTextBox.Clear();
     BirthdayDateTimePicker.Value = BirthdayDateTimePicker.MinDate;
     PhoneMaskedTextBox.Clear();
     EmailTextBox.Clear();
     VkTextBox.Clear();
 }
Beispiel #13
0
 /// <summary>
 /// Clears this instance.
 /// </summary>
 public void Clear()
 {
     ErrorMessageTextBlock.Visibility = Visibility.Collapsed;
     FirstNameTextBox.Clear();
     LastNameTextBox.Clear();
     EmailTextBox.Clear();
     PasswordBox.Clear();
     ConfirmPasswordBox.Clear();
     ZipCodeTextBox.Clear();
 }
Beispiel #14
0
 private void ClearText()
 {
     NameTextBox.Clear();
     AddressTextBox.Clear();
     PostalCodeTextBox.Clear();
     CityTextBox.Clear();
     TelephoneTextBox.Clear();
     EmailTextBox.Clear();
     ContactTypeComboBox.SelectedIndex = -1;
 }
Beispiel #15
0
 private void Limpiar()
 {
     UsuarioIdNumericUpDown.Value = 0;
     NombresTextBox.Clear();
     EmailTextBox.Clear();
     NoTelefonoMaskedTextBox.Clear();
     ContraseñaTextBox.Clear();
     SuperErrorProvider.Clear();
     FechadateTimePicker.Value = DateTime.Now;
 }
Beispiel #16
0
 private void DeleteButton_Click(object sender, EventArgs e)
 {
     manager.Delete(roll);
     displayDataGridView.DataSource = manager.Show();
     nameTextBox.Clear();
     rollTextBox.Clear();
     contactTextBox.Clear();
     EmailTextBox.Clear();
     SaveButton.Text = "Save";
 }
 private void Limpiar()
 {
     UsuarioIdNumericUpDown.Value = 0;
     RolIdComboBox.SelectedIndex  = 0;
     AliasTextBox.Clear();
     NombreTextBox.Clear();
     ClaveTextBox.Clear();
     ConfirmaClaveTextBox.Clear();
     ActivoCheckBox.Checked = false;
     EmailTextBox.Clear();
 }
Beispiel #18
0
 public void Limpiar()
 {
     ClienteIdNumericUpDown.Value = 0;
     NombresTextBox.Clear();
     ApellidosTextBox.Clear();
     NacimientoDateTimePicker.Value = DateTime.Now;
     DireccionTextBox.Clear();
     TelefonomaskedTextBox.Clear();
     CelularmaskedTextBox.Clear();
     EmailTextBox.Clear();
 }
 private void Limpiar()
 {
     IdNumericUpDown.Value = 0;
     AliasTextBox.Clear();
     NombreTextBox.Clear();
     EmailTextBox.Clear();
     ClaveTextBox.Clear();
     ConfirmClaveTextBox.Clear();
     FechaDateTimePicker.CustomFormat = "";
     ActivoCheckBox.Checked           = false;
     RolComboBox.Text = "";
 }
 private void Limpiar()
 {
     UsuarioIdNumericUpDown.Value = 0;
     RolIdComboBox.SelectedIndex  = 1;
     AliasTextBox.Clear();
     NombreTextBox.Clear();
     ClaveTextBox.Clear();
     ConfirmaClaveTextBox.Clear();
     ActivoCheckBox.Checked = false;
     EmailTextBox.Clear();
     FechaIngresoDateTimePicker.Value = DateTime.Now;
 }
Beispiel #21
0
 public void Limpiar()
 {
     UsuarioIdNumericUpDown.Value = 0;
     AliasTextBox.Clear();
     NombreTextBox.Clear();
     ClaveTextBox.Clear();
     ConfirmarClaveTextBox.Clear();
     EmailTextBox.Clear();
     FechaCreacionDateTimePicker.Value = DateTime.Now;
     RolComboBox.Text       = " ";
     ActivoCheckBox.Checked = false;
 }
 private void Limpiar()
 {
     IdNumericUpDown.Value = 0;
     AliasTextBox.Clear();
     EmailTextBox.Clear();
     NombreTextBox.Clear();
     ClaveTextBox.Clear();
     ConfirmarTextBox.Clear();
     FechaDateTimePicker.Value = DateTime.Now;
     ActivoCheckBox.Checked    = false;
     errorProvider1.Clear();
 }
 private void NuevoButton_Click(object sender, EventArgs e)
 {
     ProveedorIdTextBox.Clear();
     NombreEmpresaTextBox.Clear();
     DireccionTextBox.Clear();
     TelefonoMaskedTextBox.Clear();
     EmailTextBox.Clear();
     RNCTextBox.Clear();
     NombreRepresentanteTextBox.Clear();
     CelularMaskedTextBox.Clear();
     ProveedorIdTextBox.ReadOnly = false;
 }
Beispiel #24
0
 private void Limpiar()
 {
     UsuarioIdNumericUpDown.Value = 0;
     NombreTextBox.Clear();
     UsuarioTextBox.Clear();
     ClaveTextBox.Clear();
     ConfirmarClaveTextBox.Clear();
     RolComboBox.Text = "";
     EmailTextBox.Clear();
     ActivoCheckBox.Checked = false;
     MyErrorProvider.Clear();
 }
        /// <summary>
        /// Handles the Click event of the NoButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
        private void NoButton_Click(object sender, RoutedEventArgs e)
        {
            FirstNameTextBox.Clear();
            LastNameTextBox.Clear();
            EmailTextBox.Clear();
            PasswordBox.Clear();
            ConfirmPasswordBox.Clear();
            ZipCodeTextBox.Clear();
            GetEmailCheckBox.IsChecked = null;

            this.NavigationService.GoBack();
        }
Beispiel #26
0
 private void Limpiar()
 {
     IDNumericUpDown1.Value = 0;
     NombresTextBox.Clear();
     AliasTextBox.Clear();
     ClaveConfirmTextBox.Clear();
     EmailTextBox.Clear();
     errorProvider1.Clear();
     FechaDateTimePicker.CustomFormat = " ";
     ClaveTextBox.Clear();
     ActivoCheckBox.Checked = false;
     RolComboBox.Text       = " ";
 }
Beispiel #27
0
 public void Limpiar()
 {
     MyErrorProvider.Clear();
     IdUsuarioNumericUpDown.Value = 0;
     AliasTextBox.Clear();
     NombreUsuarioTextBox.Clear();
     ClaveTextBox.Clear();
     RolComboBox.Text   = "Elegir";
     Fecha.CustomFormat = " ";
     EmailTextBox.Clear();
     ConfirmarClaveTextBox.Clear();
     ActivoCheckBox.Checked = false;
 }
Beispiel #28
0
 private void SaveLoginDetailsCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     data.savelogindata = ((CheckBox)sender).Checked;
     if (!string.IsNullOrEmpty(EmailTextBox.Text) && !string.IsNullOrEmpty(PasswordTextBox.Text) && !((CheckBox)sender).Checked)
     {
         if (File.Exists(pathtoacc))
         {
             File.Delete(pathtoacc);
         }
         EmailTextBox.Clear();
         PasswordTextBox.Clear();
         data.savelogindata = false;
     }
 }
Beispiel #29
0
        // Регистрация со всеми проверками
        private void RegistrationButton_Click(object sender, EventArgs e)
        {
            Checking checking = new Checking();

            if (!checking.Login(LoginTextBox.Text))
            {
                PromptLabel.Text = "Не верный формат имени пользователя";
            }
            else if (!checking.Email(EmailTextBox.Text))
            {
                PromptLabel.Text = "Не верный формат e-mail";
            }
            else if (!checking.Password(PasswordTextBox.Text))
            {
                PromptLabel.Text = "Не верный формат пароля";
            }
            else if (PasswordTextBox.Text.CompareTo(RepeatPasswordTextBox.Text) != 0)
            {
                PromptLabel.Text = "Пароли не совпадают";
            }
            else if (!checking.LoginInBase(LoginTextBox.Text))
            {
                PromptLabel.Text = "Пользователь уже существует или проблема с базой";
            }
            else
            {
                string path = @"logins\" + LoginTextBox.Text[0] + ".txt";
                string text = LoginTextBox.Text + "|" + EmailTextBox.Text + "|" + PasswordTextBox.Text + "\r\n";
                try
                {
                    File.AppendAllText(path, text);
                    path = @"users_lists\" + LoginTextBox.Text + ".txt";
                    using (StreamWriter sw = new StreamWriter(path))
                    {
                        sw.Write("");
                    }
                }
                catch
                {
                    MessageBox.Show("Простите, в работе с базой пользователей что-то пошло не так");
                    return;
                }
                PasswordTextBox.Clear();
                RepeatPasswordTextBox.Clear();
                LoginTextBox.Clear();
                EmailTextBox.Clear();
                PromptLabel.Text = "Вы успешно зарегистрированы";
            }
        }
        private void Limpiar()
        {
            PasanteIdNumericUpDown.Value      = 0;
            FechaCreacionDateTimePicker.Value = DateTime.Now.Date;
            NombrePasanteTextBox.Clear();
            MatriculaTextBox.Clear();
            EmailTextBox.Clear();
            HorasARealizarTextBox.Clear();
            TelefonoTextBox.Clear();
            ComentarioTextBox.Clear();
            MyErrorProvider.Clear();

            this.Detalle = new List <HabilidadesDetalle>();
            CargarGrid();
        }