public void SetSessionValue(string key, string value)
 {
     WcfSession myCartSession = new WcfSession();
     myCartSession.SetSessionVariable(key, value);
 }
    public void AddOrderDetails(OrderDetailsCollection OrderData)
    {
        SQLHandler sqlH = new SQLHandler();
        SqlTransaction tran;
        tran = (SqlTransaction)sqlH.GetTransaction();
        WcfSession sn = new WcfSession();
        try
        {
            ASPXOrderDetails objOrderDetails = new ASPXOrderDetails();

            int billingAddressID = 0;
            int shippingAddressId = 0;
            int orderID = 0;
            if (OrderData.objOrderDetails.IsMultipleCheckOut == false)
            {
                if (OrderData.objBillingAddressInfo.IsBillingAsShipping == true)
                {
                    if (int.Parse(OrderData.objBillingAddressInfo.AddressID) == 0 &&
                        int.Parse(OrderData.objShippingAddressInfo.AddressID) == 0)
                    {
                        int addressID = objOrderDetails.AddAddress(OrderData, tran);
                        billingAddressID = objOrderDetails.AddBillingAddress(OrderData, tran, addressID);
                        shippingAddressId = objOrderDetails.AddShippingAddress(OrderData, tran, addressID);
                    }
                }
                else
                {
                    if (int.Parse(OrderData.objBillingAddressInfo.AddressID) == 0)
                        billingAddressID = objOrderDetails.AddBillingAddress(OrderData, tran);
                    if (int.Parse(OrderData.objShippingAddressInfo.AddressID) == 0)
                        shippingAddressId = objOrderDetails.AddShippingAddress(OrderData, tran);
                }
            }
            int paymentMethodID = objOrderDetails.AddPaymentInfo(OrderData, tran);

            if (billingAddressID > 0)
            {
                orderID = objOrderDetails.AddOrder(OrderData, tran, billingAddressID, paymentMethodID);

                sn.SetSessionVariable("OrderID", orderID);

            }
            else
            {
                orderID = objOrderDetails.AddOrderWithMultipleCheckOut(OrderData, tran, paymentMethodID);

                sn.SetSessionVariable("OrderID", orderID);
            }

            if (shippingAddressId > 0)
                objOrderDetails.AddOrderItems(OrderData, tran, orderID, shippingAddressId);
            else
                objOrderDetails.AddOrderItemsList(OrderData, tran, orderID);

            tran.Commit();
        }
        catch (SqlException sqlEX)
        {

            throw new ArgumentException(sqlEX.Message);
        }
        catch (Exception ex)
        {
            tran.Rollback();
            throw ex;
        }
    }