private void updateSatusButton_Click(object sender, EventArgs e) { addStatusButton.Visible = false; updateSatusButton.Visible = false; statusProgressTextBox.ReadOnly = true; statusDescriptionTextBox.ReadOnly = true; statusEventTextBox.ReadOnly = true; foreach (Status statusFromList in statusList) { if (statusListBox.SelectedItem.ToString() == statusFromList.Event) { Status newStatus = new Status(); newStatus = statusFromList; newStatus.Description = statusDescriptionTextBox.Text; newStatus.Event = statusEventTextBox.Text; newStatus.Progress = statusProgressTextBox.Text; service.UpdateCurrentStatus(statusFromList.Id, newStatus); MessageBox.Show("Status updated!"); } } user = service.Login(user.Email, user.Password); this.Close(); InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); }
private void userRegisterButton_Click(object sender, EventArgs e) { User user = service.Register(userNameTextBox.Text, userCityTextBox.Text, userTelephoneTextBox.Text, userEmailTextBox.Text, userPasswordTextBox.Text); InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); this.Close(); MessageBox.Show("Registered!"); }
private void loginButton_Click(object sender, EventArgs e) { User user = service.Login(emailTextBox.Text, passwordTextBox.Text); if (user != null) { InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); this.Visible = false; } else { MessageBox.Show("Wrong credentials!"); } }
private void deleteInternshipButton_Click(object sender, EventArgs e) { foreach (Internship internshipFromList in internshipList) { if (internshipListBox.SelectedItem.ToString() == internshipFromList.Company) { internshipListBox.Items.Remove(internshipFromList.Company); MessageBox.Show(service.DeleteCurrentInternship(internshipFromList.Id)); } } user = service.Login(user.Email, user.Password); this.Close(); InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); }
private void deleteStatusButton_Click(object sender, EventArgs e) { foreach (Status statusFromList in statusList) { if (statusListBox.SelectedItem.ToString() == statusFromList.Event) { statusListBox.Items.Remove(statusFromList.Event); MessageBox.Show(service.DeleteCurrentStatus(statusFromList.Id) ); } } user = service.Login(user.Email, user.Password); this.Close(); InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); }
private void addStatusButton_Click(object sender, EventArgs e) { addStatusButton.Visible = false; updateSatusButton.Visible = false; statusProgressTextBox.ReadOnly = true; statusDescriptionTextBox.ReadOnly = true; statusEventTextBox.ReadOnly = true; service.CreateAStatus(statusEventTextBox.Text, statusDescriptionTextBox.Text, statusProgressTextBox.Text); MessageBox.Show("Status created!"); user = service.Login(user.Email, user.Password); this.Close(); InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); }
private void userUpdateButton_Click(object sender, EventArgs e) { User newUser = new User(); newUser = user; newUser.Email = userEmailTextBox.Text; newUser.City = userCityTextBox.Text; newUser.Name = userNameTextBox.Text; newUser.Telephone = userTelephoneTextBox.Text; InternshipViewForm internshipViewForm = new InternshipViewForm(service.UpdateCurrentUser(user.Id, newUser)); internshipViewForm.Show(); this.Close(); MessageBox.Show("User updated!"); }
private void updateCompanyButton_Click(object sender, EventArgs e) { addInternshipButton.Visible = false; updateCompanyButton.Visible = false; companyCityTextBox.ReadOnly = true; companyDescriptionTextBox.ReadOnly = true; companyEmailTextBox.ReadOnly = true; companyIsPaidTextBox.ReadOnly = true; companyPositionTextBox.ReadOnly = true; companyNameTextBox.ReadOnly = true; foreach (Internship internshipFromList in internshipList) { if (internshipListBox.SelectedItem.ToString() == internshipFromList.Company) { Internship newInternship = new Internship(); newInternship = internshipFromList; newInternship.City = companyCityTextBox.Text; newInternship.Company = companyNameTextBox.Text; newInternship.Position = companyPositionTextBox.Text; newInternship.Paid = companyIsPaidTextBox.Text; newInternship.Email = companyEmailTextBox.Text; newInternship.Description = companyDescriptionTextBox.Text; service.UpdateCurrentInternship(internshipFromList.Id, newInternship); MessageBox.Show("Internship modified!"); } } user = service.Login(user.Email, user.Password); this.Close(); InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); }
private void addInternshipButton_Click(object sender, EventArgs e) { addInternshipButton.Visible = false; updateCompanyButton.Visible = false; companyCityTextBox.ReadOnly = true; companyDescriptionTextBox.ReadOnly = true; companyEmailTextBox.ReadOnly = true; companyIsPaidTextBox.ReadOnly = true; companyPositionTextBox.ReadOnly = true; companyNameTextBox.ReadOnly = true; service.CreateAnIntership(companyNameTextBox.Text, companyPositionTextBox.Text, companyIsPaidTextBox.Text, companyCityTextBox.Text, companyEmailTextBox.Text, companyDescriptionTextBox.Text); MessageBox.Show("Internship created!"); user = service.Login(user.Email, user.Password); this.Close(); InternshipViewForm internshipViewForm = new InternshipViewForm(user); internshipViewForm.Show(); }