Exemplo n.º 1
0
        public Login1 GetPassword(string pwd)
        {
            BusinessLib bll  = new BusinessLib();
            var         pswd = bll.GetPassword(pwd);

            return(pswd);
        }
Exemplo n.º 2
0
        public List <CartItems> GetFromCart()
        {
            BusinessLib bll  = new BusinessLib();
            var         lstC = bll.GetFromCart();

            return(lstC);
        }
Exemplo n.º 3
0
        public Login1 GetUserName(string name)
        {
            BusinessLib bll      = new BusinessLib();
            var         username = bll.GetUserName(name);

            return(username);
        }
Exemplo n.º 4
0
        public Products GetProductsById(int id)
        {
            BusinessLib bll = new BusinessLib();
            var         p1  = bll.GetProductsById(id);

            return(p1);
        }
Exemplo n.º 5
0
        public List <ProCategory> GetAllCategoriesById()
        {
            BusinessLib bll = new BusinessLib();
            var         c   = bll.GetAllCategories();

            return(c);
        }
Exemplo n.º 6
0
        public List <Products> GetProductsByCname(string name)
        {
            BusinessLib bll  = new BusinessLib();
            var         lstB = bll.GetProductsByCategoryname(name);

            return(lstB);
        }
Exemplo n.º 7
0
        public List <Products> GetProductsByName(string pname)
        {
            BusinessLib bll = new BusinessLib();
            var         P   = bll.GetProductsByName(pname);

            return(P);
        }
Exemplo n.º 8
0
        public HttpResponseMessage post([FromBody] List <CartItems> lst)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "Product added to cart");

            try
            {
                BusinessLib bll = new BusinessLib();
                bll.PostToCart(lst);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message);
            }
            return(errRes);
        }
Exemplo n.º 9
0
        public HttpResponseMessage Put([FromBody] CartItems cart, int id)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "record updated");

            try
            {
                BusinessLib bll = new BusinessLib();
                bll.UpdateCartById(cart);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message);
            }
            return(errRes);
        }
Exemplo n.º 10
0
        public HttpResponseMessage DeleteFromCart(int id)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "Product deleted from cart");

            try
            {
                BusinessLib bll = new BusinessLib();
                bll.DeleteFromCart(id);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message);
            }
            return(errRes);
        }