Beispiel #1
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create the item of test data
            clsOrder TestItem = new clsOrder();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.OrderID     = 1;
            TestItem.CustomerID  = 1;
            TestItem.PhoneID     = 1;
            TestItem.TariffID    = 1;
            TestItem.OrderMadeBy = "Jhon";
            TestItem.OrderDate   = DateTime.Now.Date;
            TestItem.TotalPrice  = 700;
            //set ThisAddress to the test data
            AllOrders.ThisOrder = TestItem;
            //add the record
            PrimaryKey = AllOrders.Add();
            //set the primary key of the test data
            TestItem.OrderID = PrimaryKey;
            //find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //delete the record
            AllOrders.Delete();
            //find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Beispiel #2
0
        public void DeleteMethodOK()
        {
            //Create an instance of the class we want to create
            clsOrderCollection AllOrders = new clsOrderCollection();
            //Create the item of test data
            clsOrder TestItem = new clsOrder();
            //Var to store the primary key
            Int32 PrimaryKey = 0;

            //Set its properties
            TestItem.Delivery        = true;
            TestItem.DateAdded       = DateTime.Now.Date;
            TestItem.ShippingAddress = "18 Lala St";
            TestItem.Description     = "FILA";
            TestItem.OrderQuantity   = 1;
            //Set ThisOrder to the test data
            AllOrders.ThisOrder = TestItem;
            //Add the record
            PrimaryKey = AllOrders.Add();
            //Set the primary key of the test data
            TestItem.OrderId = PrimaryKey;
            //Find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //Delete the record
            AllOrders.Delete();
            //Now find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //Test to see that the record was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            clsOrderCollection AllOrders = new clsOrderCollection();
            clsOrder           TestItem  = new clsOrder();
            Int32 PrimaryKey             = 0;

            //data to delete
            TestItem.StaffId          = 349;
            TestItem.DeliveryAddress  = "SA70 8SQ";
            TestItem.ItemColour       = "Green";
            TestItem.ItemPrice        = 17;
            TestItem.OrderPlaced      = DateTime.Now.Date;
            TestItem.ItemDescription  = "Single Player";
            TestItem.ItemAvailability = true;
            AllOrders.ThisOrder       = TestItem;
            TestItem.OrderNo          = PrimaryKey;

            PrimaryKey       = AllOrders.Add();
            TestItem.OrderNo = PrimaryKey;
            AllOrders.ThisOrder.Find(PrimaryKey);
            AllOrders.Delete();
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            //create an instance of the class
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create some test data to assign to the property
            clsOrder TestItem = new clsOrder();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            // set its properties
            TestItem.OrderNo      = 1;
            TestItem.FirstChoice  = 3;
            TestItem.SecondChoice = 2;
            TestItem.ThirdChoice  = 1;
            TestItem.FirstPrice   = 1;
            TestItem.SecondPrice  = 3;
            TestItem.ThirdPrice   = 4;
            TestItem.OrderTotal   = 8;
            // set this order to the test data
            AllOrders.ThisOrder = TestItem;
            // add the record
            PrimaryKey = AllOrders.Add();
            // set the primary key of the test data
            TestItem.OrderNo = PrimaryKey;
            // find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            // delete the record
            AllOrders.Delete();
            // now find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            // test to see that the two values are the same
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            //create an instance of the class
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create the item of test data
            clsOrder TestItem = new clsOrder();
            //var to store primary key
            Int32 PrimaryKey = 0;

            //set the properties
            TestItem.Address      = "some address";
            TestItem.CustomerId   = 2;
            TestItem.DateDispatch = DateTime.Now.Date;
            TestItem.ItemName     = "Zack Snyder's cut";
            TestItem.ItemQuantity = 2;
            TestItem.Made         = true;
            TestItem.OrderId      = 5;
            //set ThisOrder to the test data
            AllOrders.ThisOrder = TestItem;
            //Add the record
            PrimaryKey = AllOrders.Add();
            //set the primary key of the test data
            TestItem.OrderId = PrimaryKey;
            //find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //delete the record
            AllOrders.Delete();
            //now find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //test to see if the order was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            clsOrderCollection orders = new clsOrderCollection();

            clsOrder order = new clsOrder
            {
                OrderId    = 1,
                CustomerId = 1,
                Date       = DateTime.Now.Date,
                StaffId    = 1,
                Details    = "Text"
            };

            Int32 primaryKey = 0;

            orders.ThisOrder = order;

            primaryKey = orders.Add();

            order.OrderId = primaryKey;

            orders.ThisOrder.find(primaryKey);

            orders.Delete();

            Assert.IsFalse(orders.ThisOrder.find(primaryKey));
        }
        public void DeleteMethodOK()
        {
            //instance of class
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create item for test data
            clsOrder TestItem = new clsOrder();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set properties
            TestItem.OrderId        = 1;
            TestItem.ShippingMethod = "sameday";
            TestItem.DateOrdered    = DateTime.Now.Date;
            TestItem.Dispatched     = true;
            //set ThisOrder to the test data
            AllOrders.ThisOrder = TestItem;
            //add the record
            PrimaryKey = AllOrders.Add();
            //set the primary key of the test data
            TestItem.OrderId = PrimaryKey;
            //find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //delete the record
            AllOrders.Delete();
            //now find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            //create class instance
            clsOrderCollection AllOrders = new clsOrderCollection();
            // create test data
            clsOrder TestItem = new clsOrder();
            // primary key variable
            Int32 PrimaryKey = 0;

            // set properties
            TestItem.orderID     = 1;
            TestItem.numberPlate = "AB09ZXC";
            TestItem.customerID  = 5;
            TestItem.price       = 5000;
            TestItem.quantity    = 1;
            TestItem.dateOrdered = DateTime.Now.Date;
            //set this order to the test data
            AllOrders.ThisOrder = TestItem;
            // add record
            PrimaryKey = AllOrders.Add();
            // set primary key of test data
            TestItem.orderID = PrimaryKey;
            // find record
            AllOrders.ThisOrder.Find(PrimaryKey);
            // delete record
            AllOrders.Delete();
            // find the record again
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            // test that record was not found
            Assert.IsFalse(Found);
        }
Beispiel #9
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create the test data
            clsOrders TestItem = new clsOrders();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set it's properties
            TestItem.OrderId     = 20;
            TestItem.CustomerId  = 1;
            TestItem.ProductId   = "32g";
            TestItem.OrderDate   = DateTime.Now.Date;
            TestItem.Description = "Another Description";
            TestItem.Price       = 24.99;
            TestItem.Paid        = true;
            TestItem.Status      = "Shipped";
            TestItem.DateShipped = DateTime.Now.Date;
            //set ThisOrder to the test data
            AllOrders.ThisOrder = TestItem;
            //add the record
            PrimaryKey = AllOrders.Add();
            //set the primary key of the test data
            TestItem.OrderId = PrimaryKey;
            //find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //delete the record
            AllOrders.Delete();
            //now find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Beispiel #10
0
        public void DeleteMethodOk()
        {
            //create intance of class to create
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create test data to assign to the property
            clsOrder TestItem = new clsOrder();
            //var to store primary key
            Int32 PrimaryKey = 0;

            //set properties
            TestItem.OrderNo     = 13;
            TestItem.DateOrdered = DateTime.Now.Date;
            TestItem.ProductName = "Logitech M220 Silent Wireless Mouse";
            TestItem.QuantityNo  = 3;
            TestItem.OrderPrice  = 60;
            //set thisorder to test data
            AllOrders.ThisOrder = TestItem;
            //add record
            PrimaryKey = AllOrders.Add();
            //set primary key of the test data
            TestItem.OrderNo = PrimaryKey;
            //find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //delete record
            AllOrders.Delete();
            //find record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //test to see the values are the same
            Assert.IsFalse(Found);
        }
        public void DeleteOrderOK()
        {
            //create an instance of the class we want to have
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create the test item of test data
            clsOrder TestItem = new clsOrder();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.OrderID     = 50;
            TestItem.CustomerID  = 1;
            TestItem.StaffID     = 1;
            TestItem.OrderDate   = DateTime.Now.Date;
            TestItem.OrderStatus = "Cooking";
            //set ThisOrder to the test
            AllOrders.ThisOrder = TestItem;
            //add the record
            PrimaryKey = AllOrders.Add();
            //set the primary key of the test data
            TestItem.OrderID = PrimaryKey;
            //find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //delete the record
            AllOrders.Delete();
            //now find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
    void DeleteOrder()
    {
        clsOrderCollection OrderBook = new clsOrderCollection();

        OrderBook.ThisOrder.Find(OrderID);
        OrderBook.Delete();
    }
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsOrderCollection AllOrder = new clsOrderCollection();
            //create the item of the test data
            clsOrder TestItem = new clsOrder();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Quality  = true;
            TestItem.OrderID  = 3;
            TestItem.ItemName = "BMW";
            TestItem.Date     = "21/03/2008";
            TestItem.ItemType = "Car";
            TestItem.Price    = 44737;
            TestItem.Quantity = 1;
            //set ThisOrder to the test data
            AllOrder.ThisOrder = TestItem;
            //add the record
            PrimaryKey = AllOrder.Add();
            //set the primary key of the test data
            TestItem.OrderID = PrimaryKey;
            //find the record
            AllOrder.ThisOrder.Find(PrimaryKey);
            //delete the record
            AllOrder.Delete();
            //now find the record
            Boolean Found = AllOrder.ThisOrder.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsOrderCollection AllOrders = new clsOrderCollection();
            //string variable to store
            clsOrder TestItem = new clsOrder();

            Int32 PrimaryKey = 0;

            TestItem.OrderNo      = 1;
            TestItem.DeliveryDate = DateTime.Now.Date;
            TestItem.OrderDate    = DateTime.Now.Date;
            TestItem.PartNo       = 1234567;

            AllOrders.ThisOrder = TestItem;

            PrimaryKey = AllOrders.Add();

            TestItem.OrderNo = PrimaryKey;

            AllOrders.ThisOrder.Find(PrimaryKey);

            AllOrders.Delete();

            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Beispiel #15
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsOrderCollection AllOrders = new clsOrderCollection();
            //create the item of test data
            clsOrder TestItem = new clsOrder();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set it's properties
            TestItem.OrderId         = 2;
            TestItem.ShippingAddress = "99 Granby Street, Leicester, UK";
            TestItem.Phonenum        = "1111111111111111"; TestItem.Email = "Junnun Malik";
            TestItem.DateOrdered     = DateTime.Now.Date;
            //set ThisAddress to the test data
            AllOrders.ThisOrder = TestItem;
            //add the record
            PrimaryKey = AllOrders.Add();
            //set the primary key of the test data
            TestItem.OrderId = PrimaryKey;
            //find the record
            AllOrders.ThisOrder.Find(PrimaryKey);
            //delete the record
            AllOrders.Delete();
            //now find the record
            Boolean Found = AllOrders.ThisOrder.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
Beispiel #16
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsOrderCollection AllOrders = new clsOrderCollection();

        AllOrders.ThisOrder.Find(OrderId);
        AllOrders.Delete();
        Response.Redirect("OrdersList.aspx");
    }
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsOrderCollection OrderBook = new clsOrderCollection();

        OrderBook.ThisOrder.Find(OrderID);   //find
        OrderBook.Delete();                  //delete
        Response.Redirect("OrderList.aspx"); //redirect
    }
Beispiel #18
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsOrderCollection OrdersPage = new clsOrderCollection();

        OrdersPage.ThisOrder.Find(OrderNumber);
        OrdersPage.Delete();
        Response.Redirect("OrderList.aspx");
    }
Beispiel #19
0
    protected void Button_Yes_Click(object sender, EventArgs e)
    {
        clsOrderCollection OrderBook = new clsOrderCollection();

        OrderBook.ThisOrder.Find(ONumber);
        OrderBook.Delete();
        Response.Redirect("OrderList.aspx");
    }
    void DeleteOrder()
    {
        //create a new instance of the Order
        clsOrderCollection OrderLog = new clsOrderCollection();

        //find the record to delete
        OrderLog.ThisOrder.Find(OrderID);
        //delete the record
        OrderLog.Delete();
    }
Beispiel #21
0
        public void DeleteMethodOK()
        {
            clsOrderCollection orders = new clsOrderCollection();

            orders.ThisOrder.Find(6);
            orders.Delete();
            Boolean found = orders.ThisOrder.Find(6);

            Assert.IsFalse(found);
        }
Beispiel #22
0
    // function for delete
    void Delete()
    {
        // create an instance of the class
        clsOrderCollection OrderBook = new clsOrderCollection();

        // find the record to delete
        OrderBook.ThisOrder.Find(OrderNo);
        // delete the record
        OrderBook.Delete();
    }
    void DeleteOrder()
    {
        //function to delete selected record
        //create a new instance of the OrderCollection
        clsOrderCollection OrderCollection = new clsOrderCollection();

        //find the record to delete
        OrderCollection.ThisOrder.Find(OrderID);
        //Delete the record
        OrderCollection.Delete();
    }
Beispiel #24
0
        void OrderDelete()
        {
            //function to delete the selected record

            //create a new instance of the address book
            clsOrderCollection OrderBook = new clsOrderCollection();

            //find the record to delete
            OrderBook.ThisOrder.Find(OrderID);
            //delete the record
            OrderBook.Delete();
        }
Beispiel #25
0
        void DeleteOrder()
        {
            //function to delete the selected record

            //create an instance of the Inventory List
            clsOrderCollection AllOrders = new clsOrderCollection();

            //find the record to delete
            AllOrders.ThisOrder.Find(mOrderId);
            //delete the record
            AllOrders.Delete();
        }
Beispiel #26
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        //create a new instance of the Order List
        clsOrderCollection OrderList = new clsOrderCollection();

        //find the record to delete
        OrderList.ThisOrder.Find(OrderId);
        //delete the record
        OrderList.Delete();
        //redirect back to the main page
        Response.Redirect("OrderList.aspx");
    }
Beispiel #27
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        // create new instance of orderList collection
        clsOrderCollection OrderList = new clsOrderCollection();

        // find record to be deleted
        OrderList.ThisOrder.Find(OrderID);
        // delete record
        OrderList.Delete();
        // redirect to main page
        Response.Redirect("OrderList.aspx");
    }
        public void DeleteOK()
        {
            clsOrderCollection ordercol = new clsOrderCollection();

            ordercol.mthisorder = ordercol.list[0];
            int key = ordercol.list[0].Product_Id;

            ordercol.Delete();
            bool test = ordercol.mthisorder.find(key);

            Assert.IsFalse(test);
        }
        void Delete()
        {
            //var to store primary key value
            Int32 OrderNo;
            //create a new in stance of collection class
            clsOrderCollection AllOrders = new clsOrderCollection();

            //find the record to delete
            OrderNo = Convert.ToInt32(lstOrders.SelectedValue);
            AllOrders.ThisOrder.Find(OrderNo);
            //delete the record
            AllOrders.Delete();
        }
        protected void btnYes_Click(object sender, EventArgs e)
        {
            //create an instance of the class clsPhone called MyPhones
            clsOrderCollection MyOrder = new clsOrderCollection();
            //declare a variable to store the PhoneID to delete

            //declare a boolean variable to record success of the delete operation
            Boolean Found;

            //try and find the record to delete
            Found = MyOrder.ThisOrder.Find(OrderNo);
            //if the record is found
            if (Found)
            {
                //invoke the delete method of the object
                MyOrder.Delete();
            }
            Response.Redirect("Default.aspx");
        }