Пример #1
0
        public void dismissSecretaryTest()
        {
            CHeadOfDepartment hod = new CHeadOfDepartment("test", "test", "test", "test", "test");
            CSecretary        s   = new CSecretary("test", "test", "test", "test", "test");

            hod.addSecretary(s.Id, s.Name);
            hod.dismissSecretary(s.Id);
            DataTable dt = Program.get_dt("SELECT id from login WHERE Id='test'");

            Assert.IsTrue(dt.Rows.Count == 0);
        }
Пример #2
0
        public void addSecretaryTest()
        {
            CHeadOfDepartment hod = new CHeadOfDepartment("test", "test", "test", "test", "test");
            CSecretary        s   = new CSecretary("test", "test", "test", "test", "test");

            hod.addSecretary(s.Id, s.Name);
            DataTable dt = Program.get_dt("SELECT id,f_name from login WHERE Id='test'");

            Assert.IsTrue(dt.Rows[0][0].ToString() == s.Id && dt.Rows[0][1].ToString() == s.Name);
            Program.update_sql("DELETE login WHERE id='TEST'");
        }
Пример #3
0
 private void enter_button_Click(object sender, EventArgs e)
 {/*add sercretary to data base*/
     if (!Program.chackId(IDText.Text.ToString().ToString()))
     {
         MessageBox.Show("invalid id");
         return;
     }
     if (Hod.addSecretary(IDText.Text.ToString(), NameText.Text.ToString()))
     {
         MessageBox.Show("Success");
     }
     else
     {
         MessageBox.Show("You could not add a secretary.");
     }
 }