コード例 #1
0
ファイル: StoreBusinessLayer.cs プロジェクト: paras062/Store
        public int DeleteDataBL(StoreInventoryBL oStoreInventoryBL)
        {
            StoreDataAccessLayer oStoreDataAccessLayer = new StoreDataAccessLayer();
            StoreInventoryDL     oStoreInventoryDL     = new StoreInventoryDL();

            oStoreInventoryDL.Id = oStoreInventoryBL.Id;

            int rowCount = oStoreDataAccessLayer.DeleteDataDL(oStoreInventoryDL);

            return(rowCount);
        }
コード例 #2
0
ファイル: StoreBusinessLayer.cs プロジェクト: paras062/Store
        /// <summary>
        /// Method to Insert Data
        /// </summary>
        /// <param name="oStoreInventoryBL"></param>
        /// <returns></returns>

        public int InsertDataDL(StoreInventoryBL oStoreInventoryBL)
        {
            StoreDataAccessLayer oStoreDataAccessLayer = new StoreDataAccessLayer();
            StoreInventoryDL     oStoreInventoryDL     = new StoreInventoryDL();

            oStoreInventoryDL.ContentName     = oStoreInventoryBL.ContentName;
            oStoreInventoryDL.ContentQuantity = oStoreInventoryBL.ContentQuantity;

            int rowCount = oStoreDataAccessLayer.InsertDataDL(oStoreInventoryDL);

            return(rowCount);
        }
コード例 #3
0
        /// <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();
        }
コード例 #4
0
ファイル: First.cs プロジェクト: paras062/Store
        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);
        }
コード例 #5
0
ファイル: First.cs プロジェクト: paras062/Store
        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);
        }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
        /// <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();
            }
        }
コード例 #8
0
ファイル: First.cs プロジェクト: paras062/Store
        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);
        }
コード例 #9
0
ファイル: StoreBusinessLayer.cs プロジェクト: paras062/Store
        /// <summary>
        /// Method to read data from DataAccessLayer
        /// </summary>
        /// <returns></returns>
        public IList <StoreInventoryBL> ReadDataBL()
        {
            //Create list for business model
            IList <StoreInventoryBL> iStoreInventoryBL = new List <StoreInventoryBL>();

            //Create list for data model
            IList <StoreInventoryDL> iStoreInventoryDL = new List <StoreInventoryDL>();

            iStoreInventoryDL = oStoreDataAccess.ReadDataDL();


            foreach (var item in iStoreInventoryDL)
            {
                oStoreInventoryBL                 = new StoreInventoryBL();
                oStoreInventoryBL.Id              = item.Id;
                oStoreInventoryBL.ContentName     = item.ContentName;
                oStoreInventoryBL.ContentQuantity = item.ContentQuantity;

                iStoreInventoryBL.Add(oStoreInventoryBL);
            }

            //returning business data model object to view.
            return(iStoreInventoryBL);
        }