private void SetValues() { UserEditingService service = new UserEditingService(); universityBox.DataSource = service.GetAllUniversities(); statusBox.DataSource = statusList; }
private void SetValues() { var service = new UserEditingService(currentUser); universityBox.DataSource = service.GetAllUniversities(); universityBox.SelectedItem = service.GetCurrentUniversity(); statusBox.DataSource = statusList; statusBox.SelectedItem = service.GetCurrentSetting("status"); }
private void AboutButton_Click(object sender, EventArgs e) { tabsController.SelectTab(aboutTab); var service = new UserEditingService(currentUser); var userInfo = service.GetUserInfo(); currentUserLabel.Text = currentUser; currentEmailLabel.Text = userInfo[0]; currentFirstnameLabel.Text = userInfo[1]; currentLastnameLabel.Text = userInfo[2]; currentUniversityLabel.Text = userInfo[3]; currentStatusLabel.Text = userInfo[4]; }
private void ChangeEmail_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(currentEmail.Text) || String.IsNullOrEmpty(newEmail.Text) || String.IsNullOrEmpty(newEmail2.Text)) { MessageBox.Show(Messages.emptyFields); Logger.Log(Messages.emptyFields); } else { UserEditingService service = new UserEditingService(currentUser); if (service.CheckEmailFormat(newEmail.Text) && service.CheckEmailFormat(newEmail2.Text)) { service.UpdateSetting("email", currentEmail.Text, newEmail.Text, newEmail2.Text, Messages.newEmailSameAsOld, Messages.emailUpdateSuccess, Messages.emailUpdateFailed, Messages.emailsDontMatch, Messages.emailIncorrect); ClearValues(); } } }