Exemplo n.º 1
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsEmployeeCollection AllEmployees = new clsEmployeeCollection();
            //create the item of test data
            ClsEmployee TestEmployee = new ClsEmployee();
            //var to store the primary key
            Int32 PrimaryKey = 117;

            //set its properties
            TestEmployee.Emp_Name   = "Jake Wills";
            TestEmployee.Job_Name   = "Supporter";
            TestEmployee.Manager_ID = 2;
            TestEmployee.Hire_Date  = DateTime.Now.Date;
            TestEmployee.Salary     = 22000;
            TestEmployee.Dep_ID     = 3;
            TestEmployee.Active     = true;
            //set ThisAddress to the test data
            AllEmployees.ThisEmployee = TestEmployee;
            //add the record
            PrimaryKey = AllEmployees.Add();
            //set the primary key of the test data
            TestEmployee.Emp_ID = PrimaryKey;
            //find the record
            AllEmployees.ThisEmployee.Find(PrimaryKey);
            //delete the record
            AllEmployees.Delete();
            //now find the record
            Boolean Found = AllEmployees.ThisEmployee.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 2
0
    void DeleteEmployee()
    {
        //function to deleate selected record
        //create an  new instance of employee
        clsEmployeeCollection EmployeeList = new clsEmployeeCollection();

        //find the recor to deleate
        EmployeeList.ThisEmployee.Find(EmployeeNo);
        //DELEATE YJE RECORD
        EmployeeList.Delete();
    }
Exemplo n.º 3
0
    void DeleteEmployee()
    {
        //function to delete the selected record

        //create a new instance of the address book
        clsEmployeeCollection EmployeeBook = new clsEmployeeCollection();

        //find the record to delete
        EmployeeBook.ThisEmployee.Find(emp_ID);
        //delete the record
        EmployeeBook.Delete();
    }