Example #1
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        clsReports AReport = new clsReports();

        //variable to store the primary key
        Int32 EmployeeId;

        //variable to store result of the find operation
        Boolean Found = false;

        //get primary key enterd by the user
        EmployeeId = Convert.ToInt32(txtEmployeeId.Text);

        //find the record
        Found = AReport.Find(EmployeeId);

        //if found
        if (Found == true)
        {
            //Display the values of the properties in form
            txtEmployeeId.Text   = AReport.EmployeeId.ToString();
            txtEmployeeName.Text = AReport.EmployeeName;
            txtExpenses.Text     = AReport.Expenses.ToString();
            txtTotal.Text        = AReport.Total.ToString();
        }
    }
Example #2
0
        public void FindMethodOK()
        {
            clsReports AReport    = new clsReports();
            Boolean    Found      = false;
            Int32      EmployeeId = 2;

            Found = AReport.Find(EmployeeId);
            Assert.IsTrue(Found);
        }
Example #3
0
        public void TestTotalFound()
        {
            clsReports AReport    = new clsReports();
            Boolean    Found      = false;
            Boolean    OK         = true;
            Int32      EmployeeId = 2;

            Found = AReport.Find(EmployeeId);
            //check the employee id
            if (AReport.Total != 1000)
            {
                OK = false;
            }
            //test to see if that result is correct
            Assert.IsTrue(OK);
        }
Example #4
0
        public void TestDateAddedFound()
        {
            clsReports AReport    = new clsReports();
            Boolean    Found      = false;
            Boolean    OK         = true;
            Int32      EmployeeId = 2;

            Found = AReport.Find(EmployeeId);
            //check the employee id
            if (AReport.DateAdded != Convert.ToDateTime("16/04/2021"))
            {
                OK = false;
            }
            //test to see if that result is correct
            Assert.IsTrue(OK);
        }