protected void btnSubMit_Click(object sender, EventArgs e)
 {
     string str = this.tbUserName.Text.Trim();
     if (str == "")
     {
         JavaScript.Alert(this.Page, "请输入合买活跃明星!");
     }
     else
     {
         string[] strArray = str.Replace(",", ",").Split(new char[] { ',' });
         str = "";
         foreach (string str2 in strArray)
         {
             Users users = new Users(base._Site.ID)[base._Site.ID, str2.Trim()];
             if (users == null)
             {
                 JavaScript.Alert(this.Page, "对不起,您输入的" + str2 + "不存在!");
                 return;
             }
             string str3 = str;
             str = str3 + users.Name + "|" + users.ID.ToString() + ",";
         }
         if (str.EndsWith(","))
         {
             str = str.Substring(0, str.Length - 1);
         }
         Tables.T_ActiveAllBuyStar star = new Tables.T_ActiveAllBuyStar
         {
             LotterieID = { Value = this.ddlLottery.SelectedValue },
             UserList = { Value = str },
             Order = { Value = _Convert.StrToInt(this.tbOrder.Text, 1) }
         };
         if (star.GetCount("LotterieID=" + this.ddlLottery.SelectedValue) > 0L)
         {
             star.Update("LotterieID=" + this.ddlLottery.SelectedValue);
         }
         else
         {
             star.Insert();
         }
         Shove._Web.Cache.ClearCache("Home_Room_JoinAllBuy_BindActiveMembers");
         JavaScript.Alert(this.Page, "操作成功!");
     }
 }
Exemplo n.º 2
0
    protected void btnSubMit_Click(object sender, EventArgs e)
    {
        string name = tbUserName.Text.Trim();

        if (name == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入合买活跃明星!");

            return;
        }

        name = name.Replace(",", ",");

        string[] n = name.Split(',');

        name = "";
        foreach (string s in n)
        {
            Users u = new Users(_Site.ID)[_Site.ID, s.Trim()];

            if (u == null)
            {
                Shove._Web.JavaScript.Alert(this.Page, "对不起,您输入的"+s+"不存在!");

                return;
            }

            name += u.Name + "|" + u.ID.ToString() + ",";
        }

        if (name.EndsWith(","))
        {
            name = name.Substring(0, name.Length - 1);
        }

        DAL.Tables.T_ActiveAllBuyStar t = new DAL.Tables.T_ActiveAllBuyStar();

        t.LotterieID.Value = ddlLottery.SelectedValue;
        t.UserList.Value = name;
        t.Order.Value = Shove._Convert.StrToInt(tbOrder.Text, 1);

        if (t.GetCount("LotterieID=" + ddlLottery.SelectedValue + "") > 0)
        {
            t.Update("LotterieID=" + ddlLottery.SelectedValue + "");
        }
        else
        {
            t.Insert();
        }

        Shove._Web.Cache.ClearCache("Home_Room_JoinAllBuy_BindActiveMembers");
        Shove._Web.JavaScript.Alert(this.Page, "操作成功!");
    }