Esempio n. 1
0
        public CartCL viewCart(CartCL cartCL)
        {
            Cart   query = (from type in dbcontext.Carts where type.MemberId == cartCL.memberId select type).FirstOrDefault();
            CartCL view  = new CartCL()
            {
                id           = query.Id,
                dateAdded    = query.DateAdded,
                memberId     = query.MemberId,
                shippingCost = query.ShippingCost
            };

            return(view);
        }
Esempio n. 2
0
 //Instantiates the DataBase model from edmx file in this Solution.
 public void addtoCart(CartCL cartCL)
 {
     dbcontext.Carts.Add(new Cart
     {
         DateAdded    = cartCL.dateAdded,
         ShippingCost = cartCL.shippingCost,
         Id           = cartCL.id,
         MemberId     = cartCL.memberId,
         DateModified = cartCL.dateModified,
         IsDeleted    = cartCL.isDeleted,
     });
     dbcontext.SaveChanges();
 }
Esempio n. 3
0
        public CartCL getCartbyId(int cartId)
        {
            Cart   cartQuery = (from y in dbcontext.Carts where y.Id == cartId select y).FirstOrDefault();
            CartCL cartCL    = new CartCL()
            {
                dateAdded    = cartQuery.DateAdded,
                dateModified = cartQuery.DateModified,
                id           = cartQuery.Id,
                isDeleted    = cartQuery.IsDeleted,
                memberId     = cartQuery.MemberId,
                shippingCost = cartQuery.ShippingCost
            };

            return(cartCL);
        }