/// <summary> /// Read Data From DataBase /// </summary> public void ReadData() { StoreBusinessLayer.StoreBusinessLayer oStoreBusinessLayer = new StoreBusinessLayer.StoreBusinessLayer(); StoreInventoryBL oStoreInventoryBL = new StoreInventoryBL(); IList <StoreInventoryBL> iStoreInventoryBL = new List <StoreInventoryBL>(); iStoreInventoryBL = oStoreBusinessLayer.ReadDataBL(); gridViewStoreInventory.DataSource = iStoreInventoryBL; gridViewStoreInventory.DataBind(); }
public void InsertData_Test() { StoreBusinessLayer.StoreBusinessLayer oStoreBusinessLayer = new StoreBusinessLayer.StoreBusinessLayer(); StoreInventoryBL oStoreInventoryBL = new StoreInventoryBL(); //Data Values oStoreInventoryBL.ContentName = "Test Data"; oStoreInventoryBL.ContentQuantity = 10; int rowCount = oStoreBusinessLayer.InsertDataDL(oStoreInventoryBL); Assert.GreaterOrEqual(rowCount, 1); }
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); }
protected void buttonDeleteData_Click(object sender, EventArgs e) { int contentID = Convert.ToInt32(textBoxContentID.Text); StoreBusinessLayer.StoreBusinessLayer oStoreBusinessLayer = new StoreBusinessLayer.StoreBusinessLayer(); StoreInventoryBL oStoreInventoryBL = new StoreInventoryBL(); oStoreInventoryBL.Id = contentID; int rowCount = oStoreBusinessLayer.DeleteDataBL(oStoreInventoryBL); if (rowCount >= 1) { ReadData(); } }
/// <summary> /// Insert Data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void buttonInsertData_Click(object sender, EventArgs e) { string contentName = textBoxContentName.Text; int contentQuantity = Convert.ToInt32(textBoxContentQuantity.Text); StoreBusinessLayer.StoreBusinessLayer oStoreBusinessLayer = new StoreBusinessLayer.StoreBusinessLayer(); StoreInventoryBL oStoreInventoryBL = new StoreInventoryBL(); oStoreInventoryBL.ContentName = contentName; oStoreInventoryBL.ContentQuantity = contentQuantity; int rowCount = oStoreBusinessLayer.InsertDataDL(oStoreInventoryBL); if (rowCount >= 1) { ReadData(); } }
public void ReadData_Test() { bool flag = false; StoreBusinessLayer.StoreBusinessLayer oStoreBusinessLayer = new StoreBusinessLayer.StoreBusinessLayer(); StoreInventoryBL oStoreInventoryBL = new StoreInventoryBL(); IList <StoreInventoryBL> iStoreInventoryBL = new List <StoreInventoryBL>(); iStoreInventoryBL = oStoreBusinessLayer.ReadDataBL(); if (iStoreInventoryBL.Count != 0 || iStoreInventoryBL != null) { flag = true; } Assert.AreEqual(flag, true); }