Beispiel #1
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsEquipmentCollection AddressBook = new clsEquipmentCollection();

        AddressBook.ThisEquipment.Find(EquipmentNo);
        AddressBook.Delete();
        Response.Redirect("EquipmentList.aspx");
    }
Beispiel #2
0
        public void DeleteMethodOK()
        {
            clsEquipmentCollection AllEquipments = new clsEquipmentCollection();
            clsEquipment           TestItem      = new clsEquipment();
            Int32 PrimaryKey = 0;

            TestItem.EquipmentNo          = 1;
            TestItem.EquipmentColour      = "White";
            TestItem.EquipmentDateAdded   = DateTime.Now.Date;
            TestItem.EquipmentDescription = "Weights";
            TestItem.EquipmentPrice       = 525;
            TestItem.EquipmentAvailable   = true;
            AllEquipments.ThisEquipment   = TestItem;
            PrimaryKey           = AllEquipments.Add();
            TestItem.EquipmentNo = PrimaryKey;
            AllEquipments.ThisEquipment.Find(PrimaryKey);
            AllEquipments.Delete();
            Boolean Found = AllEquipments.ThisEquipment.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }