public void DeleteMethodOK() { // create an instance for the class we want to create clsOrderlineCollection AllOrderline = new clsOrderlineCollection(); // create the item of the test data clsOrderline TestItem = new clsOrderline(); // var to store the primary key Int32 PrimaryKey = 0; // set it properties TestItem.OrderlineId = 2; TestItem.OrderId = 4; TestItem.Quantity = 1; TestItem.InventoryId = 1; // set thisAdress to the test data AllOrderline.ThisOrderline = TestItem; // add the record PrimaryKey = AllOrderline.Add(); // set the primary key TestI data TestItem.OrderlineId = PrimaryKey; // find the record AllOrderline.ThisOrderline.Find(PrimaryKey); // delete the record AllOrderline.Delete(); //now find the record Boolean Found = AllOrderline.ThisOrderline.Find(PrimaryKey); // test to see that the record was not found Assert.IsFalse(Found); }
public void DeleteMethod() { //create an instance of a class clsOrderlineCollection AllOrderline = new clsOrderlineCollection(); //create the item of test data clsOrderline TestItem = new clsOrderline(); //var to store the primary key Int32 PrimaryKey = 0; //set its properties TestItem.OrderlineID = 1; TestItem.BookingID = 1; TestItem.BookingNo = "CASD4"; TestItem.Quantity = 10; //set ThisOrderline to the test data AllOrderline.ThisOrderline = TestItem; //add the record PrimaryKey = AllOrderline.Add(); //set the primary key of the test data TestItem.OrderlineID = PrimaryKey; //find the record AllOrderline.ThisOrderline.Find(PrimaryKey); //delete the record AllOrderline.Delete(); //now find the record Boolean Found = AllOrderline.ThisOrderline.Find(PrimaryKey); //test to see that the record was not found Assert.IsFalse(Found); }
protected void ButtonYes_Click(object sender, EventArgs e) { clsOrderlineCollection OrderlineBook = new clsOrderlineCollection(); OrderlineBook.ThisOrderline.Find(OLineNumber); OrderlineBook.Delete(); Response.Redirect("OrderlineList.aspx"); }
void DeleteOrderline() { //function to delete the selected record //create a new instance of the orderline book clsOrderlineCollection OrderlineBook = new clsOrderlineCollection(); //find the record to delete OrderlineBook.ThisOrderline.Find(OrderlineID); //delete the record OrderlineBook.Delete(); }
public void DeleteMethodOK() { clsOrderlineCollection AllOrderlines = new clsOrderlineCollection(); clsOrderline TestItem = new clsOrderline(); Int32 PKey = 0; TestItem.OLineNumber = 1; TestItem.ONumber = 1; TestItem.Quantity = 1; TestItem.ShoeID = 1; AllOrderlines.ThisOrderline = TestItem; PKey = AllOrderlines.Add(); TestItem.OLineNumber = PKey; AllOrderlines.ThisOrderline.Find(PKey); AllOrderlines.Delete(); Boolean Found = AllOrderlines.ThisOrderline.Find(PKey); Assert.IsFalse(Found); }