コード例 #1
0
 protected void btnOK_Click(object sender, EventArgs e)
 {
     this.trLink.Style.Add("display", "");
     this.trMoney.Style.Add("display", "");
     if (this.rblMoney.SelectedValue == "0")
     {
         this.divOther.Style.Add("display", "");
     }
     int num = 0;
     if (this.rblMoney.SelectedValue == "0")
     {
         num = _Convert.StrToInt(base.Request.Form["tbMoney"], -1);
     }
     else
     {
         num = _Convert.StrToInt(this.rblMoney.SelectedValue, -1);
     }
     if (num < 1)
     {
         JavaScript.Alert(this.Page, "红包金额只能为整数金额!");
     }
     else
     {
         this.lbShowInfo.Text = "此链接包含" + num.ToString() + "元红包!";
         Tables.T_UserHongbaoPromotion promotion = new Tables.T_UserHongbaoPromotion
         {
             UserID = { Value = base._User.ID },
             Money = { Value = num },
             ExpiryDate = { Value = DateTime.Now.AddDays((double)_Convert.StrToInt(this.ddlDate.SelectedValue, 7)) }
         };
         long num2 = promotion.Insert();
         SynchronizeSessionID nid = new SynchronizeSessionID(this.Page);
         string str = base._User.ID.ToString();
         string str2 = nid.GenSign(new string[] { num2.ToString(), str });
         string str3 = Utility.GetUrl() + "/Home/Room/PromoteUserReg.aspx?id=" + num2.ToString() + "&userID=" + str + "&Sign=" + str2;
         promotion.URL.Value = str3;
         promotion.Update("ID=" + num2.ToString());
         this.tbUrl.Text = str3;
         Shove._Web.Cache.ClearCache("Home_Room_MyPromotion_HongBaoRecord" + base._User.ID.ToString());
         this.lbShowCreateResult.Text = "生成红包链接成功!";
     }
 }
コード例 #2
0
ファイル: MemberPromotion.aspx.cs プロジェクト: ichari/ichari
    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;
    }
コード例 #3
0
ファイル: HongBaoRecord.aspx.cs プロジェクト: ichari/ichari
    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();
        }
    }