public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();
            //create th item of the data
            clsSupplier TestItem = new clsSupplier();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Active            = true;
            TestItem.Supplier_Address  = "Some Supplier Address ";
            TestItem.CountyNo          = 1;
            TestItem.Supplier_Email    = "*****@*****.**";
            TestItem.Supplier_Id       = 001;
            TestItem.Supplier_Name     = "Game.net";
            TestItem.Supplier_Phone_No = "07331415589";
            //set ThisSupplier to the test data
            AllSuppliers.ThisSupplier = TestItem;
            //add record
            PrimaryKey = AllSuppliers.Add();
            //set the primary key of the test data
            TestItem.Supplier_Id = PrimaryKey;
            //find the record
            AllSuppliers.ThisSupplier.Find(PrimaryKey);
            //delete record
            AllSuppliers.Delete();
            //now find the record
            Boolean Found = AllSuppliers.ThisSupplier.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();
            clsSupplier           TestItem     = new clsSupplier();
            Int32 PrimaryKey = 0;

            TestItem.Address           = "1b";
            TestItem.City              = "Birmingham";
            TestItem.County            = "eastmidlands";
            TestItem.DateAdded         = System.DateTime.Now.Date;
            TestItem.Mobile            = "078";
            TestItem.Name              = "Mark";
            TestItem.Postcode          = "CV6";
            TestItem.PositionInCompany = "1bbbbbbbbbbbbbbbbbbbbbb25";
            TestItem.SupplierName      = "Audi";
            TestItem.Title             = "Mr";
            TestItem.WorkExt           = "312";
            TestItem.WorkNumber        = "12134";
            TestItem.SupplierEmail     = "*****@*****.**";
            AllSuppliers.ThisSupplier  = TestItem;
            PrimaryKey          = AllSuppliers.Add();
            TestItem.SupplierID = PrimaryKey;
            AllSuppliers.ThisSupplier.Find(PrimaryKey);
            AllSuppliers.Delete();
            Boolean Found = AllSuppliers.ThisSupplier.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Example #3
0
    void DeleteSupplier()
    {
        clsSupplierCollection SupplierBook = new clsSupplierCollection();

        SupplierBook.ThisSupplier.Find(SupplierID);
        SupplierBook.Delete();
    }
    void DeleteSupplier()
    {
        //function to delete the selected record
        clsSupplierCollection SupplierBook = new clsSupplierCollection();

        //find the record to delete
        SupplierBook.ThisSupplier.Find(Supplier_Id);
        //delete the record
        SupplierBook.Delete();
    }
Example #5
0
    protected void BtnYes_Click(object sender, EventArgs e)
    {
        clsSupplierCollection supplier = new clsSupplierCollection();

        supplier.thisSupplier.Equals(SupplierId);

        supplier.Delete();

        Response.Redirect("SupplierList.aspx");
    }
    void Delete()
    {
        SupplierID = Convert.ToInt32(Session["SupplierID"]);
        clsSupplierCollection SupplierBook = new clsSupplierCollection();

        SupplierBook.ThisSupplier.Find(SupplierID);
        txtAddress.Text           = SupplierBook.ThisSupplier.Address;
        txtCity.Text              = SupplierBook.ThisSupplier.City;
        txtCounty.Text            = SupplierBook.ThisSupplier.County;
        txtDateAdded.Text         = SupplierBook.ThisSupplier.DateAdded.ToString();
        txtMobile.Text            = SupplierBook.ThisSupplier.Mobile;
        txtName.Text              = SupplierBook.ThisSupplier.Name;
        txtPostcode.Text          = SupplierBook.ThisSupplier.Postcode;
        txtPositionInCompany.Text = SupplierBook.ThisSupplier.PositionInCompany;
        txtSupplierName.Text      = SupplierBook.ThisSupplier.SupplierName;
        txtTitle.Text             = SupplierBook.ThisSupplier.Title;
        txtWorkExt.Text           = SupplierBook.ThisSupplier.WorkExt;
        txtWorkNumber.Text        = SupplierBook.ThisSupplier.WorkNumber;

        SupplierBook.Delete();
    }
Example #7
0
        public void DeleteMethodOK()
        {
            clsSupplierCollection AllSupplier = new clsSupplierCollection();
            clsSupplier           TestItem    = new clsSupplier();
            Int32 PrimaryKey = 0;

            //data to delete
            TestItem.CompanyName     = "teesLTD";
            TestItem.Product         = "tShirts";
            TestItem.PhoneNumber     = "07456332127";
            TestItem.EmailAddress    = "*****@*****.**";
            TestItem.Address         = "101 Second Avenue";
            TestItem.PostCode        = "LE1 1ST";
            AllSupplier.ThisSupplier = TestItem;
            PrimaryKey          = AllSupplier.Add();
            TestItem.SupplierID = PrimaryKey;
            AllSupplier.ThisSupplier.Find(PrimaryKey);
            AllSupplier.Delete();
            Boolean Found = AllSupplier.ThisSupplier.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }