Ejemplo n.º 1
0
        /// <summary>
        /// 加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Useraccount = currentUser.LoginName.ToString();
                Useraccount = Useraccount.Substring(Useraccount.IndexOf('\\') + 1);

                //我的作品gvMyWorks事件
                gvMyWorks.PagerSettings.Mode          = PagerButtons.NumericFirstLast;
                gvMyWorks.PagerSettings.FirstPageText = "1";
                gvMyWorks.DataKeyNames = new string[] { "WorksID" };
                ViewState["SortOrder"] = "Score";
                ViewState["OrderDire"] = "ASC";
                //ddl课程和期次绑定
                BindCourses(DAL.Course.GetCourses().Tables[0]);
                ddlPeriods.Visible = false;
                //BindPeriods(Convert.ToInt64(ddlCourses.SelectedValue));
                if (Useraccount == null)
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "message", "alert('请先登录');window.opener ='';window.open('','_self');window.close()", true);
                    //return;
                }
                else
                {
                    DataTable dtMyWorks = Works.GetMyWorks(Useraccount).Tables[0];
                    ViewState["worksinfo"] = dtMyWorks;
                    BindWorks(dtMyWorks);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 重新选择筛选条件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void clearSets_OnClick(object sender, EventArgs e)
        {
            Useraccount = currentUser.LoginName.ToString();
            Useraccount = Useraccount.Substring(Useraccount.IndexOf('\\') + 1);

            //我的作品gvMyWorks事件
            gvMyWorks.PagerSettings.Mode          = PagerButtons.NumericFirstLast;
            gvMyWorks.PagerSettings.FirstPageText = "1";
            gvMyWorks.DataKeyNames = new string[] { "WorksID" };

            //ddl课程和期次绑定
            BindCourses(DAL.Course.GetCourses().Tables[0]);
            ddlPeriods.Visible = false;
            DataTable dtMyWorks = Works.GetMyWorks(Useraccount).Tables[0];

            ViewState["worksinfo"] = dtMyWorks;
            BindWorks(dtMyWorks);
            showperiod.Visible = false;
            clearSets.Visible  = false;
        }