예제 #1
0
 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();
     }
 }
예제 #2
0
 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();
 }
예제 #3
0
 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";
     }
 }