private void CreateProjectCreateButtom_Click(object sender, EventArgs e) { if (CreateProjectCustomerComboBox.SelectedItem == null) { Models.NeedCustommerWarningPopup needCustommerWarningPopup = new Models.NeedCustommerWarningPopup(); needCustommerWarningPopup.ShowDialog(); } else { List <Models.User> attandances = new List <Models.User>(); attandances.Add(currUser); foreach (string attendance in projectAttendances) { attandances.Add(database.GetUserByName(attendance)); } database.addProject(new Models.Project(currUser, CreateProjectTitleTextBox.Text, database.GetCustomerByName(CreateProjectCustomerComboBox.SelectedItem.ToString()), CreateProjectAdressTextBox.Text, richTextBox1.Text, attandances, new List <Models.Attachment>()), attandances); ProjectsMenuItem_Click(sender, e); //ChangeTab(ProjectTab, ProjectsMenuItem); projectAttendances.Clear(); CreateProjectAdressTextBox.Clear(); CreateProjectAttendanceComboBox.Items.Clear(); CreateProjectAttendanceRichTextBox.Clear(); CreateProjectCustomerComboBox.Items.Clear(); CreateProjectTitleTextBox.Clear(); richTextBox1.Clear(); } }
private void CreateProjectCancelButtom_Click(object sender, EventArgs e) { ChangeTab(ProjectTab, ProjectsMenuItem); projectAttendances.Clear(); CreateProjectAdressTextBox.Clear(); CreateProjectAttendanceComboBox.Items.Clear(); CreateProjectAttendanceRichTextBox.Clear(); CreateProjectCustomerComboBox.Items.Clear(); CreateProjectTitleTextBox.Clear(); richTextBox1.Clear(); }
private void CreateProjectAttendanceComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (projectAttendances.Contains(CreateProjectAttendanceComboBox.SelectedItem)) { projectAttendances.Remove(CreateProjectAttendanceComboBox.SelectedItem.ToString()); } else { projectAttendances.Add(CreateProjectAttendanceComboBox.SelectedItem.ToString()); } CreateProjectAttendanceRichTextBox.Clear(); foreach (string projectAttendance in projectAttendances) { CreateProjectAttendanceRichTextBox.Text += $"{projectAttendance}\n"; } }