Exemple #1
0
    protected void g_ItemCommand(object source, DataGridCommandEventArgs e)
    {
        if (e.CommandName == "Deletes")
        {
            DAL.Tables.T_UserHongbaoPromotion uhp = new DAL.Tables.T_UserHongbaoPromotion();

            uhp.Delete("ID=" + e.Item.Cells[7].Text + "");

            Shove._Web.Cache.ClearCache("Home_Room_MyPromotion_HongBaoRecord" + _User.ID.ToString());
            BindData();
        }
    }
Exemple #2
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        trLink.Style.Add("display", "");
        trMoney.Style.Add("display", "");

        if (rblMoney.SelectedValue == "0")
        {
            divOther.Style.Add("display", "");
        }

        int money = 0;

        if (rblMoney.SelectedValue == "0")
        {
            money = Shove._Convert.StrToInt(Request.Form["tbMoney"], -1);
        }
        else
        {
            money = Shove._Convert.StrToInt(rblMoney.SelectedValue, -1);
        }

        if (money < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "红包金额只能为整数金额!");
            return;
        }

        lbShowInfo.Text = "此链接包含" + money.ToString() + "元红包!";
        DAL.Tables.T_UserHongbaoPromotion uhp = new DAL.Tables.T_UserHongbaoPromotion();
        uhp.UserID.Value     = _User.ID;
        uhp.Money.Value      = money;
        uhp.ExpiryDate.Value = DateTime.Now.AddDays(Shove._Convert.StrToInt(ddlDate.SelectedValue, 7));
        long id = uhp.Insert();
        SynchronizeSessionID s = new SynchronizeSessionID(this.Page);
        string userID          = _User.ID.ToString();
        string sign            = s.GenSign(id.ToString(), userID);
        string url             = Shove._Web.Utility.GetUrl() + "/Home/Room/PromoteUserReg.aspx?id=" + id.ToString() + "&userID=" + userID + "&Sign=" + sign + "";

        uhp.URL.Value = url;
        uhp.Update("ID=" + id.ToString() + "");
        tbUrl.Text = url;
        Shove._Web.Cache.ClearCache("Home_Room_MyPromotion_HongBaoRecord" + _User.ID.ToString());
        lbShowCreateResult.Text = "生成红包链接成功!";
        return;
    }