Ejemplo n.º 1
0
    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);
            }
        }
    }
Ejemplo n.º 2
0
    protected void GVGroups_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("A"))
        {
            int sgroup = Convert.ToInt32(e.CommandArgument);

            foreach (DataListItem item in this.DLclass.Items)
            {
                bool Rcheck = ((CheckBox)item.FindControl("SelectStu")).Checked;
                if (Rcheck)
                {
                    Label lb                    = (Label)item.FindControl("LabelSid");
                    int   selectSid             = Int32.Parse(lb.Text);
                    LearnSite.BLL.Students sbll = new LearnSite.BLL.Students();
                    sbll.AddThisGroup(selectSid, sgroup);
                }
            }
            System.Threading.Thread.Sleep(300);
            showStudents();
            showGroups();
        }
    }