예제 #1
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create an instance of the supplier class
        clsSupplier AnSupplier = new clsSupplier();
        //variable to store the primary key
        Int32 Supplier_ID;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by the user
        Supplier_ID = Convert.ToInt32(txtSupplierID.Text);
        //find the record
        Found = AnSupplier.Find(Supplier_ID);
        //if found
        if (Found == true)
        {
            txtSupplierName.Text     = AnSupplier.SupplierName;
            txtSupplierAddress.Text  = AnSupplier.SupplierAddress;
            txtSupplierPostCode.Text = AnSupplier.SupplierPostCode;
            txtDescription.Text      = AnSupplier.Description;
            txtDeliveryDate.Text     = AnSupplier.DeliveryDate.ToString();
            txtStockAvailable.Text   = AnSupplier.StockAvailable.ToString();
            CheckStock.Checked       = AnSupplier.CheckStock;
        }
        else
        {
            return;
        }
    }
예제 #2
0
        public void FindMethodOK()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            int         SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            Assert.IsTrue(Found);
        }
예제 #3
0
        public void FindMethodOK()
        {
            //create an instance of the class we want
            clsSupplier ASupplier = new clsSupplier();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 Supplier_Id = 4;

            //invoke the method
            Found = ASupplier.Find(Supplier_Id);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
예제 #4
0
        public void FindMethodOK()
        {
            //create an instance of the calss we want to create
            clsSupplier Supplier = new clsSupplier();
            //boolean varibale to store the result of the validation
            Boolean Found = false;
            //create some test dat ato tuse with the method
            int SupplierNo = 1;

            //invoke the method
            Found = Supplier.Find(SupplierNo);
            //test to see that the result id correct
            Assert.IsTrue(Found);
        }
예제 #5
0
        public void PostCodeFound()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            Boolean     OK         = true;
            int         SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            if (ASupplier.PostCode != PostCode)
            {
                OK = true;
            }
            Assert.IsTrue(OK);
        }
예제 #6
0
        public void AddressFound()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            Boolean     OK         = true;
            int         SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            if (ASupplier.Address != "101 second street")
            {
                OK = true;
            }
            Assert.IsTrue(OK);
        }
예제 #7
0
        public void EmailAddressFound()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            Boolean     OK         = true;
            int         SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            if (ASupplier.EmailAddress != "*****@*****.**")
            {
                OK = true;
            }
            Assert.IsTrue(OK);
        }
예제 #8
0
        public void PhoneNumberFound()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            Boolean     OK         = true;
            int         SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            if (ASupplier.PhoneNumber != PhoneNumber)
            {
                OK = true;
            }
            Assert.IsTrue(OK);
        }
예제 #9
0
        public void ProductFound()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            Boolean     OK         = true;
            int         SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            if (ASupplier.Product != "T-shirts")
            {
                OK = true;
            }
            Assert.IsTrue(OK);
        }
예제 #10
0
        public void CompanyNameFound()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            Boolean     OK         = true;
            Int32       SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            if (ASupplier.CompanyName != "teesLTD")
            {
                OK = true;
            }
            Assert.IsTrue(OK);
        }
예제 #11
0
        public void SuplierIdFound()
        {
            clsSupplier ASupplier  = new clsSupplier();
            Boolean     Found      = false;
            Boolean     OK         = true;
            int         SupplierID = 1;

            Found = ASupplier.Find(SupplierID);
            if (ASupplier.SupplierID != 1)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #12
0
        public void TestActiveFound()
        {
            //create an instance of the class we want
            clsSupplier ASupplier = new clsSupplier();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 Supplier_Id = 004;

            //invoke the method
            Found = ASupplier.Find(Supplier_Id);
            //check the supplier id //////////
            if (ASupplier.Active != true)
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
예제 #13
0
        public void TestSupplierNameFound()
        {
            //create an instance of the calss we want to create
            clsSupplier Supplier = new clsSupplier();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is OK(assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 SupplierNo = 5;

            //invoke the method
            Found = Supplier.Find(SupplierNo);
            //check the supplier no
            if (Supplier.SupplierName != "eee")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
예제 #14
0
        public void TestDeliveryDateFound()
        {
            //create an instance of the class we want to create
            clsSupplier AnSupplier = new clsSupplier();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data
            Int32 Supplier_ID = 1;

            //invoke the method
            Found = AnSupplier.Find(Supplier_ID);
            //check the supplier date
            if (AnSupplier.DeliveryDate != Convert.ToDateTime("05/05/2020"))
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
예제 #15
0
        public void TestDescriptionFound()
        {
            //create an instance of the class we want to create
            clsSupplier AnSupplier = new clsSupplier();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data
            Int32 Supplier_ID = 1;

            //invoke the method
            Found = AnSupplier.Find(Supplier_ID);
            //check the supplier description
            if (AnSupplier.Description != "We are the best")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }