Пример #1
0
        //Search product---Admin//
        public static ECEntities SearchProductBL(string ec)
        {
            ECEntities product = new ECEntities();

            try
            {
                ECDAL ed = new ECDAL();
                product = ed.SearchProductDAL(ec);
            }
            catch (ECExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(product);
        }
Пример #2
0
        //Delete product--Admin//
        public static bool RemoveProductBL(string ec)
        {
            bool removed = false;

            try
            {
                ECDAL ed = new ECDAL();
                removed = ed.RemoveProductDAL(ec);
            }
            catch (ECExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(removed);
        }
Пример #3
0
        //--------Display products in cart---------//
        public static List <ECEntities> DisplayCartBL()
        {
            List <ECEntities> cartList = new List <ECEntities>();

            try
            {
                ECDAL ec = new ECDAL();
                cartList = ec.DisplayCartDAL();
            }
            catch (ECExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(cartList);
        }
Пример #4
0
        //Display products--Admin//
        public static List <ECEntities> DisplayAllProductBL()
        {
            List <ECEntities> productList = new List <ECEntities>();

            try
            {
                ECDAL ec = new ECDAL();
                productList = ec.DisplayAllDAL();
            }
            catch (ECExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(productList);
        }
Пример #5
0
        //Update product---Admin//
        public static bool UpdateProductBL(ECEntities product)
        {
            bool updated = false;

            try
            {
                if (Validate(product))
                {
                    ECDAL ed = new ECDAL();
                    updated = ed.UpdateProductDAL(product);
                }
            }
            catch (ECExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(updated);
        }
Пример #6
0
        //Add product--Admin//
        public static bool AddProductBL(ECEntities ec)
        {
            bool added = false;

            try
            {
                if (Validate(ec))
                {
                    ECDAL ed = new ECDAL();
                    added = ed.AddProductDAL(ec);
                }
            }
            catch (ECExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(added);
        }