Exemple #1
0
    /// <summary>
    /// 购物车结算
    /// </summary>
    private void vipCart()
    {
        string number = Q("m");
        string gdid   = Q("gdid");

        if (!string.IsNullOrEmpty(gdid))
        {
            string[] value = gdid.Split('|');
            foreach (string id in value)
            {
                string[] Info  = DBHelp.frS_string("select [upid],[title],[price],[ImgS],[count] from [e_cart] where [emid]='" + id + "'");
                string[] Text  = { "Number", "upid", "emid", "title", "price", "ImgS", "count" };
                string[] Value = { IdNumber.NumberSec("e_order", "or"), number, id, Info[1], Info[2], Info[3], Info[4] };
                if (AddClass.fromAdd("e_order", Text, Value))
                {
                    if (Delet.DeletintW("e_cart", "[upid]='" + number + "' and [emid] in (" + gdid.Replace("|", ",") + ")") > 0)
                    {
                        Write("Xerror|1|购买成功");
                    }
                    else
                    {
                        Write("Xerror|0|购买失败");
                    }
                }
                else
                {
                    Write("Xerror|0|购买失败");
                }
            }
        }
    }
Exemple #2
0
    /// <summary>
    /// 删除购物车信息
    /// </summary>
    private void deleteCart()
    {
        string number = Q("m");
        string gdid   = Q("gdid");

        if (Delet.DeletintW("e_cart", "[upid]='" + number + "' and [emid] in (" + gdid.Replace("|", ",") + ")") > 0)
        {
            Write("Xerror|1|删除成功");
        }
        else
        {
            Write("Xerror|0|删除失败");
        }
    }