public DerecognitionOfHours_Form()
 {
     InitializeComponent();
     this.sqlConnection  = SQLConnection.GetSqlConnection();
     headOfDepartmentSQL = new HeadOfDepartmentSQL(sqlConnection);
     headOfDepartmentSQL.LoadPeopleWithDerecognitionRequestListView(ref this.listView);
 }
예제 #2
0
        private void resetHours_Button_Click(object sender, EventArgs e)
        {
            if (listView.SelectedItems.Count == 0)
            {
                MessageBox.Show("No request was selected.");
                return;
            }
            else if (listView.SelectedItems.Count > 1)
            {
                MessageBox.Show("Choose only one request at the time.");
                return;
            }
            TeachingAssistantSQL teachingAssistant = new TeachingAssistantSQL();

            try
            {
                teachingAssistant.Insert_actualTeachingHours(0, this.listView.SelectedItems[0].SubItems[2].Text, "TeachingAssistantTable");
            }
            catch (Exception)
            { }
            try
            {
                teachingAssistant.Insert_actualTeachingHours(0, this.listView.SelectedItems[0].SubItems[2].Text, "LecturerTable");
            }
            catch (Exception) { }

            listView.Clear();
            headOfDepartmentSQL.LoadPeopleWithDerecognitionRequestListView(ref this.listView);
        }
        private void choose_Button_Click(object sender, EventArgs e)
        {
            if (listView.SelectedItems.Count == 0)
            {
                MessageBox.Show("No request was selected.");
                return;
            }
            else if (listView.SelectedItems.Count > 1)
            {
                MessageBox.Show("Choose only one request at the time.");
                return;
            }
            TeachingAssistantSQL teachingAssistant = new TeachingAssistantSQL();

            teachingAssistant.Insert_actualTeachingHours(int.Parse(this.listView.SelectedItems[0].SubItems[5].Text) * (-1), this.listView.SelectedItems[0].SubItems[2].Text, "TeachingAssistantTable");
            headOfDepartmentSQL.removeRequest(this.listView.SelectedItems[0].SubItems[2].Text);
            listView.Clear();
            headOfDepartmentSQL.LoadPeopleWithDerecognitionRequestListView(ref this.listView);
        }