private void RejectOffer()
    {
        //sends an email to the person making the offer and delete the offer from the database
        //
        //var to store the email address of the person making the offer
        string OfferEMail;
        //var to store the user name of the person making the offer
        string OfferUserName;
        //var to store the title of the offer
        string OfferTitle;
        //declare an instance of my email object
        clsEMail AnEMail = new clsEMail();
        //var to store successful sending of the email
        Boolean Success;

        //get the email address of the person making the offer
        OfferEMail = GetOfferEMail(OfferNo);
        //get the user name of the person making the offer
        OfferUserName = GetOfferUserName(OfferNo);
        //get the title of the item on offer
        OfferTitle = GetOfferTitle(OfferNo);
        //send a rejection email to the person who made the offer
        Success = AnEMail.SendEMail("dvd.mdb", OfferEMail, "Your swap shop offer", ThisSite.SiteOwner + " has declined your offer of " + OfferTitle);
        //find the record for this offer in the database
        clsDataConnection AnOffer = new clsDataConnection("select * from offer where offerno=" + OfferNo);

        //if the record is found
        if (AnOffer.Count == 1)
        {
            //delete it
            AnOffer.RemoveRecord(0);
            //save the changes
            AnOffer.SaveChanges();
        }
    }
    private void RemoveWishListItem(int WishListID)
    {
        //this sub removes a wish list item identified by wish list id (primary key)
        //
        //open a connection to the wish list table
        clsDataConnection WishList = new clsDataConnection("select * from wishlist where wishlistno=" + WishListID);

        //if the record is found
        if (WishList.Count == 1)
        {
            //remove the record
            WishList.RemoveRecord(0);
            //save the changes
            WishList.SaveChanges();
        }
    }
Ejemplo n.º 3
0
    private void DeleteSwap()
    {
        //this sub deletes the swap identified by swapno
        //
        //find the record in the database
        clsDataConnection ASwap = new clsDataConnection("select * from swap where swapno=" + SwapNo);

        //if the record is found
        if (ASwap.Count == 1)
        {
            //remove the record
            ASwap.RemoveRecord(0);
            //save the changes
            ASwap.SaveChanges();
        }
    }