protected void GVgroup_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("AddGroup")) { string sid = e.CommandArgument.ToString(); LearnSite.BLL.Students bll = new LearnSite.BLL.Students(); int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString()); int mysid = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sid"].ToString()); string snum = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString(); int groupmax = 6; LearnSite.BLL.Room rbll = new LearnSite.BLL.Room(); groupmax = rbll.GetRgroupMax(sgrade, sclass); // LearnSite.Common.XmlHelp.GetGroupMax(); if (bll.GetGroupCount(sgrade, sclass, Int32.Parse(sid)) < groupmax + 1) { bll.AddThisGroup(snum, Int32.Parse(sid));//每小组人数少于小组上限则可参加 System.Threading.Thread.Sleep(500); showGroup(); } else { string ch = "小组人数已满" + groupmax + "位,请参加其他小组!"; LearnSite.Common.WordProcess.Alert(ch, this.Page); } } }