Пример #1
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create instance of the class
        clsOrder AnOrder = new clsOrder();
        //variable to store the primary key
        Int32 OrderNo;
        //variable to store the result
        Boolean Found = false;

        //get the primary key entered by the user
        OrderNo = Convert.ToInt32(txtOrderNo.Text);
        //find the record
        Found = AnOrder.Find(OrderNo);
        //if found
        if (Found == true)
        {
            //display the values in the form
            lblCustomerID1.Text = AnOrder.CustomerID.ToString();
            lblTown1.Text       = AnOrder.DeliveryTown;
            lblDate1.Text       = AnOrder.DateAdded.ToString();
            lblStatus1.Text     = AnOrder.OrderStatus.ToString();
            lblOrderValue1.Text = AnOrder.OrderValue.ToString();
            lblEmail1.Text      = AnOrder.EmailAddress;
        }
        else
        {
            lblError.Text = "Order number not found";
        }
    }
Пример #2
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create an instance of the address class
        clsOrder AnOrder = new clsOrder();
        //variable to store the primary key
        Int32 OrderId;
        //variable to store the result to find operation
        Boolean Found = false;

        //get the primary key entered by the user
        OrderId = Convert.ToInt32(txtOrderID.Text);
        //find the record
        Found = AnOrder.Find(OrderId);
        //if found
        if (Found == true)
        {
            //display the values of the properties in the form
            txtCustomerID.Text   = AnOrder.CustomerId.ToString();
            txtDateReceived.Text = AnOrder.DateReceived.ToString();
            txtOrderPrice.Text   = AnOrder.OrderPrice.ToString();
            txtDescription.Text  = AnOrder.Description;
            txtQuantity.Text     = AnOrder.Quantity.ToString();
            lblError.Text        = "";
        }

        if (Found == false)
        {
            lblError.Text = "Order ID not found";
        }
    }
Пример #3
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create an instance of the address class
        clsOrder anOrder = new clsOrder();
        //variable to store the primary key
        Int32 OrderNo;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by the user
        OrderNo = Convert.ToInt32(txtOrderNo.Text);
        //find the record
        Found = anOrder.Find(OrderNo);
        //if found
        if (Found == true)
        {
            txtEmail.Text       = anOrder.OrderEmail;
            txtFirstName.Text   = anOrder.OrderFirstName;
            txtLastName.Text    = anOrder.OrderLastName;
            txtAddress.Text     = anOrder.OrderAddress;
            txtCity.Text        = anOrder.OrderCity;
            txtPostcode.Text    = anOrder.OrderPostcode;
            txtPhoneNumber.Text = anOrder.OrderPhoneNumber;
            txtDateAdded.Text   = anOrder.OrderDateAdded.ToString();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //create an instance of the order class
        clsOrder AnOrder = new clsOrder();

        Int32 OrderNumber;

        Boolean Found = false;

        OrderNumber = Convert.ToInt32(txtOrderNo.Text);

        Found = AnOrder.Find(OrderNumber);

        if (Found == true)
        {
            txtCustomerName.Text = AnOrder.CustomerName;
            txtEmail.Text        = AnOrder.Email;
            txtTrackingNo.Text   = AnOrder.TrackingNumber;
            txtOrderNo.Text      = AnOrder.OrderNumber.ToString();
            txtQuantity.Text     = AnOrder.Quantity.ToString();
            txtShippingDate.Text = AnOrder.ShippingDate.ToString();
            txtTotalPrice.Text   = AnOrder.TotalPrice.ToString();
            txtTrackingNo.Text   = AnOrder.TrackingNumber;
        }
    }
Пример #5
0
 public void FindMethodOk()
 {
     clsOrder AOrder = new clsOrder();
     Boolean Found = false;
     Int32 OrderNo = 5;
     Found = AOrder.Find(OrderNo);
     Assert.IsTrue(Found);
 }
Пример #6
0
        public void FindMethodOK()
        {
            clsOrder anOrder     = new clsOrder();
            Boolean  Found       = false;
            Int32    OrderNumber = 1;

            Found = anOrder.Find(OrderNumber);
            Assert.IsTrue(Found);
        }
Пример #7
0
        public void FindMethodOk()
        {
            clsOrder new_order = new clsOrder();
            Boolean  Found     = false;
            Int32    orderID   = 1;

            Found = new_order.Find(orderID);
            Assert.IsTrue(Found);
        }
Пример #8
0
        public void TestPayedFound()
        {
            clsOrder anOrder     = new clsOrder();
            Boolean  Found       = false;
            Int32    OrderNumber = 3;

            Found = anOrder.Find(OrderNumber);
            Assert.IsTrue(anOrder.Payed);
        }
Пример #9
0
        public void FindMethodOK()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            Assert.IsTrue(Found);
        }
        public void FindMethodOK()
        {
            clsOrder AnOrder = new clsOrder();
            Boolean  found   = false;
            Int32    OrderId = 2;

            found = AnOrder.Find(OrderId);
            Assert.IsTrue(found);
        }
Пример #11
0
        public void FindOrderOK()
        {
            clsOrder anOrder = new clsOrder();
            Boolean  Found   = false;
            Int32    OrderNo = 2;

            Found = anOrder.Find(OrderNo);
            Assert.IsTrue(Found);
        }
Пример #12
0
        public void FindMethodOK()
        {
            clsOrder AnOrder  = new clsOrder();
            Boolean  Found    = false;
            int      OrderNum = 2;

            Found = AnOrder.Find(OrderNum);
            Assert.IsTrue(Found);
        }
Пример #13
0
 public void TestTotalCostFound()
 {
     clsOrder AnOrder = new clsOrder();
     Boolean Found = false;
     Boolean OK = true;
     Int32 OrderNo = 1;
     Found = AnOrder.Find(OrderNo);
     if (AnOrder.TotalCost != "5.50")
     {
         OK = false;
     }
     Assert.IsTrue(OK);
 }
Пример #14
0
        public void FindMethodOK()
        {
            //Create instance of the class to create
            clsOrder AnOrder = new clsOrder();
            //create some test data
            Boolean Found = false;
            //create some test data to use with the method
            Int32 OrderNo = 1;

            Found = AnOrder.Find(OrderNo);
            //test to see result is correct
            Assert.IsTrue(Found);
        }
Пример #15
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsOrder AnOrder = new clsOrder();

            Boolean Found = false;

            Int32 OrderNo = 32;

            Found = AnOrder.Find(OrderNo);
            //test to see if the result is true
            Assert.IsTrue(Found);
        }
Пример #16
0
 public void TestOrderNoFound()
 {
     clsOrder AnOrder = new clsOrder();
     Boolean Found = false;
     Boolean OK = true;
     Int32 OrderNo = 1;
     Found = AnOrder.Find(OrderNo);
     if (AnOrder.OrderNo != "1")
     {
         OK = false;
     }
     Assert.IsTrue(OK);
 }
Пример #17
0
 public void AvailableSeatsFound()
 {
     clsOrder AnOrder = new clsOrder();
     Boolean Found = false;
     Boolean OK = true;
     Int32 OrderNo = 1;
     Found = AnOrder.Find(OrderNo);
     if (AnOrder.AvailableSeats != true)
     {
         OK = false;
     }
     Assert.IsTrue(OK);
 }
Пример #18
0
        public void TestAvailabilityFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.Availability != true)
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
Пример #19
0
        public void ItemAvailabilityFind()
        {
            clsOrder AOrder = new clsOrder();
            Boolean Found = false;
            Boolean OK = true;
            Int32 OrderNo = 5;
            Found = AOrder.Find(OrderNo);
            if (AOrder.ItemAvailability != true)
            {
                OK = false;

            }
            Assert.IsTrue(OK);
        }
Пример #20
0
        public void FindMethodOK()
        {
            //create an instance of the class I want to create
            clsOrder AnOrder = new clsOrder();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //Create some test data to use with the method
            Int32 OrderID = 1;

            //Invoke the method
            Found = AnOrder.Find(OrderID);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
Пример #21
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsOrder AnOrder = new clsOrder();

            // boolean Variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            int Order_ID = 1;

            // invoke the method
            Found = AnOrder.Find(Order_ID);
            Assert.IsTrue(Found);
        }
Пример #22
0
        public void DeliveryAddressFind()
        {
            clsOrder AOrder = new clsOrder();
            Boolean Found = false;
            Boolean OK = true;
            Int32 OrderNo = 5;
            Found = AOrder.Find(OrderNo);
            if (AOrder.DeliveryAddress != "FK17 8AJ")
            {
                OK = false;

            }
            Assert.IsTrue(OK);
        }
Пример #23
0
            public void FindMethodOK()
            {
                //create an instance of the class we want to create
                clsOrder AnOrder = new clsOrder();
                //Boolean variable to store the results of the validatio
                Boolean Found = false;
                //create some test data to use with the method
                Int32 OrderNo = 1;

                //invoke the method
                Found = AnOrder.Find(OrderNo);
                //test to see if the result is true
                Assert.IsTrue(Found);
            }
Пример #24
0
        public void TestProductDescriptionFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.ProductDescription != "Three long sleeve shirts")
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
Пример #25
0
        public void TestItemPriceFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.ItemPrice != 43)
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
Пример #26
0
        public void TestItemColourFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.ItemColour != "red")
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
Пример #27
0
        public void TestCustomerAddressFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.CustomerAddress != "39 Random Street LE1 2MA")
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
Пример #28
0
        public void TestOrderDateFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.OrderDate != Convert.ToDateTime("20/04/2021"))
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
Пример #29
0
        public void TestCustomerNoFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.CustomerNo != 876)
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
Пример #30
0
        public void TestOrderIdFound()
        {
            clsOrder AOrder  = new clsOrder();
            Boolean  Found   = false;
            Boolean  Ok      = true;
            int      OrderID = 1;

            Found = AOrder.Find(OrderID);
            if (AOrder.OrderID != 1)
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }