Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();
                DataTable dt = dal.GetList().Tables[0];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ddlGameCategory.Items.Add(new ListItem(dt.Rows[i]["gameTitle"].ToString().Trim(), dt.Rows[i]["gameCategoryId"].ToString().Trim()));
                }
            }
        }
Пример #2
0
        //初始化编辑页面
        public void InitialNotifyEdit(int gameCategoryId)
        {
            DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();
            DataTable dt = dal.Get(gameCategoryId).Tables[0];

            if (dt.Rows.Count > 0)
            {
                ltlTitle.Text = dt.Rows[0]["gameTitle"].ToString().Trim();

                this.ltlContent.Text = dt.Rows[0]["gameContent"].ToString().Trim();
                ltlDeadLineTime.Text = dt.Rows[0]["endTime"].ToString().Trim();

                if (dt.Rows[0]["attachmentIds"].ToString().Trim().Length > 0)
                {
                    DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                    ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(dt.Rows[0]["attachmentIds"].ToString().Trim(), ref iframeCount, true, string.Empty);
                }
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DalOperationAboutGameCategory dalGC = new DalOperationAboutGameCategory();
                DataTable dtGC = dalGC.GetList().Tables[0];

                for (int i = 0; i < dtGC.Rows.Count; i++)
                {
                    ddlGameCategory.Items.Add(new ListItem(dtGC.Rows[i]["gameTitle"].ToString().Trim(), dtGC.Rows[i]["gameCategoryId"].ToString().Trim()));
                }

                DalOperationAboutGameType dal = new DalOperationAboutGameType();
                DataTable dt = dal.Get(gameTypeId).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    txtGameTypeTitle.Text = dt.Rows[0]["gameTypeTitle"].ToString().Trim();

                    string _allowSexType = dt.Rows[0]["allowSexType"].ToString().Trim();

                    txtGroupCapability.Text = dt.Rows[0]["groupCapability"].ToString().Trim();
                    hidGroupCapability.Value = dt.Rows[0]["groupCapability"].ToString().Trim();

                    for (int i = 0; i < ddlGameCategory.Items.Count; i++)
                    {
                        if (ddlGameCategory.Items[i].Value == dt.Rows[0]["gameCategoryId"].ToString().Trim())
                        {
                            ddlGameCategory.SelectedIndex = i;
                            break;
                        }
                    }

                    foreach (ListItem rbt in rblTeacher.Items)
                    {
                        if (rbt.Value == _allowSexType)
                        {
                            rbt.Selected = true;
                        }
                    }
                }
            }
        }
Пример #4
0
        public void DataBindGameCategoryAndType(DropDownList ddlGameCategory, DropDownList ddlGameType)
        {
            UserCookiesInfo user = BllOperationAboutUser.GetUserCookiesInfo();

            DalOperationAboutGameCategory dalGameCategory = new DalOperationAboutGameCategory();

            DataTable dtGameCategory =  dalGameCategory.GetList().Tables[0];

            for (int i = 0; i < dtGameCategory.Rows.Count; i++)
            {
                ddlGameCategory.Items.Add(new ListItem(dtGameCategory.Rows[i]["gameTitle"].ToString().Trim(), dtGameCategory.Rows[i]["gameCategoryId"].ToString().Trim()));
            }

            DalOperationAboutGameType dalGameType = new DalOperationAboutGameType();

            DataTable dtGameType = dalGameType.GetGameTypeByGameCategoryId(int.Parse(ddlGameCategory.SelectedValue)).Tables[0];

            for (int i = 0; i < dtGameType.Rows.Count; i++)
            {
                ddlGameType.Items.Add(new ListItem(dtGameType.Rows[i]["gameTypeTitle"].ToString().Trim(), dtGameType.Rows[i]["gameTypeId"].ToString().Trim()));
            }
        }
Пример #5
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            DateTime _startTime = Convert.ToDateTime(startTime.Value.Trim());
            DateTime _endTime = Convert.ToDateTime(endTime.Value.Trim());
            if (_startTime > _endTime)
            {
                Javascript.GoHistory(-1, "开始时间不能晚于截止时间,请修改:)", Page);
                return;
            }

            try
            {
                DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();
                dal.Add(new GameCategory { attachmentIds = hidAttachmentId.Value, startTime = Convert.ToDateTime(_startTime), endTime = Convert.ToDateTime(_endTime), gameTitle = txtGameTitle.Text.Trim(), gameContent = txttGameContent.Text.Trim(), updateTime = DateTime.Now });

                Javascript.RefreshParentWindow("添加活动届次成功:)", "/Administrator/DrawManage.aspx?fragment=1&page=" + pageIndex, Page);
            }
            catch (Exception ex)
            {
                MongoDBLog.LogRecord(ex);
                Javascript.GoHistory(-1, "添加活动届次失败:(", Page);
                return;
            }
        }
Пример #6
0
        //初始化编辑页面
        public void InitialNotifyEdit(int englishExamNotifyInfoId)
        {
            DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();
            DataTable dt = dal.Get(gameCategoryId).Tables[0];

            if (dt.Rows.Count > 0)
            {
                txtGameTitle.Text = dt.Rows[0]["gameTitle"].ToString().Trim();

                txttGameContent.Text = dt.Rows[0]["gameContent"].ToString().Trim();

                startTime.Value = Convert.ToDateTime(dt.Rows[0]["startTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                endTime.Value = Convert.ToDateTime(dt.Rows[0]["endTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");

                string _attachmentIds = dt.Rows[0]["attachmentIds"].ToString().Trim();

                hidAttachmentId.Value = _attachmentIds;
                if (_attachmentIds.Length > 0)
                {
                    DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                    ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(_attachmentIds, ref iframeCount, true, string.Empty);
                }
            }
        }
Пример #7
0
        //绑定信息
        public void DataListBindGameCategory()
        {
            DalOperationAboutGameCategory doan = new DalOperationAboutGameCategory();
            DataTable dt = doan.GetList().Tables[0];

            this.AspNetPager1.RecordCount = dt.Rows.Count;
            AspNetPager1.PageSize = CommonUtility.pageSize;

            PagedDataSource pds = new PagedDataSource();    //定义一个PagedDataSource类来执行分页功
            pds.DataSource = dt.DefaultView;
            pds.AllowPaging = true;

            pds.CurrentPageIndex = pageIndex - 1;
            pds.PageSize = AspNetPager1.PageSize;

            this.dlGameCategory.DataSource = pds;
            this.dlGameCategory.DataBind();

            if (pds.Count == 0)
            {
                this.dlGameCategory.ShowFooter = true;
            }
            else
            {
                this.dlGameCategory.ShowFooter = false;
            }
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["fragment"] != null)
            {
                fragmentFlag = Request["fragment"];
            }

            CommonUtility.ShowLiControl(fragmentFlag, liFragment1, liFragment2, liFragment3, liFragment4, liFragment5, divFragment1, divFragment2, divFragment3, divFragment4, divFragment5);

            if (fragmentFlag.Equals("1"))
            {
                if (!IsPostBack)
                {
                    DataListBindGameCategory();
                }
            }

            if (fragmentFlag.Equals("2"))
            {
                if (!IsPostBack)
                {
                    DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();
                    DataTable dt = dal.GetList().Tables[0];

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        ddlGameCategoryAboutGameType.Items.Add(new ListItem(dt.Rows[i]["gameTitle"].ToString().Trim(), dt.Rows[i]["gameCategoryId"].ToString().Trim()));
                    }

                    DataListBindGameType();
                }
            }

            if (fragmentFlag.Equals("3"))
            {
                if (!IsPostBack)
                {
                    DataBindGameCategoryAndType(ddlGameCategory, ddlGameType);
                    DataListBindEnrollList();
                }
            }

            if (fragmentFlag.Equals("4"))
            {
                if (!IsPostBack)
                {
                    DataBindGameCategoryAndType(ddlDrawGameCategory, ddlDrawGameType);
                    DataListBindGroupNum();
                }
            }
        }
Пример #9
0
        protected void dlGameCategory_ItemCommand(object source, DataListCommandEventArgs e)
        {
            DalOperationAboutGameCategory doan = new DalOperationAboutGameCategory();

            if (e.CommandName == "delete")
            {
                string gameCategoryId = dlGameCategory.DataKeys[e.Item.ItemIndex].ToString();//取选中行公告编号
                doan.Delete(int.Parse(gameCategoryId));
                Javascript.AlertAndRedirect("删除成功!", "/Administrator/DrawManage.aspx?fragment=1&page=" + pageIndex, Page);
            }
            else if (e.CommandName == "openDraw")
            {
                string gameCategoryId = dlGameCategory.DataKeys[e.Item.ItemIndex].ToString();//取选中行公告编号

                //首先判断是否已经过截止日期,如果已经未过截止日期则禁止修改抽签状态
                DataTable dt = doan.CheckGameCategoryIsOverTimeByGameCategoryId(int.Parse(gameCategoryId),DateTime.Now).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    Javascript.GoHistory(-1, "当前报名未过截止日期,禁止修改抽签状态:(", Page);
                    return;
                }

                doan.UpdateDrawState(new GameCategory { gameCategoryId = int.Parse(gameCategoryId), isOpenDraw = 1 });
                Javascript.AlertAndRedirect("开放抽签成功!", "/Administrator/DrawManage.aspx?fragment=1&page=" + pageIndex, Page);
            }
            else if (e.CommandName == "closeDraw")
            {
                string gameCategoryId = dlGameCategory.DataKeys[e.Item.ItemIndex].ToString();//取选中行公告编号
                //首先判断是否已经过截止日期,如果已经未过截止日期则禁止修改抽签状态
                DataTable dt = doan.CheckGameCategoryIsOverTimeByGameCategoryId(int.Parse(gameCategoryId), DateTime.Now).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    Javascript.GoHistory(-1, "当前报名未过截止日期,禁止修改抽签状态:(", Page);
                    return;
                }
                doan.UpdateDrawState(new GameCategory { gameCategoryId = int.Parse(gameCategoryId), isOpenDraw = 0 });
                Javascript.AlertAndRedirect("关闭抽签成功!", "/Administrator/DrawManage.aspx?fragment=1&page=" + pageIndex, Page);
            }
        }
Пример #10
0
        public void DataBindGameCategoryAndType(DropDownList ddlGameCategory, DropDownList ddlGameType)
        {
            UserCookiesInfo user = BllOperationAboutUser.GetUserCookiesInfo();

            DalOperationAboutGameCategory dalGameCategory = new DalOperationAboutGameCategory();

            DataTable dtGameCategory = (ddlGameCategory.ID == "ddlEnrollGameCategory" ? dalGameCategory.GetGameCategoryIng(DateTime.Now).Tables[0] : dalGameCategory.GetList().Tables[0]);

            for (int i = 0; i < dtGameCategory.Rows.Count; i++)
            {
                ddlGameCategory.Items.Add(new ListItem(dtGameCategory.Rows[i]["gameTitle"].ToString().Trim(), dtGameCategory.Rows[i]["gameCategoryId"].ToString().Trim()));
            }

            //检查是否有活动届次数据

            if (ddlGameCategory.Items.Count == 0)
            {
                Javascript.AlertAndRedirect("当前暂无需要报名的活动届次信息:(", "/Administrator/EnrollManage.aspx?fragment=2", Page);
                return;
            }

            if (CommonUtility.SafeCheckByParams<String>(gameCategoryId, ref _gameCategoryId))
            {
                for (int i = 0; i < ddlGameCategory.Items.Count; i++)
                {
                    if (ddlGameCategory.Items[i].Value == gameCategoryId)
                    {
                        ddlGameCategory.SelectedIndex = i;
                        break;
                    }
                }
            }

            DalOperationAboutGameType dalGameType = new DalOperationAboutGameType();

            DataTable dtGameType = (ddlGameType.ID == "ddlEnrollGameType" || ddlGameType.ID == "ddlGameType" ? dalGameType.GetListByGameCategoryIdAndSex(int.Parse(ddlGameCategory.SelectedValue), user.Sex == "男" ? "1" : "2").Tables[0] : dalGameType.GetGameTypeByGameCategoryId(int.Parse(ddlGameCategory.SelectedValue)).Tables[0]);

            for (int i = 0; i < dtGameType.Rows.Count; i++)
            {
                ddlGameType.Items.Add(new ListItem(dtGameType.Rows[i]["gameTypeTitle"].ToString().Trim(), dtGameType.Rows[i]["gameTypeId"].ToString().Trim()));
            }

            if (CommonUtility.SafeCheckByParams<String>(gameTypeId, ref _gameCategoryId))
            {
                for (int i = 0; i < ddlGameType.Items.Count; i++)
                {
                    if (ddlGameType.Items[i].Value == gameTypeId)
                    {
                        ddlGameType.SelectedIndex = i;
                        break;
                    }
                }
            }

            //检查是否有活动届次和活动类型数据

            if (!(ddlGameCategory.Items.Count > 0 && ddlGameType.Items.Count > 0))
            {
                Javascript.AlertAndRedirect("当前暂无需要报名的活动届次信息:(", "/Administrator/EnrollManage.aspx?fragment=2", Page);
                return;
            }
        }
Пример #11
0
        protected void dlEnroll_ItemCommand(object source, DataListCommandEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                UserCookiesInfo user = BllOperationAboutUser.GetUserCookiesInfo();

                DalOperationAboutGameDrawList dal = new DalOperationAboutGameDrawList();
                if (e.CommandName == "draw")
                {
                    int gameCategoryId = int.Parse(e.CommandArgument.ToString().Split(",".ToCharArray())[0]);
                    int gameTypeId = int.Parse(e.CommandArgument.ToString().Split(",".ToCharArray())[1]);

                    DalOperationAboutGameCategory dalgc = new DalOperationAboutGameCategory();
                    DataTable _dt = dalgc.CheckIsOpenDrawByGameCategoryId(gameCategoryId).Tables[0];
                    //首先判断当前届次和活动类型是否已经开放抽签
                    if (_dt.Rows.Count == 0)
                    {
                        Javascript.GoHistory(-1, "参数错误:(", Page);
                        return;
                    }

                    if (_dt.Rows[0]["isOpenDraw"].ToString().Trim() != "1")
                    {
                        Javascript.GoHistory(-1, "当前活动届次和活动类型暂未开放抽签:(", Page);
                        return;
                    }

                    //其次判断是否已经抽过签
                    if (dal.Exists(user.userNo, gameCategoryId, gameTypeId) > 0)
                    {
                        Javascript.GoHistory(-1, "当前活动届次和活动类型已经抽过签,请勿重复抽签哟:)", Page);
                        return;
                    }
                    //使用事务进行抽签控制
                    using (TransactionScope scope = new TransactionScope())
                    {
                        try
                        {
                            DalOperationAboutGameType dalgt = new DalOperationAboutGameType();
                            //首先获取组容量
                            int _groupCapability = int.Parse(dalgt.GetGroupCapabilityByGameTypeId(gameCategoryId, gameTypeId).Tables[0].Rows[0]["groupCapability"].ToString().Trim());
                            //其次获取总报名人数
                            DalOperationAboutGameEnrollList dalel = new DalOperationAboutGameEnrollList();
                            int _enrollListCount = int.Parse(dalel.GetEnrollListCountByGameCategoryIdAndGameTypeId(gameCategoryId, gameTypeId).Tables[0].Rows[0][0].ToString().Trim());

                            //获取分组数
                            int groupMod = _enrollListCount % _groupCapability;

                            int groupCount = 0;

                            if (groupMod == 0)
                            {
                                groupCount = _enrollListCount / _groupCapability;
                            }
                            else
                            {
                                groupCount = (_enrollListCount / _groupCapability) + 1;
                            }

                            //先判断需要几个字母
                            string characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                            //所需要使用的字母个数
                            string usedCharacters = characters.Substring(0, groupCount);
                            //Response.Write(usedCharacters.Length);

                            List<string> listGroupNumAndIndex = new List<string>();

                            List<string> listNotUsedGroupNumAndIndex = new List<string>();

                            for (int i = 0; i < usedCharacters.Length; i++)
                            {
                                for (int j = 0; j < _groupCapability; j++)
                                {
                                    //最后一组编号需要连续,因此需要进行特殊处理
                                    if (groupMod != 0)
                                    {
                                        //访问到最后一组
                                        if (i == usedCharacters.Length - 1)
                                        {
                                            if (groupMod >= j + 1)
                                            {
                                                //Response.Write(usedCharacters.Substring(i, 1) + (j + 1).ToString() + "ss<br/>");
                                                listGroupNumAndIndex.Add(usedCharacters.Substring(i, 1) + (j + 1).ToString());
                                            }
                                        }
                                        else
                                        {
                                            listGroupNumAndIndex.Add(usedCharacters.Substring(i, 1) + (j + 1).ToString());
                                        }
                                    }
                                    else
                                    {
                                        //Response.Write(usedCharacters.Substring(i, 1) + (j + 1).ToString() + "aa<br/>");
                                        listGroupNumAndIndex.Add(usedCharacters.Substring(i, 1) + (j + 1).ToString());
                                    }
                                }
                            }
                            //Response.Write(listGroupNumAndIndex.Count + "<br/>");

                            //获取已经使用的编号列表
                            DataTable _dtGroupNumAndIndex = dal.GetGroupNumAndIndexByGameCategoryIdAndGameTypeId(gameCategoryId, gameTypeId).Tables[0];

                            List<string> listGroupNumAndIndexCopy = new List<string>();

                            foreach (string _item in listGroupNumAndIndex)
                            {
                                //Response.Write(_item + "<br/>");
                                listGroupNumAndIndexCopy.Add(_item);
                            }

                            foreach (string _item in listGroupNumAndIndex)
                            {
                                for (int j = 0; j < _dtGroupNumAndIndex.Rows.Count; j++)
                                {
                                    if (_dtGroupNumAndIndex.Rows[j]["groupNumAndIndex"].ToString().Trim() == _item)
                                    {
                                        //Response.Write(_item + "<br/>");
                                        //移除已使用的编号
                                        listGroupNumAndIndexCopy.Remove(_item);
                                    }
                                }
                            }

                            //Response.Write(listGroupNumAndIndexCopy.Count + "<br/>");

                            //为使效果更随机,再次对编号数组使用随机方法打乱
                            while (listGroupNumAndIndexCopy.Count > 0)
                            {
                                Random random = new Random();
                                int _index = int.Parse(random.NextDouble().ToString().Substring(2, 4)) % listGroupNumAndIndexCopy.Count;

                                listNotUsedGroupNumAndIndex.Insert(0, listGroupNumAndIndexCopy[_index]);

                                listGroupNumAndIndexCopy.RemoveAt(_index);
                            }

                            //Response.Write(groupMod + "groupMod<br/>");

                            //Response.Write(groupCount + "groupCount<br/>");

                            //Response.Write(listNotUsedGroupNumAndIndex.Count + "listNotUsedGroupNumAndIndex<br/>");

                            Random random1 = new Random();

                            int _index1 = int.Parse(random1.NextDouble().ToString().Substring(2, 4)) % listNotUsedGroupNumAndIndex.Count;
                            //Response.Write(_index1 + "<br/>");
                            //Response.End();

                            //得到随机取到的编号值
                            string _result = string.Empty;

                            _result = listNotUsedGroupNumAndIndex[_index1];

                            if (string.IsNullOrEmpty(_result))
                            {
                                Javascript.GoHistory(-1, "抽签失败:(,请重试", Page);
                                return;
                            }

                            dal.Add(new GameDrawList { gameCategoryId = gameCategoryId, gameTypeId = gameTypeId, groupIndex = int.Parse(_result.Substring(1, 1)), groupNum = _result.Substring(0, 1), updateTime = DateTime.Now, teacherNo = user.userNo });
                            scope.Complete();
                            Javascript.AlertAndRedirect("抽签成功!", "/Administrator/EnrollManage.aspx?fragment=2&page=" + pageIndex + "&gameCategoryId=" + gameCategoryId + "&gameTypeId=" + gameTypeId, Page);
                        }
                        catch (System.Exception ex)
                        {
                            MongoDBLog.LogRecord(ex);
                            Javascript.GoHistory(-1, "抽签失败:(,请重试", Page);
                        }
                    }
                }
            }
        }
Пример #12
0
        protected void btnEnroll_Click(object sender, EventArgs e)
        {
            UserCookiesInfo user = BllOperationAboutUser.GetUserCookiesInfo();
            DalOperationAboutGameEnrollList dal = new DalOperationAboutGameEnrollList();
            DateTime _now = DateTime.Now;

            DalOperationAboutGameCategory dalgc = new DalOperationAboutGameCategory();

            //首先检查报名时间是否已经截止
            if (dalgc.CheckGameCategoryIsOverTimeByGameCategoryId(int.Parse(ddlEnrollGameCategory.SelectedValue), _now).Tables[0].Rows.Count == 0)
            {
                Javascript.GoHistory(-1, "当前所选活动届次报名已经截止:(", Page);
                return;
            }

            if (dal.Exists(user.userNo, int.Parse(ddlEnrollGameCategory.SelectedValue), int.Parse(ddlEnrollGameType.SelectedValue)) > 0)
            {
                Javascript.AlertAndRedirect("当前所选活动届次和活动类型已经报名,点击确定查看报名信息", "/Administrator/EnrollManage.aspx?fragment=2", Page);
                return;
            }

            try
            {
                dal.Add(new GameEnrollList { gameCategoryId = int.Parse(ddlEnrollGameCategory.SelectedValue), gameTypeId = int.Parse(ddlEnrollGameType.SelectedValue), teacherNo = user.userNo, updateTime = _now });
                Javascript.AlertAndRedirect("报名成功:)", "/Administrator/EnrollManage.aspx?fragment=2", Page);
            }
            catch (System.Exception ex)
            {
                MongoDBLog.LogRecord(ex);
                Javascript.GoHistory(-1, "报名失败:)", Page);
            }
        }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DalOperationAboutAdminNotifyType dalOperationAboutAdminNotifyType = new DalOperationAboutAdminNotifyType();
            DataSet _ds = dalOperationAboutAdminNotifyType.FindAllParentAdminNotifyType();

            string strLi = string.Empty;

            for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
            {
                strLi += "<li id=\"liFragment" + _ds.Tables[0].Rows[i]["notifyTypeId"].ToString().Trim() + "\" pid=\"" + _ds.Tables[0].Rows[i]["notifyTypeId"].ToString().Trim() + "\"><a href=\"?pid=" + _ds.Tables[0].Rows[i]["notifyTypeId"].ToString().Trim() + "\"><span>" + _ds.Tables[0].Rows[i]["notifyTypeName"].ToString().Trim() + "</span></a></li>";

                if (i == 0 && notifyTypeParentId == -3)
                {
                    notifyTypeParentId = int.Parse(_ds.Tables[0].Rows[i]["notifyTypeId"].ToString().Trim());
                }
            }

            ltlNotifyTypeParent.Text = strLi;

            if (notifyTypeParentId > 0 || notifyTypeParentId == -3)
            {

                divFragment1.Attributes.Add("pid", notifyTypeParentId.ToString());
                DataListBindNotifyType(notifyTypeParentId);
                divFragment1.Visible = true;
            }

            if (notifyTypeParentId == -1)
            {
                ViewAdminNotify();
            }
            if (notifyTypeParentId == -2)
            {
                if (Request["notifyTypeId"] != null)
                {
                    int typeId = -1;
                    if (CommonUtility.SafeCheckByParams<string>(Request["notifyTypeId"], ref typeId))
                    {
                        DataListBindNotifyByTypeId(typeId);
                    }
                    else
                    {
                        Javascript.GoHistory(-1, Page);
                    }
                }
            }

            UserCookiesInfo UserCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo();

            isAdmin = UserCookiesInfo.userType.ToString();

            if (UserCookiesInfo.userType == 3)
            {
                DalOperationUsers DalOperationUsers = new DalOperationUsers();
                DataSet ds = DalOperationUsers.StudentTips(UserCookiesInfo.userNo);

                int examCount = ds.Tables[0].Rows.Count;

                int experimentsCount = ds.Tables[1].Rows.Count;

                int schoolWorksCount = ds.Tables[2].Rows.Count;

                int schoolworkpaperCount = ds.Tables[3].Rows.Count;

                int feedBackCount = ds.Tables[4].Rows.Count;

                DalOperationPatch dal = new DalOperationPatch();
                DataSet ds1 = dal.GetLatestCourseNotify(UserCookiesInfo.userNo);

                int courseNotifyCount = ds1.Tables[0].Rows.Count;

                tbTip.Visible = true;

                if (feedBackCount == 0)
                {
                    divFeedBack.Visible = false;
                    tdFeedBack.Visible = false;
                }
                else
                {
                    ltlFeedBack.Text = feedBackCount.ToString();
                    dlistFeedBack.DataSource = ds.Tables[4];
                    dlistFeedBack.DataBind();
                }

                if (examCount == 0)
                {
                    divExam.Visible = false;
                    tdExam.Visible = false;
                }
                else
                {
                    ltlExamTip.Text = examCount.ToString();
                    dlstExam.DataSource = ds.Tables[0];
                    dlstExam.DataBind();
                }

                if (experimentsCount == 0)
                {
                    divExperiments.Visible = false;
                    tdExperiments.Visible = false;
                }
                else
                {
                    ltlExperimentsTip.Text = experimentsCount.ToString();
                    dlstExpriment.DataSource = ds.Tables[1];
                    dlstExpriment.DataBind();
                }

                if (schoolWorksCount == 0)
                {
                    divSchoolWorks.Visible = false;
                    tdSchoolWorks.Visible = false;
                }
                else
                {
                    ltlSchoolWorksTip.Text = schoolWorksCount.ToString() + "次在线作业待提交";

                    dlstSchoolwork.DataSource = ds.Tables[2];
                    dlstSchoolwork.DataBind();
                }

                if (schoolworkpaperCount == 0)
                {
                    divSchoolWorksPaper.Visible = false;
                    tdSchoolWorksPaper.Visible = false;
                }
                else
                {
                    ltlschoolworkpaper.Text = "近期有" + schoolworkpaperCount.ToString() + "次书面作业待提交(此为提醒功能,并不表示未提交作业)";

                    dlstSchoolworkpa.DataSource = ds.Tables[3];
                    dlstSchoolworkpa.DataBind();
                }

                if (courseNotifyCount == 0)
                {
                    divNotify.Visible = false;
                    tdNotify.Visible = false;
                }
                else
                {
                    ltlnotify.Text = courseNotifyCount.ToString();
                    DataList1.DataSource = ds1.Tables[0];
                    DataList1.DataBind();
                }
            }
            if (UserCookiesInfo.userType == 0 || UserCookiesInfo.userType == 1 || UserCookiesInfo.userType == 2)
            {
                DalOperationAboutArchivesConfig dalArchivesConfig = new DalOperationAboutArchivesConfig();

                if (dalArchivesConfig.CheckArchivesNotifyTime())
                {
                    tdArchivesNotify.Visible = true;
                    divArchivesNotify.Visible = true;
                }
                else
                {
                    tdArchivesNotify.Visible = false;
                    divArchivesNotify.Visible = false;
                }

                DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();

                if (dal.GetGameCategoryIng(DateTime.Now).Tables[0].Rows.Count>0)
                {
                    tdGameCategory.Visible = true;
                    divGameCategory.Visible = true;
                }
                else
                {
                    tdGameCategory.Visible = false;
                    divGameCategory.Visible = false;
                }

            }
        }
    }