Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && !Grid1.IsCallback)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }
                //if(HfChapterId.Value != "")
                //{
                //    BookChapterBLL objBll = new BookChapterBLL();
                //    BookChapter obj = objBll.GetBookChapter(Convert.ToInt32(HfChapterId.Value));
                //    txtChapterName.Text = obj.NamePath;
                //}

                HfChapterId.Value = Request.QueryString.Get("cid");
                HfBookId.Value    = Request.QueryString.Get("bid");

                if (!string.IsNullOrEmpty(HfBookId.Value) && HfBookId.Value != "-1")
                {
                    BookBLL             objbookbill = new BookBLL();
                    RailExam.Model.Book objBook     = objbookbill.GetBook(Convert.ToInt32(HfBookId.Value));

                    if (PrjPub.CurrentLoginUser.SuitRange == 0 && PrjPub.IsServerCenter)
                    {
                        if (PrjPub.CurrentLoginUser.StationOrgID != objBook.publishOrg)
                        {
                            Response.Write("<script>alert('您没有导入当前教材章节试题的权限!');window.close();</script>");
                            return;
                        }
                    }

                    if (HfChapterId.Value != "-1")
                    {
                        BookChapterBLL objBll = new BookChapterBLL();
                        BookChapter    obj    = objBll.GetBookChapter(Convert.ToInt32(HfChapterId.Value));
                        txtChapterName.Text = objBook.bookName + ">>" + obj.NamePath;

                        if (obj.IsCannotSeeAnswer)
                        {
                            ddlMode.Visible = true;
                        }
                        else
                        {
                            ddlMode.Visible       = false;
                            ddlMode.SelectedValue = "0";
                        }
                    }
                    else
                    {
                        txtChapterName.Text   = objBook.bookName;
                        ddlMode.Visible       = false;
                        ddlMode.SelectedValue = "0";
                    }
                    lblTitle.Visible  = true;
                    btnDelAll.Visible = true;
                }
                else
                {
                    lblTitle.Visible  = false;
                    btnDelAll.Visible = false;
                }

                if (!PrjPub.IsWuhanOnly())
                {
                    ddlMode.Visible       = false;
                    ddlMode.SelectedValue = "0";
                }

                ddlMode.Visible       = false;
                ddlMode.SelectedValue = "0";

                if (Session["table"] != null)
                {
                    Session.Remove("table");
                }
            }

            string str = Request.Form.Get("Refresh");

            if (str != null && str == "refresh")
            {
                if (Session["table"] != null)
                {
                    Grid1.DataSource = (DataTable)Session["table"];
                    Grid1.DataBind();
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }
                if (PrjPub.HasEditRight("试题管理") && PrjPub.IsServerCenter)                // && PrjPub.CurrentLoginUser.SuitRange == 1
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }
                if (PrjPub.HasDeleteRight("试题管理") && PrjPub.IsServerCenter)                //&& PrjPub.CurrentLoginUser.SuitRange == 1
                {
                    HfDeleteRight.Value = "True";
                }
                else
                {
                    HfDeleteRight.Value = "False";
                }
                HfOrgId.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString();

                if (PrjPub.IsWuhanOnly() && PrjPub.IsServerCenter)
                {
                    btnAddBookItem.Visible = true;
                }
                else
                {
                    btnAddBookItem.Visible = false;
                }

                hfRailSystemId.Value = PrjPub.GetRailSystemId().ToString();
            }


            if (!IsPostBack && !ddlViewChangeCallBack.IsCallback &&
                !treeNodeSelectedCallBack.IsCallback && !itemsGrid.IsCallback)
            {
                BindKnowledgeTree("");
            }
            if (hfIsSearchCommand.Value == "true")
            {
                itemsGrid.CurrentPageIndex = 0;
                itemsGrid.DataBind();
                hfIsSearchCommand.Value = "false";
            }


            if (hfRefresh.Value != "")
            {
                if (PrjPub.IsWuhan())
                {
                    DownloadWord(hfRefresh.Value);
                }
                else
                {
                    DownloadExcel(hfRefresh.Value);
                }
            }

            string strRefresh = Request.Form.Get("refresh");

            if (!string.IsNullOrEmpty(strRefresh))
            {
                itemsGrid.DataBind();
            }

            if (!string.IsNullOrEmpty(hfPostID.Value))
            {
                PostBLL post = new PostBLL();
                txtPost.Text = post.GetPost(Convert.ToInt32(hfPostID.Value)).PostName;
            }
        }
        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();");
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                if (PrjPub.HasEditRight("角色权限") && PrjPub.IsServerCenter)
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }
                if (PrjPub.HasDeleteRight("角色权限") && PrjPub.IsServerCenter)
                {
                    HfDeleteRight.Value = "True";
                }
                else
                {
                    HfDeleteRight.Value = "False";
                }

                if (PrjPub.HasEditRight("职员管理") && PrjPub.IsServerCenter)
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }
                if (PrjPub.HasDeleteRight("职员管理") && PrjPub.IsServerCenter)
                {
                    HfDeleteRight.Value = "True";
                }
                else
                {
                    HfDeleteRight.Value = "False";
                }

                if (PrjPub.IsWuhan())
                {
                    Grid1.Levels[0].Columns[1].HeadingText = "员工编码";
                    lblTitle.Text = "员工编码";
                }
                else
                {
                    Grid1.Levels[0].Columns[1].HeadingText = "工资编号";
                    lblTitle.Text = "工资编号";
                }

                BindGrid();

                IsWuhan.Value       = PrjPub.IsWuhan().ToString();
                IsWuhanOnly.Value   = PrjPub.IsWuhanOnly().ToString();
                hfAdmin.Value       = PrjPub.CurrentLoginUser.IsAdmin.ToString();
                NowEmployeeID.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString();
            }
            else
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    if (strDeleteID == "1" || strDeleteID == "2")
                    {
                        SessionSet.PageMessage = "该员工为最高权限用户,不能被删除!";
                        BindGrid();
                        return;
                    }
                    DeleteData(int.Parse(strDeleteID));
                    BindGrid();
                }

                string strRefresh = Request.Form.Get("Refresh");
                if (strRefresh == "true")
                {
                    BindGrid();
                }
                string strUpdate = Request.Form.Get("UpdatePsw");
                if (!string.IsNullOrEmpty(strUpdate))
                {
                    SystemUserBLL objBll = new SystemUserBLL();
                    SystemUser    obj    = objBll.GetUserByEmployeeID(Convert.ToInt32(strUpdate));
                    if (obj != null)
                    {
                        obj.Password = "******";
                        if (PrjPub.IsServerCenter)
                        {
                            objBll.UpdateUser(obj);
                        }
                        else
                        {
                            objBll.UpdateUserPsw(obj.UserID, "111111");
                        }
                        SessionSet.PageMessage = "初始化密码成功!";
                    }
                    else
                    {
                        SessionSet.PageMessage = "该员工登录帐户不存在,初始化密码失败!";
                    }
                    BindGrid();
                }
            }
        }