示例#1
0
        private void SetValues()
        {
            UserEditingService service = new UserEditingService();

            universityBox.DataSource = service.GetAllUniversities();
            statusBox.DataSource     = statusList;
        }
示例#2
0
        private void SetValues()
        {
            var service = new UserEditingService(currentUser);

            universityBox.DataSource   = service.GetAllUniversities();
            universityBox.SelectedItem = service.GetCurrentUniversity();
            statusBox.DataSource       = statusList;
            statusBox.SelectedItem     = service.GetCurrentSetting("status");
        }
示例#3
0
        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];
        }
示例#4
0
 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();
         }
     }
 }