Exemplo n.º 1
0
 protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "apply")
     {
         //Response.Redirect("GoodsDetail.aspx?GoodsID=" + Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex].ToString()));
         //选择的Social值
         //int Soc =  Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex].ToString());
         string Soc = DataList1.DataKeys[e.Item.ItemIndex].ToString();
         Session["AssocSoc"] = Soc;
         //判断是否是社团创建者
         //判断是否已经加入社团 加入不可重复加 member 的值
         if (IsCreate() == true)
         {
             // 此处需要改写
             //需要一个待 同意的
             //改写完成
             user.signOut2(Session["username"].ToString(), Soc.ToString().Trim());
             //加入成功
             Response.Write("<script>alert('申请已发送!');window.history.go(-1)</script>");
         }
         else
         {
             //不可以加入 JS 弹出框
             Response.Write("<script>alert('加入失败,您已有社团归属!');window.history.go(-1)</script>");
         }
     }
 }