protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hfOrgID.Value          = PrjPub.CurrentLoginUser.StationOrgID.ToString();
                ViewState["mode"]      = Request.QueryString.Get("mode");
                ViewState["startmode"] = Request.QueryString.Get("startmode");
                hfMode.Value           = ViewState["mode"].ToString();

                _isWuhan     = PrjPub.IsWuhan();
                _isWuhanOnly = PrjPub.IsWuhanOnly();

                dateBeginTime.DateValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                dateEndTime.DateValue   = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd HH:mm:ss");

                string ExamCategoryID = Request.QueryString.Get("ExamCategoryIDPath");

                if (ExamCategoryID == "0")
                {
                    ExamCategoryID = "";
                }

                if (!string.IsNullOrEmpty(ExamCategoryID))
                {
                    string[] str1 = ExamCategoryID.Split(new char[] { '/' });

                    int nID = int.Parse(str1[str1.LongLength - 1].ToString());

                    hfCategoryId.Value = nID.ToString();
                    ExamCategoryBLL pcl = new ExamCategoryBLL();

                    RailExam.Model.ExamCategory pc = pcl.GetExamCategory(nID);

                    txtCategoryName.Text = pc.CategoryName;
                }

                OracleAccess db     = new OracleAccess();
                string       strSql = "select * from Random_Exam_Modular_Type order by Level_Num";
                DataSet      ds     = db.RunSqlDataSet(strSql);

                ListItem item = new ListItem();
                item.Text  = "--请选择--";
                item.Value = "0";
                ddlModularType.Items.Add(item);

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    item       = new ListItem();
                    item.Text  = dr["Random_Exam_Modular_Type_Name"].ToString();
                    item.Value = dr["Random_Exam_Modular_Type_ID"].ToString();
                    ddlModularType.Items.Add(item);
                }


                string strExamID = Request.QueryString.Get("id");
                if (!string.IsNullOrEmpty(strExamID))
                {
                    FillPage(int.Parse(strExamID));
                }
                else
                {
                    rbnStyle2.Checked     = true;
                    saveTd.Visible        = true;
                    ddlDate.SelectedValue = "1";
                    dateSaveDate.Visible  = false;

                    SetTrainClassVisible(false);
                }
            }

            if (hfPostID.Value != "")
            {
                txtPost.Text = hfPostName.Value;
            }

            if (hfCategoryId.Value != "")
            {
                ExamCategoryBLL             pcl = new ExamCategoryBLL();
                RailExam.Model.ExamCategory pc  = pcl.GetExamCategory(Convert.ToInt32(hfCategoryId.Value));
                txtCategoryName.Text = pc.CategoryName;
            }

            chkHasTrainClass.Attributes.Add("onclick", "chkHasTrainClassOnchange();");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }
                ViewState["mode"]      = Request.QueryString.Get("mode");
                ViewState["startmode"] = Request.QueryString.Get("startmode");
                hfMode.Value           = ViewState["mode"].ToString();

                dateBeginTime.DateValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                dateEndTime.DateValue   = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd HH:mm:ss");

                string ExamCategoryID = Request.QueryString.Get("ExamCategoryIDPath");

                if (ExamCategoryID == "0")
                {
                    ExamCategoryID = "";
                }

                if (!string.IsNullOrEmpty(ExamCategoryID))
                {
                    string[] str1 = ExamCategoryID.Split(new char[] { '/' });

                    int nID = int.Parse(str1[str1.LongLength - 1].ToString());

                    hfCategoryId.Value = nID.ToString();
                    ExamCategoryBLL pcl = new ExamCategoryBLL();

                    RailExam.Model.ExamCategory pc = pcl.GetExamCategory(nID);

                    txtCategoryName.Text = pc.CategoryName;
                }


                string strExamID = Request.QueryString.Get("id");
                if (!string.IsNullOrEmpty(strExamID))
                {
                    FillPage(int.Parse(strExamID));
                }
                else
                {
                    ViewState["OrgID"] = PrjPub.CurrentLoginUser.StationOrgID.ToString();
                    SetTrainClassVisible(false);
                }

                if (PrjPub.IsServerCenter)
                {
                    hfIsShowTrainClass.Value = ConfigurationManager.AppSettings["IsShowTrainClass"];
                }
                else
                {
                    hfIsShowTrainClass.Value = "1";
                }
            }
            //else
            //{
            //    if(!string.IsNullOrEmpty(hfPostID.Value))
            //    {
            //        PostBLL postBLL = new PostBLL();
            //        string[] str = hfPostID.Value.Split(',');
            //        for(int i=0; i< str.Length; i++)
            //        {
            //            if(i==0)
            //            {
            //                txtPost.Text = postBLL.GetPost(Convert.ToInt32(str[i])).PostName;
            //            }
            //            else
            //            {
            //                txtPost.Text = txtPost.Text + "," + postBLL.GetPost(Convert.ToInt32(str[i])).PostName;
            //            }
            //        }
            //    }
            //}

            if (hfPostID.Value != "")
            {
                txtPost.Text = hfPostName.Value;
            }

            chkHasTrainClass.Attributes.Add("onclick", "chkHasTrainClassOnchange();");
        }