void DeleteStaff()
    {
        clsStaffCollection StaffList = new clsStaffCollection();

        StaffList.ThisStaff.Find(staffId);
        StaffList.Delete();
    }
Exemplo n.º 2
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllRecords = new clsStaffCollection();
            //create the item of test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.FullName    = "Rooks Dokrat";
            TestItem.StaffPwd    = "default!";
            TestItem.DateOfBirth = Convert.ToDateTime("15/12/1998");
            TestItem.Salary      = 9.50M;
            TestItem.FullTime    = false;
            //Set ThisRecord to the test data
            AllRecords.ThisRecord = TestItem;
            //Add the record
            PrimaryKey = AllRecords.Add();
            //set the primary key of the test data
            TestItem.StaffID = PrimaryKey;
            //set the record based on the new test data
            AllRecords.ThisRecord = TestItem;
            //find the record
            AllRecords.ThisRecord.Find(PrimaryKey);
            //delete the record
            AllRecords.Delete();
            //now find the record
            Boolean Found = AllRecords.ThisRecord.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
Exemplo n.º 3
0
        public void DeleteMethod()
        {
            //create and instance of the class
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create the item of test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.StaffID  = 1;
            TestItem.Email    = "*****@*****.**";
            TestItem.Name     = "George Hamilton";
            TestItem.Password = "******";
            //set thisStaff to the test data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaff.Add();
            //set the primary key of the test data
            TestItem.StaffID = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 4
0
        public void StaffDeleteMethodOK()
        {
            //create an instance of the class we wantto create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create an item for tests data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its props
            //TestItem.StaffNo = 0;
            TestItem.FirstName = "TestAddMethodFirstName";
            TestItem.LastName  = "TestAddMethodLastName";
            TestItem.Email     = "*****@*****.**";
            TestItem.Position  = "TestPos";
            TestItem.TeleNo    = "07969960008";
            //Set this staff to the test data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaff.Add();
            //set the primary key of the test data
            TestItem.StaffNo = PrimaryKey;
            //find the recird
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 5
0
        public void DeleteMethodOK()
        {
            clsStaffCollection AllStaffs = new clsStaffCollection();

            Class_Library.clsStaff TestItem = new Class_Library.clsStaff();
            Int32 PrimaryKey = 0;


            TestItem.StaffFirstName = "Kim";
            TestItem.StaffLastName  = "Amir";
            TestItem.ContactNumber  = "07876547";
            TestItem.NINumber       = "987654456.";
            TestItem.TaxCode        = "P65.";
            TestItem.DateStarted    = DateTime.Now.Date;
            TestItem.DateEnded      = DateTime.Now.Date;
            TestItem.Salary         = Convert.ToDecimal("1266.00");
            TestItem.Shift          = true;;

            AllStaffs.ThisStaff = TestItem;
            PrimaryKey          = AllStaffs.Add();
            TestItem.StaffNo    = PrimaryKey;
            AllStaffs.ThisStaff.Find(PrimaryKey);
            AllStaffs.Delete();
            Boolean Found = AllStaffs.ThisStaff.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Exemplo n.º 6
0
        public void DeleteMethodOK()
        {
            // Create an instance of the class.
            clsStaffCollection AllStaff = new clsStaffCollection();
            // Create the test data.
            clsStaff TestItem = new clsStaff();
            // Var to store the primary key.
            Int32 PrimaryKey = 0;

            // Set its properties.
            TestItem.StaffName   = "Bob";
            TestItem.Wage        = 72.4;
            TestItem.GrantAccess = true;
            TestItem.DateOfBirth = DateTime.Now.AddYears(-60);
            TestItem.Email       = "*****@*****.**";
            // Set the current staff to the test object.
            AllStaff.CurrentStaff = TestItem;
            // Add the record.
            PrimaryKey = AllStaff.Add();
            // Set the primary key of the test data.
            TestItem.StaffID = PrimaryKey;
            // Find the record.
            AllStaff.CurrentStaff.Find(PrimaryKey);
            // Delete the record.
            AllStaff.Delete();
            // Find the record.
            Boolean Found = AllStaff.CurrentStaff.Find(PrimaryKey);

            // Test to see that the record was not found.
            Assert.IsFalse(Found);
        }
Exemplo n.º 7
0
        public void DeleteMethodOK()
        {
            //create an instance of the Staff Collection Class
            clsStaffCollection AllStaff = new clsStaffCollection();
            //Create item to test data
            clsStaff TestItem = new clsStaff();
            //Var to store the primary key
            Int32 PrimaryKey = 0;

            //Set properties
            TestItem.Id          = 2;
            TestItem.Name        = "Oskar Karcz";
            TestItem.Email       = "*****@*****.**";
            TestItem.PhoneNumber = 112;
            TestItem.Roles       = "Admin";
            TestItem.Gender      = false;
            TestItem.DOB         = Convert.ToDateTime("19/04/1996");
            //set ThisStaff to the test data
            AllStaff.ThisStaff = TestItem;
            //Add record
            PrimaryKey = AllStaff.Add();
            //Set primary key of the test data
            TestItem.Id = PrimaryKey;
            //Find record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //Delete the record
            AllStaff.Delete();
            //Find record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //Test to check record not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 8
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaffs = new clsStaffCollection();
            //create the item of test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set it's properties
            TestItem.StaffId    = 10;
            TestItem.Name       = "Syed";
            TestItem.Phonenum   = "123456789123456";
            TestItem.Salary     = 19999.99m;
            TestItem.DateJoined = DateTime.Now.Date;
            TestItem.Active     = true;
            //set ThisAddress to the test data
            AllStaffs.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaffs.Add();
            //set the primary key of the test data
            TestItem.StaffId = PrimaryKey;
            //find the record
            AllStaffs.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaffs.Delete();
            //now find the record
            Boolean Found = AllStaffs.ThisStaff.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
Exemplo n.º 9
0
        public void DeleteMethodOkay()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create the item of the test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.StaffExists = true;
            TestItem.StaffId     = 19;
            TestItem.Name        = "Bob Builder";
            TestItem.DateStarted = DateTime.Now.Date;
            TestItem.JobRole     = "Sales Assistant";
            TestItem.Email       = "*****@*****.**";
            //set ThisSTaff to the test data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaff.Add();
            //set the primary key to the test data
            TestItem.StaffId = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see the record was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create the item of test data
            clsStaff TestItem   = new clsStaff();
            Int32    PrimaryKey = 0;

            //set its properties
            TestItem.StaffNo       = 1;
            TestItem.FirstName     = "John";
            TestItem.LastName      = "Smith";
            TestItem.StaffAddress  = "Some Address";
            TestItem.StaffPhoneNo  = 1234567891;
            TestItem.StaffPostCode = "LE7 6AB";
            //set ThisStaff to test the data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey       = AllStaff.Add();
            TestItem.StaffNo = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 11
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create the item of test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.StaffID       = 200;
            TestItem.FullName      = "Full Name";
            TestItem.Salary        = 7.78;
            TestItem.DateOfJoining = DateTime.Now.Date;
            TestItem.Position      = "staff";
            TestItem.FullTime      = true;
            TestItem.Active        = true;
            //set this staff to the test data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaff.Add();
            //set the primary key of the test data
            TestItem.StaffID = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
        public void UpdateMethodOk()
        {
            clsStaffCollection AllStaff = new clsStaffCollection();

            clsStaff TestItem = new clsStaff();

            Int32 PrimaryKey = 0;

            TestItem.Name      = "Steve,Harris";
            TestItem.Email     = "*****@*****.**";
            TestItem.Hire_Date = DateTime.Now.Date;
            TestItem.Salary    = 7000.00;
            TestItem.Active    = true;
            AllStaff.ThisStaff = TestItem;
            PrimaryKey         = AllStaff.Add();

            TestItem.staff_id  = PrimaryKey;
            TestItem.Name      = "Alex,Eades";
            TestItem.Email     = "*****@*****.**";
            TestItem.Hire_Date = DateTime.Now.Date;
            TestItem.Salary    = 5000.00;
            TestItem.Active    = false;
            AllStaff.ThisStaff = TestItem;
            AllStaff.Update();
            AllStaff.ThisStaff.Find(PrimaryKey);
            Assert.AreEqual(AllStaff.ThisStaff, TestItem);

            AllStaff.Delete();
        }
Exemplo n.º 13
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create the item of test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Active         = true;
            TestItem.StaffNo        = 1;
            TestItem.CountyNo       = 1;
            TestItem.StaffFirstName = "Sally";
            TestItem.StaffLastName  = "Gomery";
            TestItem.AddressLine    = "8 Hillbilly State";
            TestItem.PostCode       = "HG6 8SH";
            TestItem.PhoneNo        = "07563856402";
            //set ThisAddress to the test data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaff.Add();
            //set the primary key of the test data
            TestItem.StaffNo = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            // delete the record
            AllStaff.Delete();
            // now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
Exemplo n.º 14
0
        public void DeleteMethodOK()
        {
            clsStaffCollection AllStaff = new clsStaffCollection();
            clsStaff           TestItem = new clsStaff();
            int PrimaryKey = 0;

            TestItem.FirstName   = "Add-Method-Test";
            TestItem.LastName    = "Testing-Add-Method";
            TestItem.StartDate   = DateTime.Parse("2018-01-01");
            TestItem.PhoneNumber = "07492278399";
            TestItem.HourlyRate  = 8.90M;

            AllStaff.ThisStaff = TestItem;

            PrimaryKey = AllStaff.Add();

            TestItem.StaffNumber = PrimaryKey;

            AllStaff.ThisStaff.Find(PrimaryKey);

            AllStaff.Delete();

            bool Found = AllStaff.ThisStaff.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Exemplo n.º 15
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create the test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set it's propertites
            TestItem.Citizen        = true;
            TestItem.StaffID        = 1;
            TestItem.StaffFirstName = "Lucy";
            TestItem.StaffLastName  = "James";
            TestItem.Gender         = "Female";
            TestItem.DateOfBirth    = DateTime.Now.Date;
            TestItem.NINo           = "AA 12 34 56 C";
            TestItem.PhoneNo        = "07038320312";
            TestItem.Address        = "Grove road";
            TestItem.PostCode       = "MK438SS";
            //set ThisOrder to the test data
            AllStaff.ThisStaff = TestItem;
            PrimaryKey         = AllStaff.Add();
            //set the primary key of the test data
            TestItem.StaffID = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 16
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create an item of test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set it's properties
            TestItem.Active         = true;
            TestItem.StaffID        = 1;
            TestItem.StaffName      = "Hamzah";
            TestItem.StaffAddress   = "1 Leicester Road";
            TestItem.StaffTelNumber = "07871740971";
            TestItem.DateJoined     = DateTime.Now.Date;
            //assign the data to the property
            AllStaff.ThisStaff = TestItem;
            //find the record
            PrimaryKey = AllStaff.Add();
            //set the primary key of the test data
            TestItem.StaffID = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
Exemplo n.º 17
0
        public void DeleteMethodOK()
        {
            // create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            // create the item of test data
            clsStaff TestItem = new clsStaff();
            // var to store the primary key
            Int32 PrimaryKey = 0;

            // set its properties
            TestItem.IsWorking   = true;
            TestItem.FullName    = "Natasha Longboy";
            TestItem.HourlyWage  = 7.5;
            TestItem.PhoneNumber = "07759188504";
            TestItem.DateOfBirth = Convert.ToDateTime("09 / 03 / 1986");
            //set this staff to test data
            AllStaff.ThisStaff = TestItem;
            // add the record
            PrimaryKey = AllStaff.Add();
            // set the primary key of the test data
            TestItem.StaffId = PrimaryKey;
            // find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            // delete the record
            AllStaff.Delete();
            // try to find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            // test to see that the record was not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 18
0
        public void DeleteMethodOK()
        {
            clsStaffCollection AllStaff = new clsStaffCollection();
            clsStaff           TestItem = new clsStaff();
            Int32 PrimaryKey            = 0;

            //setting properties
            TestItem.FirstName    = "Jason";
            TestItem.LastName     = "Pratchet";
            TestItem.EmailAddress = "*****@*****.**";
            TestItem.HomeAddress  = "303 Pratt Ln, LE1 303";
            TestItem.StartDate    = DateTime.Now.Date;
            TestItem.IsWorking    = true;
            //setting ThisStaffMember to the test data
            AllStaff.ThisStaffMember = TestItem;
            //adding the record
            PrimaryKey = AllStaff.Add();
            //setting the primary key of the test data
            TestItem.StaffId = PrimaryKey;
            //finding the record
            AllStaff.ThisStaffMember.Find(PrimaryKey);
            //deleting the record
            AllStaff.Delete();
            //finding the record again
            Boolean Found = AllStaff.ThisStaffMember.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Exemplo n.º 19
0
        public void DeleteMethodOk()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //cretae the item of test data
            clsStaff TestItem = new clsStaff();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //tets it properties
            //set its properties
            // TestItem.StaffId = 8;
            TestItem.StaffFirstName   = "Callum";
            TestItem.StaffLastName    = "Odoi";
            TestItem.StaffEmail       = "*****@*****.**";
            TestItem.StaffTelephone   = 01167593271;
            TestItem.StaffDateOfBirth = DateTime.Now.Date;
            //set thr staff to the test data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaff.Add();
            //set the primary key tpo the dtaa
            TestItem.StaffId = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //nw ind the ecord
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //TEST TO SEEthat the reocrd is found
            Assert.IsFalse(Found);
        }
Exemplo n.º 20
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStaffCollection AllStaff = new clsStaffCollection();
            //create the test data
            clsStaff TestItem = new clsStaff();
            //var to store the  primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Employer          = true;
            TestItem.StaffID           = 1;
            TestItem.StaffName         = "Name";
            TestItem.StaffSalary       = 30000;
            TestItem.StaffEmailAddress = "*****@*****.**";
            TestItem.StaffDOB          = DateTime.Parse("23/03/1999");
            //set ThisStaff to the test data
            AllStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllStaff.Add();
            //set the primary key to test data
            TestItem.StaffID = PrimaryKey;
            //find the record
            AllStaff.ThisStaff.Find(PrimaryKey);
            //delete the record
            AllStaff.Delete();
            //now find the record
            Boolean Found = AllStaff.ThisStaff.Find(PrimaryKey);

            //test to see the record was not found
            Assert.IsFalse(Found);
        }
Exemplo n.º 21
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsStaffCollection StaffList = new clsStaffCollection();

        StaffList.ThisStaff.Find(StaffID);
        StaffList.Delete();
        Response.Redirect("StaffList.aspx");
    }
Exemplo n.º 22
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        clsStaffCollection StaffBook = new clsStaffCollection();

        StaffBook.ThisStaff.Find(StaffId);
        StaffBook.Delete();
        Response.Redirect("StaffList.aspx");
    }
        void DeleteStaff()
        {
            clsStaffCollection StaffCollect = new clsStaffCollection();

            //find the record to delete
            StaffCollect.ThisStaff.Find(StaffNo);
            //delete the record
            StaffCollect.Delete();
        }
Exemplo n.º 24
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsStaffCollection staff = new clsStaffCollection();

        staff.thisStaff.Find(StaffID);
        staff.Delete();
        //redirect to main page
        Response.Redirect("StaffList.aspx");
    }
Exemplo n.º 25
0
    protected void btnConfirmDelete_Click(object sender, EventArgs e)
    {
        clsStaffCollection StaffList = new clsStaffCollection();

        StaffList.ThisStaff.Find(Convert.ToInt32(lstStaffList.SelectedValue));
        StaffList.Delete();
        btnConfirmDelete.Visible = false;
        Response.Redirect("StaffList.aspx");
    }
Exemplo n.º 26
0
    // function to delete the selected record
    void DeleteStaffs()
    {
        // create a new instance of the staff book
        clsStaffCollection StaffBook = new clsStaffCollection();

        // find the record
        StaffBook.ThisStaff.Find(StaffNo);
        // delete the record
        StaffBook.Delete();
    }
Exemplo n.º 27
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        //create a new instance of the staff collection
        clsStaffCollection StaffListing = new clsStaffCollection();

        //find the record to delete
        StaffListing.ThisStaff.Find(StaffID);
        //delete the record
        StaffListing.Delete();
        Response.Redirect("StaffList.aspx");
    }
Exemplo n.º 28
0
    void Delete_Staff()
    {
        //function to delete the selected record
        //create a new instance of the staff
        clsStaffCollection Staff = new clsStaffCollection();

        //find the record to delete
        Staff.ThisStaff.Find(StaffID);
        //delete the record
        Staff.Delete();
    }
Exemplo n.º 29
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        //create a new instance of the staff
        clsStaffCollection Staff = new clsStaffCollection();

        //Find a record to delete
        Staff.ThisStaff.Find(Id);
        //Delete the record from staff
        Staff.Delete();
        //Redirect to the main page
        Response.Redirect("StaffList.aspx");
    }
Exemplo n.º 30
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        //create a new instance of the staff list
        clsStaffCollection StaffList = new clsStaffCollection();

        //find the record to delete
        StaffList.ThisStaff.Find(StaffId);
        //delete the record
        StaffList.Delete();
        //redirect back to the main page
        Response.Redirect("StaffList.aspx");
    }