예제 #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);
            }
        }
    }
예제 #2
0
    private void profileSet()
    {
        int Sgrade = Int32.Parse(DDLgrade.SelectedValue.ToString());
        int Sclass = Int32.Parse(DDLclass.SelectedValue.ToString());

        LearnSite.BLL.Room   rbll   = new LearnSite.BLL.Room();
        LearnSite.Model.Room rmodel = new LearnSite.Model.Room();
        rmodel          = rbll.GetModel(Sgrade, Sclass);
        Ckclass.Checked = rmodel.Rclassedit;
        Ckphoto.Checked = rmodel.Rphotoedit;
        Cksex.Checked   = rmodel.Rsexedit;
        Ckname.Checked  = rmodel.Rnameedit;
        Ckreg.Checked   = rmodel.Rreg;
        string gmax = rbll.GetRgroupMax(Sgrade, Sclass).ToString();

        for (int i = 0; i < DDLgroupMax.Items.Count; i++)
        {
            if (DDLgroupMax.Items[i].Value == gmax)
            {
                DDLgroupMax.SelectedValue = rbll.GetRgroupMax(Sgrade, Sclass).ToString();
                break;
            }
        }
    }