public void AddEmployeeControl_negativeIDValue()
        {
            DBConnection_Accessor       db  = new DBConnection_Accessor();
            Delete_Accessor             d   = new Delete_Accessor(db.GetDB());
            SearchFunction_Accessor     sf  = new SearchFunction_Accessor(db.GetDB());
            AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB());

            try
            {
                d.DeletePerson(-500);
            }
            catch (Exception)
            {
            }
            String[] D = new String[] { "-500", "", "", "", "", "-500", "", "", "" };

            ErrorWindow ew = aec.createEmployee(D);
            DataTable   dt = null;

            try
            {
                dt = sf.SearchPersonID("abc");
            }
            catch (Exception e) { };
            Assert.IsTrue(dt.Rows.Count == 0);
            Assert.IsNotNull(ew);
        }
        public void AddEmployeeControl_createDuplicate()
        {
            DBConnection_Accessor       db  = new DBConnection_Accessor();
            Delete_Accessor             d   = new Delete_Accessor(db.GetDB());
            SearchFunction_Accessor     sf  = new SearchFunction_Accessor(db.GetDB());
            AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB());

            String[] D = new String[] { "10011", "Sean", "5555555555", "calgary", "M", "10011", "30000", "12/12/12", "" };

            try
            {
                d.DeletePerson(10011);
            }
            catch (Exception)
            {
            }
            aec.createEmployee(D);
            ErrorWindow ew = aec.createEmployee(D);
            DataTable   dt = sf.SearchPersonID("10011");

            Assert.IsTrue(dt.Rows.Count == 1);
            Assert.IsNotNull(ew);
        }
        public void AddEmployeeControl_badManagerID()
        {
            DBConnection_Accessor       db  = new DBConnection_Accessor();
            Delete_Accessor             d   = new Delete_Accessor(db.GetDB());
            SearchFunction_Accessor     sf  = new SearchFunction_Accessor(db.GetDB());
            AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB());

            String[] D = new String[] { "10011", "", "", "", "", "10011", "", "", "101019" };

            try
            {
                d.DeletePerson(10011);
            }
            catch (Exception)
            {
            }
            ErrorWindow ew = aec.createEmployee(D);
            DataTable   dt = sf.SearchPersonID("10011");

            Assert.IsTrue(dt.Rows.Count == 0);
            Assert.IsNotNull(ew);
        }
        public void AddEmployeeControl_negativeIDValue()
        {
            DBConnection_Accessor db = new DBConnection_Accessor();
            Delete_Accessor d = new Delete_Accessor(db.GetDB());
            SearchFunction_Accessor sf = new SearchFunction_Accessor(db.GetDB());
            AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB());

            try
            {
                d.DeletePerson(-500);
            }
            catch (Exception)
            {

            }
            String[] D = new String[] { "-500", "", "", "", "", "-500", "", "", "" };

            ErrorWindow ew = aec.createEmployee(D);
            DataTable dt = null;
            try
            {
                dt = sf.SearchPersonID("abc");
            }
            catch (Exception e) { };
            Assert.IsTrue(dt.Rows.Count == 0);
            Assert.IsNotNull(ew);
        }
        public void AddEmployeeControl_createDuplicate()
        {
            DBConnection_Accessor db = new DBConnection_Accessor();
            Delete_Accessor d = new Delete_Accessor(db.GetDB());
            SearchFunction_Accessor sf = new SearchFunction_Accessor(db.GetDB());
            AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB());

            String[] D = new String[] { "10011", "Sean", "5555555555", "calgary", "M", "10011", "30000", "12/12/12", "" };

            try
            {
                d.DeletePerson(10011);
            }
            catch (Exception)
            {

            }
            aec.createEmployee(D);
            ErrorWindow ew = aec.createEmployee(D);
            DataTable dt = sf.SearchPersonID("10011");
            Assert.IsTrue(dt.Rows.Count == 1);
            Assert.IsNotNull(ew);
        }
        public void AddEmployeeControl_badManagerID()
        {
            DBConnection_Accessor db = new DBConnection_Accessor();
            Delete_Accessor d = new Delete_Accessor(db.GetDB());
            SearchFunction_Accessor sf = new SearchFunction_Accessor(db.GetDB());
            AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB());

            String[] D = new String[] { "10011", "", "", "", "", "10011", "", "", "101019" };

            try
            {
                d.DeletePerson(10011);
            }
            catch (Exception)
            {

            }
            ErrorWindow ew = aec.createEmployee(D);
            DataTable dt = sf.SearchPersonID("10011");
            Assert.IsTrue(dt.Rows.Count == 0);
            Assert.IsNotNull(ew);
        }