public void UpdateData_Test() { StoreBusinessLayer.StoreBusinessLayer oStoreBusinessLayer = new StoreBusinessLayer.StoreBusinessLayer(); StoreInventoryBL oStoreInventoryBL = new StoreInventoryBL(); //Data Values oStoreInventoryBL.ContentName = "Test123"; oStoreInventoryBL.ContentQuantity = 50; oStoreInventoryBL.Id = 1007; int rowCount = oStoreBusinessLayer.UpdateDataBL(oStoreInventoryBL); Assert.GreaterOrEqual(rowCount, 1); }
/// <summary> /// Update Data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void buttonUpdateData_Click(object sender, EventArgs e) { string contentName = textBoxContentName.Text; int contentQuantity = Convert.ToInt32(textBoxContentQuantity.Text); int contentID = Convert.ToInt32(textBoxContentID.Text); StoreBusinessLayer.StoreBusinessLayer oStoreBusinessLayer = new StoreBusinessLayer.StoreBusinessLayer(); StoreInventoryBL oStoreInventoryBL = new StoreInventoryBL(); oStoreInventoryBL.ContentName = contentName; oStoreInventoryBL.ContentQuantity = contentQuantity; oStoreInventoryBL.Id = contentID; int rowCount = oStoreBusinessLayer.UpdateDataBL(oStoreInventoryBL); if (rowCount >= 1) { ReadData(); } }