示例#1
0
        public void ReportByProductIdTestDataFound()
        {
            clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection();
            //var to store the outcome
            Boolean OK = true;

            //apply a shipping method that doesn't exist
            FilteredOrderLines.ReportByProductId("yyy yyy");
            //check that the correct number of records are found
            if (FilteredOrderLines.Count == 2)
            {
                //check that the first record is ID 1
                if (FilteredOrderLines.OrderLineList[0].OrderId != 1)
                {
                    OK = false;
                }
                //check that the first record is ID 2
                if (FilteredOrderLines.OrderLineList[1].OrderId != 2)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            //test to see that there are no records
            Assert.IsTrue(OK);
        }
示例#2
0
        public void ReportByProductIdOK()
        {
            clsOrderLineCollection AllOrderLines    = new clsOrderLineCollection();
            clsOrderLineCollection FilterOrderLines = new clsOrderLineCollection();

            FilterOrderLines.ReportByProductId("");
            Assert.AreEqual(AllOrderLines.Count, FilterOrderLines.Count);
        }
示例#3
0
        public void ReportByProductIdFound()
        {
            //create an instance of the filtered data
            clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection();

            //apply a shipping method that doesnt exist
            FilteredOrderLines.ReportByProductId("xxx xxx");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredOrderLines.Count);
        }
示例#4
0
    protected void btnClear_Click(object sender, EventArgs e)
    {
        clsOrderLineCollection OrderLines = new clsOrderLineCollection();

        OrderLines.ReportByProductId("");
        txtFilter.Text              = "";
        lstOrderList.DataSource     = OrderLines.OrderLineList;
        lstOrderList.DataValueField = "OrderId";
        lstOrderList.DataTextField  = "ProductId";
        lstOrderList.DataBind();
    }
示例#5
0
    protected void btnApply_Click(object sender, EventArgs e)
    {
        clsOrderLineCollection OrderLines = new clsOrderLineCollection();

        OrderLines.ReportByProductId(txtFilter.Text);
        lstOrderList.DataSource = OrderLines.OrderLineList;
        //set the name of the primary key
        lstOrderList.DataValueField = "OrderId";
        //set the name of the field to display
        lstOrderList.DataTextField = "ProductId";
        //bind the data to the list
        lstOrderList.DataBind();
    }