Beispiel #1
0
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        if (Request["oT"] != null && Request["rT"] != null && Request["ty"] != null)
        {
            string oT = Request["oT"].ToString();
            string lT = Request["rT"].ToString();
            string ty = Request["ty"].ToString();

            string proId = Request.QueryString["ID"].ToString();

            string strRes = "";

            if (oT == "0")
            {
                strRes = new AjaxMemShopCart().GetShopCartStr(proId, "1", "0");

                if (strRes != "" && strRes != "添加失败!")
                {
                    if (lT == "1")
                    {
                        //ScriptHelper.SetAlert(Page, "加入购物车成功!", "ShowProductInfo.aspx?oT=" + oT + "&rt=" + lT + "&ty=" + ty + "&ID=" + proId + "&type=" + Request["type"]);
                        // ScriptHelper.SetAlert(Page, GetTran("009080", "加入购物车成功"), "ShoppingCartView.aspx?type=" + Request["type"]);
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();$('#gb').hide();document.getElementById('tiaoz').href = 'ShoppingCartView.aspx?type=" + Request["type"] + "'; alertt('加入购物车成功!');</script>", false);
                    }
                    else if (lT == "2")
                    {
                        //ScriptHelper.SetAlert(Page, "加入购物车成功!", "ShowProductInfo.aspx?oT=" + oT + "&rt=" + lT + "&ty=" + ty + "&ID=" + proId + "&type=" + Request["type"]);
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();$('#gb').hide();document.getElementById('tiaoz').href = 'ShoppingCartView.aspx?type=" + Request["type"] + "'; alertt('加入购物车成功!');</script>", false);
                    }
                    else
                    {
                        //ScriptHelper.SetAlert(Page, "加入购物车成功!", "ShowProductInfo.aspx?oT=" + oT + "&rt=" + lT + "&ty=" + ty + "&ID=" + proId + "&type=" + Request["type"]);
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();$('#gb').hide();document.getElementById('tiaoz').href = 'ShoppingCartView.aspx?type=" + Request["type"] + "'; alertt('加入购物车成功!');</script>", false);
                    }
                }
            }
            else
            {
                strRes = new AjaxMemShopCart().GetShopCartStr(proId, "1", "1");

                if (strRes != "" && strRes != "添加失败!")
                {
                    if (lT == "1")
                    {
                        //ScriptHelper.SetAlert(Page, "加入购物车成功!", "ShowProductInfo.aspx?oT=" + oT + "&rt=" + lT + "&ty=" + ty + "&ID=" + proId + "&type=" + Request["type"]);
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();$('#gb').hide();document.getElementById('tiaoz').href = 'ShoppingCartView.aspx?type=" + Request["type"] + "'; alertt('加入购物车成功!');</script>", false);
                        //msg = "<script>gwc();</script>";
                    }
                    else if (lT == "2")
                    {
                        //ScriptHelper.SetAlert(Page, "加入购物车成功!", "ShowProductInfo.aspx?oT=" + oT + "&rt=" + lT + "&ty=" + ty + "&ID=" + proId + "&type=" + Request["type"]);
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();$('#gb').hide();document.getElementById('tiaoz').href = 'ShoppingCartView.aspx?type=" + Request["type"] + "'; alertt('加入购物车成功!');</script>", false);
                        //msg = "<script>gwc();</script>";;
                    }
                    else
                    {
                        //ScriptHelper.SetAlert(Page, "加入购物车成功!", "ShowProductInfo.aspx?oT=" + oT + "&rt=" + lT + "&ty=" + ty + "&ID=" + proId + "&type=" + Request["type"]);
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();$('#gb').hide();document.getElementById('tiaoz').href = 'ShoppingCartView.aspx?type=" + Request["type"] + "'; alertt('加入购物车成功!');</script>", false);
                        //msg = "<script>gwc();</script>";
                    }
                }
            }
        }
    }
Beispiel #2
0
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        if (Request["oT"] != null && Request["rT"] != null && Request["ty"] != null)
        {
            string oT = Request["oT"].ToString();
            string lT = Request["rT"].ToString();
            string ty = Request["ty"].ToString();

            string proId = Request.QueryString["ID"].ToString();

            string strRes = "";

            if (oT == "0")
            {
                strRes = new AjaxMemShopCart().GetShopCartStr(proId, "1", "0");

                if (strRes != "" && strRes != "添加失败!")
                {
                    if (lT == "1")
                    {
                        ScriptHelper.SetAlert(Page, "加入购物车成功!", "Company/ShoppingCartView.aspx");
                    }
                    else if (lT == "2")
                    {
                        ScriptHelper.SetAlert(Page, "加入购物车成功!", "Store/ShoppingCartView.aspx");
                    }
                    else
                    {
                        ScriptHelper.SetAlert(Page, "加入购物车成功!", "Member/ShoppingCartView.aspx");
                    }
                }

                //if (lT=="1")
                //{

                //}
                //else if (lT=="2")
                //{

                //}
                //else
                //{

                //}
            }
            else
            {
                strRes = new AjaxMemShopCart().GetShopCartStrFx(proId, "1", "1");

                if (strRes != "" && strRes != "添加失败!")
                {
                    if (lT == "1")
                    {
                        ScriptHelper.SetAlert(Page, "加入购物车成功!", "Company/ShoppingCartViewAgain.aspx");
                    }
                    else if (lT == "2")
                    {
                        ScriptHelper.SetAlert(Page, "加入购物车成功!", "Store/ShoppingCartViewAgain.aspx");
                    }
                    else
                    {
                        ScriptHelper.SetAlert(Page, "加入购物车成功!", "Member/ShoppingCartViewAgain.aspx");
                    }
                }
            }
        }
    }