public static void GetProductAll(Model_Products parameters)
    {
        IList <Model_Products> ret = ProductController.GetProductAll(parameters);


        AppTools.SendResponse(HttpContext.Current.Response, ret.ObjectToJSON());
    }
Beispiel #2
0
    public static int MakeOrder(int intProductId, Model_Users u)
    {
        int ret = 0;

        try
        {
            Model_Orders o = new Model_Orders
            {
                Status   = true,
                StatusID = 1,
                UserID   = u.UserID
            };

            int orderID = o.InsertOrder(o);

            if (orderID > 0)
            {
                Model_Products Cproduct = new Model_Products();
                Cproduct = Cproduct.getProductByID(intProductId);

                Model_OrderProducts p = new Model_OrderProducts
                {
                    OrderID   = orderID,
                    ProductID = intProductId,
                    Title     = Cproduct.Title,
                    Detail    = Cproduct.Detail,
                    Price     = Cproduct.Price
                };
                p.InsertOrderProduct(p);

                Model_OrderPayment cp = new Model_OrderPayment
                {
                    OrderID       = orderID,
                    Amount        = Cproduct.Price,
                    GateWayID     = (byte)GateWayBank.Kbank,
                    PaymentTypeID = (byte)PaymentType.Transfer
                };
                cp.InsertOrderPayment(cp);
            }



            ret = orderID;
        }
        catch
        {
        }


        return(ret);
    }
Beispiel #3
0
 public static IList <Model_Products> GetProductAll(Model_Products ts)
 {
     return(ts.GetProduct(ts));
 }