Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string nick = "";
            if (Request.Cookies["nick"] != null)
            {
                nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick";
            }
            else
            {
                nick = Session["snick"].ToString();
            }
            if (nick == "")
            {
                Response.Redirect("http://fuwu.paipai.com/appstore/ui/my/app/appdetail.xhtml?appId=234454");
            }
            string typ = Request.QueryString["typ"];

            PaiPaiShopService ppsDal = new PaiPaiShopService();
            PaiPaiShopInfo    info   = ppsDal.GetPaiPaiShopInfo(nick);


            if (typ == "1")
            {
                if (info.MessgeCount <= 0 && !info.NotPay)
                {
                    Response.Write("{\"errorType\":\"integral_not_enough\",\"msg\":\"余额不足,请先充值!\",\"success\":false}");
                }
                else
                {
                    if (info.NotPay)
                    {
                        ppsDal.UpdateNotPay(false, info.NotPayPostModel, info.NotPayExpiredMinutes, nick);
                        Response.Write("{\"success\":true}");
                    }
                    else
                    {
                        if (info.MessgeCount > 0)
                        {
                            ppsDal.UpdateNotPay(true, info.NotPayPostModel, info.NotPayExpiredMinutes, nick);
                            Response.Write("{\"success\":true}");
                        }
                    }
                }
            }

            if (typ == "5")
            {
                if (info.MessgeCount <= 0 && !info.PostGoods)
                {
                    Response.Write("{\"errorType\":\"integral_not_enough\",\"msg\":\"余额不足,请先充值!\",\"success\":false}");
                }
                else
                {
                    if (info.PostGoods)
                    {
                        ppsDal.UpdatePostGoods(false, info.PostGoodsPostModel, nick);
                        Response.Write("{\"success\":true}");
                    }
                    else
                    {
                        if (info.MessgeCount > 0)
                        {
                            ppsDal.UpdatePostGoods(true, info.PostGoodsPostModel, nick);
                            Response.Write("{\"success\":true}");
                        }
                    }
                }
            }

            if (typ == "9")
            {
                if (info.MessgeCount <= 0 && !info.NotPing)
                {
                    Response.Write("{\"errorType\":\"integral_not_enough\",\"msg\":\"余额不足,请先充值!\",\"success\":false}");
                }
                else
                {
                    if (info.NotPing)
                    {
                        ppsDal.UpdateNotPing(false, info.NotPingPostModel, info.ExpiredDays, nick);
                        Response.Write("{\"success\":true}");
                    }
                    else
                    {
                        if (info.MessgeCount > 0)
                        {
                            ppsDal.UpdateNotPing(true, info.NotPingPostModel, info.ExpiredDays, nick);

                            Response.Write("{\"success\":true}");
                        }
                    }
                }
            }

            Response.End();
        }
    }
Esempio n. 2
0
    protected void Btn_Save_Click(object sender, EventArgs e)
    {
        PaiPaiShopService ppsDal = new PaiPaiShopService();
        int type = int.Parse(Request.QueryString["type"]);

        if (type == 1)
        {
            panel3.Visible = true;

            int minutes = PaiPaiInfo.NotPayExpiredMinutes;
            try
            {
                minutes = int.Parse(Text1.Value);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请在买家下单后面的输入框输入数字');</script>");
                return;
            }

            if (!template_content1.Value.Contains("{ShopName}"))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请您把{ShopName}添加到模板内容中');</script>");
                return;
            }

            ppsDal.UpdateNotPay(PaiPaiInfo.NotPay, template_content1.Value, minutes, ViewState["nick"].ToString());
        }

        else if (type == 5)
        {
            panel1.Visible = true;
            if (!template_content5.Value.Contains("{ShopName}"))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请您把{ShopName}添加到模板内容中');</script>");
                return;
            }
            if (!template_content5.Value.Contains("{ExpressName}") || !template_content5.Value.Contains("{ExpressNo}"))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请您把{ExpressName}{ExpressNo}添加到模板内容中');</script>");
                return;
            }
            ppsDal.UpdatePostGoods(PaiPaiInfo.PostGoods, template_content5.Value, ViewState["nick"].ToString());
        }

        else if (type == 9)
        {
            panel2.Visible = true;

            int days = PaiPaiInfo.ExpiredDays;
            try
            {
                days = int.Parse(pay_hour.Value);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请在发货后面的输入框输入数字');</script>");
                return;
            }
            if (!template_content9.Value.Contains("{ShopName}"))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请您把{ShopName}添加到模板内容中');</script>");
                return;
            }
            ppsDal.UpdateNotPing(PaiPaiInfo.NotPing, template_content9.Value, days, ViewState["nick"].ToString());
        }

        else
        {
        }

        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('设置成功');</script>");
    }