Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (PrjPub.IsServerCenter && SessionSet.OrganizationID != 1)
         {
             HfUpdateRight.Value = "False";
             HfDeleteRight.Value = "False";
         }
         else
         {
             HfUpdateRight.Value = PrjPub.HasEditRight("ÊÖ¹¤ÆÀ¾í").ToString();
             HfDeleteRight.Value = PrjPub.HasDeleteRight("ÊÖ¹¤ÆÀ¾í").ToString();
         }
     }
     else
     {
         if (Request.Form.Get("Refresh") == "true")
         {
             this.examsGrid.DataBind();
         }
     }
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TreeViewDataBind();

                string selectedID = Request.QueryString.Get("selectedID");
                if (!String.IsNullOrEmpty(selectedID))
                {
                    foreach (TreeViewNode tvNode in this.tvView.Nodes)
                    {
                        if (tvNode.ID == selectedID)
                        {
                            this.tvView.SelectedNode = tvNode;
                            break;
                        }
                    }
                }

                hfDelete.Value = PrjPub.HasDeleteRight("培训项目").ToString();
                hfUpdate.Value = PrjPub.HasEditRight("培训项目").ToString();
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (PrjPub.CurrentLoginUser == null)
            {
                Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                return;
            }
            if (!IsPostBack)
            {
                HfDeleteRight.Value = PrjPub.HasDeleteRight("操作日志").ToString();
                BindGrid();
            }

            if (IsPostBack)
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    DeleteData(int.Parse(strDeleteID));
                    BindGrid();
                }
            }
        }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BindTree();
         if (PrjPub.HasEditRight("课件体系") && PrjPub.IsServerCenter)
         {
             HfUpdateRight.Value = "True";
         }
         else
         {
             HfUpdateRight.Value = "False";
         }
         if (PrjPub.HasDeleteRight("课件体系") && PrjPub.IsServerCenter)
         {
             HfDeleteRight.Value = "True";
         }
         else
         {
             HfDeleteRight.Value = "False";
         }
     }
 }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                HfUpdateRight.Value = PrjPub.HasEditRight("政策法规").ToString();
                HfDeleteRight.Value = PrjPub.HasDeleteRight("政策法规").ToString();
                BindGrid();
            }
            else
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    DeleteData(int.Parse(strDeleteID));
                    BindGrid();
                }

                if (Request.Form.Get("Refresh") == "true")
                {
                    BindGrid();
                }
            }
        }
Ejemplo n.º 6
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.IsServerCenter && PrjPub.CurrentLoginUser.SuitRange != 1)
                {
                    HfUpdateRight.Value = "False";
                    HfDeleteRight.Value = "False";
                }
                else
                {
                    HfUpdateRight.Value = PrjPub.HasEditRight("组卷策略").ToString();
                    HfDeleteRight.Value = PrjPub.HasDeleteRight("组卷策略").ToString();
                }
                HfPaperCategoryId.Value = Request.QueryString.Get("id");
            }

            if (IsPostBack)
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    DeleteData(int.Parse(strDeleteID));
                    Grid1.DataBind();
                }

                if (Request.Form.Get("Refresh") == "true")
                {
                    Grid1.DataBind();
                }
            }
        }
Ejemplo n.º 7
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";
                }

                BindGrid();
            }

            if (Request.Form.Get("Refresh") != null && Request.Form.Get("Refresh") == "true")
            {
                BindGrid();
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.HasEditRight("成绩查询"))
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }

                if (PrjPub.HasDeleteRight("新增考试") && PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.UseType == 0)
                {
                    hfDeleteRight.Value = "True";
                }
                else
                {
                    hfDeleteRight.Value = "False";
                }

                //如果是访问路局则只要是有成绩查询权限的用户均可以访问成绩查询页面
                if (PrjPub.IsServerCenter)
                {
                    hfIsAdmin.Value = "True";
                }
                //如果是访问路局则非本站段的用户不能访问成绩查询页面
                else
                {
                    hfOrgID.Value = ConfigurationManager.AppSettings["StationID"].ToString();
                    if ((PrjPub.CurrentLoginUser.StationOrgID.ToString() == hfOrgID.Value) || PrjPub.CurrentLoginUser.UseType == 0)
                    {
                        hfIsAdmin.Value = "True";
                    }
                    else
                    {
                        hfIsAdmin.Value = "False";
                    }
                }

                dateStartDateTime.DateValue = DateTime.Today.Year + "-" + DateTime.Today.Month + "-01";
                dateEndDateTime.DateValue   = DateTime.Today.ToString("yyyy-MM-dd");

                if (!string.IsNullOrEmpty(Request.QueryString.Get("begin")))
                {
                    dateStartDateTime.DateValue = Request.QueryString.Get("begin");
                }

                if (!string.IsNullOrEmpty(Request.QueryString.Get("end")))
                {
                    dateEndDateTime.DateValue = Request.QueryString.Get("end");
                }

                hfIsServer.Value = PrjPub.IsServerCenter.ToString();
                //hfHasTwoServer.Value = PrjPub.HasTwoServer().ToString();
                //hfIsMainServer.Value = PrjPub.IsMainServer().ToString();

                if (Request.QueryString.Get("Orgid") != "1" && !string.IsNullOrEmpty(Request.QueryString.Get("Orgid")))
                {
                    BindGrid();
                }
            }

            string strDeleteID = Request.Form.Get("DeleteID");

            if (!string.IsNullOrEmpty(strDeleteID))
            {
                RandomExamBLL             examBLL = new RandomExamBLL();
                RailExam.Model.RandomExam obj     = examBLL.GetExam(Convert.ToInt32(strDeleteID));

                if (obj.HasTrainClass)
                {
                    SessionSet.PageMessage = "不能删除有培训班的考试!";
                    BindGrid();
                    return;
                }

                examBLL.DeleteExam(int.Parse(strDeleteID));
                BindGrid();
            }
        }
Ejemplo n.º 9
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";
                }

                OrganizationBLL orgBll = new OrganizationBLL();
                int             orgID  = orgBll.GetStationOrgID(PrjPub.CurrentLoginUser.OrgID);
                HfOrgId.Value = orgID.ToString();

                BindGrid();
            }
            else
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    DeleteData(int.Parse(strDeleteID));
                    BindGrid();
                }

                if (Request.Form.Get("Refresh") == "true")
                {
                    BindGrid();
                }
            }

            string strUpID = Request.Form.Get("UpID");

            if (strUpID != null && strUpID != "")
            {
                if (Request.QueryString.Get("type") == "Courseware")
                {
                    CoursewareBLL             objBll = new CoursewareBLL();
                    RailExam.Model.Courseware obj    = objBll.GetCourseware(Convert.ToInt32(strUpID));
                    obj.OrderIndex = obj.OrderIndex - 1;
                    objBll.UpdateCourseware(obj);
                }

                if (Request.QueryString.Get("type") == "TrainType")
                {
                    int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id"));
                    CoursewareTrainTypeBLL objTrainTypeBll = new CoursewareTrainTypeBLL();
                    CoursewareTrainType    objTrainType    =
                        objTrainTypeBll.GetCoursewareTrainType(Convert.ToInt32(strUpID), trainTypeID);
                    objTrainType.OrderIndex = objTrainType.OrderIndex - 1;
                    objTrainTypeBll.UpdateCoursewareTrainType(objTrainType);
                }
                BindGrid();
            }

            string strDownID = Request.Form.Get("DownID");

            if (strDownID != null && strDownID != "")
            {
                if (Request.QueryString.Get("type") == "Courseware")
                {
                    CoursewareBLL             objBll = new CoursewareBLL();
                    RailExam.Model.Courseware obj    = objBll.GetCourseware(Convert.ToInt32(strDownID));
                    obj.OrderIndex = obj.OrderIndex + 1;
                    objBll.UpdateCourseware(obj);
                }

                if (Request.QueryString.Get("type") == "TrainType")
                {
                    int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id"));
                    CoursewareTrainTypeBLL objTrainTypeBll = new CoursewareTrainTypeBLL();
                    CoursewareTrainType    objTrainType    =
                        objTrainTypeBll.GetCoursewareTrainType(Convert.ToInt32(strDownID), trainTypeID);
                    objTrainType.OrderIndex = objTrainType.OrderIndex + 1;
                    objTrainTypeBll.UpdateCoursewareTrainType(objTrainType);
                }
                BindGrid();
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (PrjPub.CurrentLoginUser == null)
            {
                Response.Redirect("../Common/Error.aspx?error=Session过期请重新登录本系统!");
                return;
            }

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


                string strQuery = Request.QueryString.Get("strQuery");
                if (!string.IsNullOrEmpty(strQuery))
                {
                    string[] str = strQuery.Split('|');
                    txtName.Text            = str[0];
                    ddlSex.SelectedValue    = str[1];
                    ddlStatus.SelectedValue = str[2];
                    txtPinYin.Text          = str[3];
                    txtTechnicalCode.Text   = str[4];
                    hfPostID.Value          = str[5];
                }

                gridBind();
            }

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

            if (!string.IsNullOrEmpty(strRefresh))
            {
                gridBind();
            }

            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 = "该员工登录帐户不存在,初始化密码失败!";
                }

                gridBind();
            }

            string strDelete = Request.Form.Get("Delete");

            if (!string.IsNullOrEmpty(strDelete))
            {
                try
                {
                    OracleAccess db = new OracleAccess();
                    if (PrjPub.CurrentLoginUser.EmployeeID != 0)
                    {
                        //判断该员工是否参加过考试
                        string strIsArrange =
                            string.Format(
                                "select count(1) from random_exam_arrange where  ','||user_ids||','  like '%,{0},%'",
                                strDelete);
                        if (Convert.ToInt32(db.RunSqlDataSet(strIsArrange).Tables[0].Rows[0][0]) > 0)
                        {
                            ClientScript.RegisterStartupScript(GetType(), "NO", "alert('该员工已参加考试,不能删除!');", true);
                            return;
                        }

                        string strSql = "delete from Employee where Employee_ID=" + strDelete;
                        db.ExecuteNonQuery(strSql);
                    }
                    else
                    {
                        string  strSql = "select * from Employee where Employee_ID=" + strDelete;
                        DataRow dr     = db.RunSqlDataSet(strSql).Tables[0].Rows[0];

                        EmployeeBLL employeebll = new EmployeeBLL();
                        employeebll.DeleteEmployee(Convert.ToInt32(strDelete));

                        SystemLogBLL systemLogBLL = new SystemLogBLL();
                        systemLogBLL.WriteLog("删除员工:" + dr["Employee_Name"] + "(" + dr["Work_No"] + ")基本信息");
                    }
                    gridBind();
                }
                catch
                {
                    SessionSet.PageMessage = "该员工已被引用,不能删除!";
                }
            }

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

                OrganizationBLL orgBll = new OrganizationBLL();
                int             orgID  = orgBll.GetStationOrgID(PrjPub.CurrentLoginUser.OrgID);
                HfOrgId.Value = orgID.ToString();

                hfEmployeeID.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString();


                if (!string.IsNullOrEmpty(Request.QueryString.Get("postID")))
                {
                    hfPostID.Value = Request.QueryString.Get("postID");
                }

                BindGrid();
            }
            else
            {
                if (Request.Form.Get("Refresh") == "true")
                {
                    //ViewState["NowID"] = "false";
                    BindGrid();
                }
            }

            #region
            //string strGet = Request.Form.Get("Index");
            //if (strGet != null && strGet != "")
            //{
            //    GetIndex(strGet);
            //    BindGrid();
            //}

            //string strCover = Request.Form.Get("RefreshCover");
            //if(strCover!= null && strCover !="")
            //{
            //    string strBookUrl = "../Book/" + strCover + "/cover.htm";

            //    BookBLL objBill = new BookBLL();
            //    objBill.UpdateBookUrl(Convert.ToInt32(strCover), strBookUrl);

            //    string strBookName = objBill.GetBook(Convert.ToInt32(strCover)).bookName;

            //    string strPath = "../Online/Book/" + strCover + "/Cover.htm";
            //    string str = File.ReadAllText(Server.MapPath(strPath), System.Text.Encoding.UTF8);
            //    if (str.IndexOf("booktitle") < 0)
            //    {
            //        str = "<link href='book.css' type='text/css' rel='stylesheet' />"
            //             + "<div id='booktitle'>" + strBookName + "</div>" + "<br>"
            //             + str;
            //        File.WriteAllText(Server.MapPath(strPath), str, System.Text.Encoding.UTF8);
            //    }

            //    BookChapterBLL objChapterBll = new BookChapterBLL();
            //    objChapterBll.GetIndex(strCover);

            //    SystemLogBLL objLogBll = new SystemLogBLL();
            //    objLogBll.WriteLog("编辑教材《" + strBookName + "》前言");

            //    BindGrid();
            //}
            #endregion

            string strDeleteID = Request.Form.Get("DeleteID");
            if (strDeleteID != null && strDeleteID != "")
            {
                DelBook(strDeleteID);
                BindGrid();
            }

            string strUpID = Request.Form.Get("UpID");
            if (strUpID != null && strUpID != "")
            {
                if (Request.QueryString.Get("id") != null)
                {
                    BookBLL             objBll = new BookBLL();
                    RailExam.Model.Book obj    = objBll.GetBook(Convert.ToInt32(strUpID));
                    obj.OrderIndex = obj.OrderIndex - 1;
                    objBll.UpdateBook(obj);
                }

                if (Request.QueryString.Get("id1") != null)
                {
                    int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id1"));
                    BookTrainTypeBLL objTrainTypeBll = new BookTrainTypeBLL();
                    BookTrainType    objTrainType    =
                        objTrainTypeBll.GetBookTrainType(Convert.ToInt32(strUpID), trainTypeID);
                    objTrainType.OrderIndex = objTrainType.OrderIndex - 1;
                    objTrainTypeBll.UpdateBookTrainType(objTrainType);
                }
                BindGrid();
            }

            string strDownID = Request.Form.Get("DownID");
            if (strDownID != null && strDownID != "")
            {
                if (Request.QueryString.Get("id") != null)
                {
                    BookBLL             objBll = new BookBLL();
                    RailExam.Model.Book obj    = objBll.GetBook(Convert.ToInt32(strDownID));
                    obj.OrderIndex = obj.OrderIndex + 1;
                    objBll.UpdateBook(obj);
                }

                if (Request.QueryString.Get("id1") != null)
                {
                    int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id1"));
                    BookTrainTypeBLL objTrainTypeBll = new BookTrainTypeBLL();
                    BookTrainType    objTrainType    =
                        objTrainTypeBll.GetBookTrainType(Convert.ToInt32(strDownID), trainTypeID);
                    objTrainType.OrderIndex = objTrainType.OrderIndex + 1;
                    objTrainTypeBll.UpdateBookTrainType(objTrainType);
                }
                BindGrid();
            }

            string strRefreshDown = Request.Form.Get("RefreshDown");
            if (strRefreshDown != null && strRefreshDown != "")
            {
                if (!DownloadBook(strRefreshDown))
                {
                    SessionSet.PageMessage = "当前教材不存在电子版教材!";
                    BindGrid();
                    return;
                }
                BindGrid();
            }


            if (!string.IsNullOrEmpty(hfPostID.Value))
            {
                PostBLL post = new PostBLL();
                txtPost.Text = post.GetPost(Convert.ToInt32(hfPostID.Value)).PostName;
            }
        }
Ejemplo n.º 12
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.RoleID == 123 || PrjPub.CurrentLoginUser.RoleID == 1))//&& PrjPub.CurrentLoginUser.SuitRange == 1
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }
                if (PrjPub.HasDeleteRight("资料管理") && PrjPub.IsServerCenter && (PrjPub.CurrentLoginUser.RoleID == 123 || PrjPub.CurrentLoginUser.RoleID == 1))//&& PrjPub.CurrentLoginUser.SuitRange == 1
                {
                    HfDeleteRight.Value = "True";
                }
                else
                {
                    HfDeleteRight.Value = "False";
                }

                HfOrgId.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString();

                hfEmployeeID.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString();

                BindGrid();
            }
            else
            {
                if (Request.Form.Get("Refresh") == "true")
                {
                    BindGrid();
                }
            }

            string strDeleteID = Request.Form.Get("DeleteID");

            if (strDeleteID != null && strDeleteID != "")
            {
                DelBook(strDeleteID);
                BindGrid();
            }

            string strUpID = Request.Form.Get("UpID");

            if (strUpID != null && strUpID != "")
            {
                OracleAccess db = new OracleAccess();
                if (Request.QueryString.Get("id") != null)
                {
                    string strSql = "select * from Information where System_Order_Index<"
                                    + "(select System_Order_Index from Information where  Information_ID=" + strUpID + ")"
                                    + " and Information_System_ID=" + Request.QueryString.Get("id");
                    //在当前领域下存在比上移资料顺序小的资料
                    if (db.RunSqlDataSet(strSql).Tables[0].Rows.Count > 0)
                    {
                        //将当前领域下位置在前的资料顺序+1
                        strSql =
                            "update Information set System_Order_Index=System_Order_Index+1 where System_Order_Index="
                            + "(select System_Order_Index from Information where  Information_ID=" + strUpID + ")-1 "
                            + " and Information_System_ID=" + Request.QueryString.Get("id");
                        db.ExecuteNonQuery(strSql);

                        //将上移资料顺序-1
                        strSql = "update Information set System_Order_Index=System_Order_Index-1 where Information_ID=" + strUpID;
                        db.ExecuteNonQuery(strSql);
                    }
                }

                if (Request.QueryString.Get("id1") != null)
                {
                    string strSql = "select * from Information where Level_Order_Index<"
                                    + "(select Level_Order_Index from Information where  Information_ID=" + strUpID + ")"
                                    + " and Information_Level_ID=" + Request.QueryString.Get("id1");
                    //在当前等级下存在比上移资料顺序小的资料
                    if (db.RunSqlDataSet(strSql).Tables[0].Rows.Count > 0)
                    {
                        //将当前等级下位置在前的资料顺序+1
                        strSql =
                            "update Information set Level_Order_Index=Level_Order_Index+1 where Level_Order_Index="
                            + "(select Level_Order_Index from Information where  Information_ID=" + strUpID + ")-1 "
                            + " and Information_Level_ID=" + Request.QueryString.Get("id1");
                        db.ExecuteNonQuery(strSql);

                        //将上移资料顺序-1
                        strSql = "update Information set Level_Order_Index=Level_Order_Index-1 where Information_ID=" +
                                 strUpID;
                        db.ExecuteNonQuery(strSql);
                    }
                }
                BindGrid();
            }

            string strDownID = Request.Form.Get("DownID");

            if (strDownID != null && strDownID != "")
            {
                OracleAccess db = new OracleAccess();
                if (Request.QueryString.Get("id") != null)
                {
                    string strSql = "select * from Information where System_Order_Index>"
                                    + "(select System_Order_Index from Information where  Information_ID=" + strDownID + ")"
                                    + " and Information_System_ID=" + Request.QueryString.Get("id");
                    //在当前领域下存在比上移资料顺序大的资料
                    if (db.RunSqlDataSet(strSql).Tables[0].Rows.Count > 0)
                    {
                        //将当前领域下位置在前的资料顺序-1
                        strSql =
                            "update Information set System_Order_Index=System_Order_Index-1 where System_Order_Index="
                            + "(select System_Order_Index from Information where  Information_ID=" + strDownID + ")+1 "
                            + " and Information_System_ID=" + Request.QueryString.Get("id");
                        db.ExecuteNonQuery(strSql);

                        //将上移资料顺序+1
                        strSql =
                            "update Information set System_Order_Index=System_Order_Index+1 where Information_ID=" + strDownID;
                        db.ExecuteNonQuery(strSql);
                    }
                }

                if (Request.QueryString.Get("id1") != null)
                {
                    string strSql = "select * from Information where Level_Order_Index>"
                                    + "(select Level_Order_Index from Information where  Information_ID=" + strDownID + ")"
                                    + " and Information_Level_ID=" + Request.QueryString.Get("id1");
                    //在当前等级下存在比上移资料顺序小的资料
                    if (db.RunSqlDataSet(strSql).Tables[0].Rows.Count > 0)
                    {
                        //将当前等级下位置在前的资料顺序-1
                        strSql =
                            "update Information set Level_Order_Index=Level_Order_Index-1 where Level_Order_Index="
                            + "(select Level_Order_Index from Information where  Information_ID=" + strDownID + ")+1 "
                            + " and Information_Level_ID=" + Request.QueryString.Get("id1");
                        db.ExecuteNonQuery(strSql);

                        //将上移资料顺序+1
                        strSql = "update Information set Level_Order_Index=Level_Order_Index+1 where Information_ID=" + strDownID;
                        db.ExecuteNonQuery(strSql);
                    }
                }
                BindGrid();
            }

            string strRefreshDown = Request.Form.Get("RefreshDown");

            if (strRefreshDown != null && strRefreshDown != "")
            {
                if (!DownloadBook(strRefreshDown))
                {
                    SessionSet.PageMessage = "当前资料不存在电子版资料!";
                    BindGrid();
                    return;
                }
                BindGrid();
            }
        }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //if (PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.SuitRange != 1)
                //{
                //    HfUpdateRight.Value = "False";
                //    HfDeleteRight.Value = "False";
                //}
                //else
                //{
                //    HfUpdateRight.Value = PrjPub.HasEditRight("考试设计").ToString();
                //    HfDeleteRight.Value = PrjPub.HasDeleteRight("考试设计").ToString();
                //}
                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.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                hfOrgID.Value          = PrjPub.CurrentLoginUser.StationOrgID.ToString();
                HfExamCategoryId.Value = Request.QueryString.Get("id");
                Grid1.DataBind();
            }
            else
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    ExamResultBLL reBll = new ExamResultBLL();
                    IList <RailExam.Model.ExamResult> examResults = reBll.GetExamResultByExamID(int.Parse(strDeleteID));

                    if (examResults.Count > 0)
                    {
                        SessionSet.PageMessage = "已有考生参加考试,该考试不能被删除!";
                        Grid1.DataBind();
                        return;
                    }



                    DeleteData(int.Parse(strDeleteID));
                    Grid1.DataBind();
                }

                if (Request.Form.Get("Refresh") == "true")
                {
                    Grid1.DataBind();
                }

                if (Request.Form.Get("OutPut") != null && Request.Form.Get("OutPut") != "")
                {
                    OutputData(Request.Form.Get("OutPut"));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //if (PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.SuitRange != 1)
                //{
                //    HfUpdateRight.Value = "False";
                //    HfDeleteRight.Value = "False";
                //}
                //else
                //{
                //    HfUpdateRight.Value = PrjPub.HasEditRight("新增考试").ToString();
                //    HfDeleteRight.Value = PrjPub.HasDeleteRight("新增考试").ToString();
                //}

                hfRailSystemID.Value = PrjPub.GetRailSystemId().ToString();

                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                if (PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.UseType == 0)
                {
                    hfIsAdmin.Value = "True";
                }
                else
                {
                    hfIsAdmin.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";
                }

                ListItem item = new ListItem();
                item.Value = Session["StationOrgID"].ToString();
                item.Text  = "--请选择--";
                ddlOrg.Items.Add(item);

                if (PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.UseType == 0 && PrjPub.CurrentLoginUser.IsAdmin)
                {
                    ddlOrg.Visible = true;
                    lblOrg.Visible = true;

                    OrganizationBLL      objOrgBll = new OrganizationBLL();
                    IList <Organization> objList   = objOrgBll.GetOrganizationsByLevel(2);
                    foreach (Organization organization in objList)
                    {
                        ListItem litem = new ListItem();
                        litem.Value = organization.OrganizationId.ToString();
                        litem.Text  = organization.ShortName;
                        ddlOrg.Items.Add(litem);
                    }
                }
                else
                {
                    ddlOrg.Visible = false;
                    lblOrg.Visible = false;
                }

                hfOrgID.Value          = PrjPub.CurrentLoginUser.StationOrgID.ToString();
                HfExamCategoryId.Value = Request.QueryString.Get("id");
                Grid1.DataBind();
            }
            else
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    //RandomExamResultBLL reBll = new RandomExamResultBLL();
                    //IList<RailExam.Model.RandomExamResult> examResults = reBll.GetRandomExamResultByExamID(int.Parse(strDeleteID));

                    //if (examResults.Count > 0)
                    //{
                    //    SessionSet.PageMessage = "已有考生参加考试,该考试不能被删除!";
                    //    Grid1.DataBind();
                    //    return;
                    //}


                    DeleteData(int.Parse(strDeleteID));
                    Grid1.DataBind();
                }

                if (Request.Form.Get("Refresh") == "true")
                {
                    Grid1.DataBind();
                }

                if (Request.Form.Get("OutPut") != null && Request.Form.Get("OutPut") != string.Empty)
                {
                    OutputWord(Request.Form.Get("OutPut"));
                }

                if (Request.Form.Get("ResetID") != null && Request.Form.Get("ResetID") != string.Empty)
                {
                    Grid1.DataBind();
                }

                if (Request.Form.Get("arrangeID") != null && Request.Form.Get("arrangeID") != string.Empty)
                {
                    string                    strId   = Request.Form.Get("arrangeID");
                    RandomExamBLL             objBll  = new RandomExamBLL();
                    RailExam.Model.RandomExam objExam = objBll.GetExam(Convert.ToInt32(strId));

                    //if(objExam.HasPaper)
                    //{
                    //    SessionSet.PageMessage = "该考试已经生成试卷,不能重新安排微机教室!";
                    //    Grid1.DataBind();
                    //    return;
                    //}

                    if (!PrjPub.IsServerCenter)
                    {
                        Grid1.DataBind();
                        return;
                    }

                    if (PrjPub.CurrentLoginUser.RoleID != 1)
                    {
                        OracleAccess              db          = new OracleAccess();
                        RandomExamArrangeBLL      arrangeBll  = new RandomExamArrangeBLL();
                        IList <RandomExamArrange> arrangeList = arrangeBll.GetRandomExamArranges(Convert.ToInt32(strId));

                        if (arrangeList.Count == 0)
                        {
                            SessionSet.PageMessage = "该考试还未选择考生,不能安排微机教室!";
                            Grid1.DataBind();
                            return;
                        }

                        RandomExamArrange arrange = arrangeList[0];

                        bool            hasOrg      = false;
                        string[]        str         = arrange.UserIds.Split(',');
                        EmployeeBLL     employeebll = new EmployeeBLL();
                        OrganizationBLL orgBll      = new OrganizationBLL();
                        for (int i = 0; i < str.Length; i++)
                        {
                            Employee obj = employeebll.GetEmployee(Convert.ToInt32(str[i]));

                            if (orgBll.GetStationOrgID(obj.OrgID) == PrjPub.CurrentLoginUser.StationOrgID)
                            {
                                hasOrg = true;
                                break;
                            }
                        }

                        if (!hasOrg)
                        {
                            SessionSet.PageMessage = "该考试没有本站段考生,无须安排微机教室!";
                            Grid1.DataBind();
                            return;
                        }
                    }

                    Grid1.DataBind();
                    ClientScript.RegisterStartupScript(GetType(),
                                                       "jsSelectFirstNode",
                                                       @"showArrange(" + strId + ");",
                                                       true);
                }
            }
        }
Ejemplo n.º 15
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;
            }
        }
Ejemplo n.º 16
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();
                }
            }
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("../Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                int railSystemId = PrjPub.RailSystemId();

                string str = "";
                if (railSystemId != 0)
                {
                    str = " and (Rail_System_ID= " + railSystemId + " or org_id=" + PrjPub.CurrentLoginUser.StationOrgID + ")";
                }
                string strSql = "select * from org where level_num=2 " + str + "  and Is_Effect=1 order by parent_id,order_index";

                OracleAccess db = new OracleAccess();
                DataSet      ds = db.RunSqlDataSet(strSql);

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

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

                //ddlOrg.SelectedValue = PrjPub.CurrentLoginUser.StationOrgID.ToString();

                if (PrjPub.CurrentLoginUser.SuitRange == 0)
                {
                    ddlOrg.Visible = false;
                    lblOrg.Visible = false;
                }

                for (int i = 2010; i < 2027; i++)
                {
                    ListItem item = new ListItem();
                    item.Text  = i.ToString();
                    item.Value = i.ToString();
                    ddlYear.Items.Add(item);
                }
                ddlYear.Items.Insert(0, "--请选择--");
                ddlYear.SelectedValue = DateTime.Now.Year.ToString();
                //绑定培训计划类别
                OracleAccess oracleAccess = new OracleAccess();
                DataSet      ds1          = oracleAccess.RunSqlDataSet("select * from ZJ_TRAINPLAN_TYPE");
                ddlTrainPlanType.DataSource     = ds1.Tables[0].DefaultView;
                ddlTrainPlanType.DataTextField  = "TRAINPLAN_TYPE_NAME";
                ddlTrainPlanType.DataValueField = "TRAINPLAN_TYPE_ID";
                ddlTrainPlanType.DataBind();
                hfSelect.Value = GetSql();


                if (PrjPub.HasEditRight("培训计划") && PrjPub.IsServerCenter)
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }

                if (PrjPub.HasDeleteRight("培训计划") && PrjPub.IsServerCenter)
                {
                    HfDeleteRight.Value = "True";
                }
                else
                {
                    HfDeleteRight.Value = "False";
                }
            }
        }
Ejemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                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 (hfDeleteID.Value == "")
            {
                hfSql.Value =
                    String.Format(
                        @"
                                    select e.employee_id,e.employee_name,e.sex,e.work_no,p.post_name,getorgname(e.org_id) getorgname from employee e
									left join post p on p.post_id=e.post_id where e.employee_id in ({0})
                                    ",
                        hfEmployeeID.Value == "" ? "-1" : hfEmployeeID.Value);
            }
            string[] arr = hfEmployeeID.Value.Split(',');
            foreach (string s in arr)
            {
                lst.Add(s);
            }

            if (hfDeleteID.Value != "")
            {
                if (hfDeleteID.Value.IndexOf(",") > 0)
                {
                    string[] arrID = hfDeleteID.Value.Split(',');
                    foreach (string s in arrID)
                    {
                        lst.Remove(s);
                    }
                }
                else
                {
                    lst.Remove(hfDeleteID.Value);
                }
                hfEmployeeID.Value = string.Join(",", lst.ToArray());
                //grdEntity.EnableViewState = false;
                hfSql.Value =
                    String.Format(
                        @"
                                    select e.employee_id,e.employee_name,e.sex,e.work_no,p.post_name,getorgname(e.org_id) getorgname from employee e
									left join post p on p.post_id=e.post_id where e.employee_id in ({0})
                                    ",
                        hfEmployeeID.Value == "" ? "-1" : hfEmployeeID.Value);
                grdEntity.DataBind();
                hfDeleteID.Value = "";
            }
        }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.HasEditRight("成绩查询"))
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }

                //UseType=0为路局角色
                if (PrjPub.HasDeleteRight("新增考试") && PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.IsAdmin)// && PrjPub.CurrentLoginUser.UseType == 0
                {
                    hfDeleteRight.Value = "True";
                }
                else
                {
                    hfDeleteRight.Value = "False";
                }

                //如果是访问路局则只要是有成绩查询权限的用户均可以访问成绩查询页面
                if (PrjPub.IsServerCenter)
                {
                    hfIsAdmin.Value = "True";
                }
                //如果是访问路局则非本站段的用户不能访问成绩查询页面
                else
                {
                    hfOrgID.Value = ConfigurationManager.AppSettings["StationID"].ToString();
                    if ((PrjPub.CurrentLoginUser.StationOrgID.ToString() == hfOrgID.Value) || PrjPub.CurrentLoginUser.UseType == 0)
                    {
                        hfIsAdmin.Value = "True";
                    }
                    else
                    {
                        hfIsAdmin.Value = "False";
                    }
                }

                hfIsServer.Value = PrjPub.IsServerCenter.ToString();

                //hfWhereCluase.Value = "a.Org_ID=" + Request.QueryString.Get("orgID")
                //        +" and (Save_Status=1 or (Save_Status=2 and sysdate>Save_Date))";
            }

            string strDeleteID = Request.Form.Get("DeleteID");

            if (!string.IsNullOrEmpty(strDeleteID))
            {
                RandomExamBLL             examBLL = new RandomExamBLL();
                RailExam.Model.RandomExam obj     = examBLL.GetExam(Convert.ToInt32(strDeleteID));

                if (obj.HasTrainClass)
                {
                    SessionSet.PageMessage = "不能删除有培训班的考试!";
                    examsGrid.DataBind();
                    return;
                }

                examBLL.DeleteExam(int.Parse(strDeleteID));
                examsGrid.DataBind();
            }
        }