void DeleteReviews1() { clsReviewsCollection Reviews = new clsReviewsCollection(); Reviews.ThisReviews.Find(ReviewsId); Reviews.Delete(); }
public void DeleteMethodOK() { //create an instance of the class we want to create clsReviewsCollection AllReviews = new clsReviewsCollection("Fbloggs"); //create an instance of test data clsReviews TestItem = new clsReviews(); //var to store primary key Int32 PK = 0; //set the properties //TestItem.CustomerID = 3; TestItem.Email = "*****@*****.**"; TestItem.Exp = "*****@*****.**"; TestItem.Improveexp = "*****@*****.**"; //set ThisCustomer to validate test data AllReviews.ThisReview = TestItem; //add the record PK = AllReviews.Add(); //set primary key of test data TestItem.ReviewId = PK; //find the record AllReviews.ThisReview.Find(PK); //delete the record AllReviews.Delete(); //now find the record Boolean Found = AllReviews.ThisReview.Find(PK); //test to see that it exists Assert.IsFalse(Found); }
protected void btnYes_Click(object sender, EventArgs e) { clsReviewsCollection Reviews = new clsReviewsCollection(); Reviews.ThisReviews.Find(ReviewsId); Reviews.Delete(); Response.Redirect("ReviewsList.aspx"); /* DeleteReviews1(); * Response.Redirect("Default.aspx");*/ }
void DeleteReviews() { ////function to delete the selected record //create a new instance of the Customer collection clsReviewsCollection ReviewList = new clsReviewsCollection(User.Identity.Name); //find the record to delete ReviewList.ThisReview.Find(ReviewId); //delete the record ReviewList.Delete(); }
public void DeleteMethodOK() { clsReviewsCollection AllReviews = new clsReviewsCollection(); clsReviews TestItem = new clsReviews(); Int32 PrimaryKey = 0; TestItem.ReviewsId = 1; TestItem.ReviewApproved = true; TestItem.ReviewRating = 4; TestItem.ReviewerName = "Dave"; TestItem.ReviewText = "Good Product"; TestItem.ReviewedProduct = "Spurs Shorts"; TestItem.DateAdded = DateTime.Now.Date; AllReviews.ThisReviews = TestItem; PrimaryKey = AllReviews.Add(); TestItem.ReviewsId = PrimaryKey; Boolean Found = AllReviews.ThisReviews.Find(PrimaryKey); AllReviews.Delete(); // Assert.IsFalse(Found); }