Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LoginValidator validator = new LoginValidator();

            //Session["loginUser"] = "******";
            if (!validator.isLogin() || !validator.selectValid())
            {
                Response.Redirect("403.aspx");
            }
        }
Ejemplo n.º 2
0
        protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
        {
            LoginValidator validator = new LoginValidator();

            string url;

            if (TreeView1.SelectedValue == "员工信息" && validator.selectValid())
            {
                url = "WebForm3.aspx";
                this.frmList.Attributes.Add("src ", url);
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /* var conn = ConnPool.getInstance;
             * //var res=conn.exeQuery("SELECT auth FROM emp_auth INNER JOIN employee WHERE auth='select' and employee.ename = N'张三';");
             * DataTable res = conn.exeQuery("SELECT count(*) FROM Auth ");
             * GridView1.DataSource = res.DefaultView;
             * GridView1.DataBind();*/

            Session["loginUser"] = "******";
            LoginValidator validator = new LoginValidator();

            Response.Write("select " + validator.selectValid());
            Response.Write("update " + validator.updateValid());
            Response.Write("insert " + validator.insertValid());
            Response.Write("delete " + validator.deleteValid());
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["loginUser"] = "******";
            var conn = ConnPool.getInstance;
            var res  = conn.exeQuery(
                "SELECT auth FROM Auth join employee where ename='张三'");


            Response.Write(res.Rows[0][0]);

            LoginValidator validator = new LoginValidator();

            Response.Write("select " + validator.selectValid() + "  ");
            Response.Write("update " + validator.updateValid() + "  ");
            Response.Write("insert " + validator.insertValid() + "  ");
            Response.Write("delete " + validator.deleteValid());
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LoginValidator validator = new LoginValidator();

            // Session["loginUser"] = "******";
            if (!validator.isLogin() || !validator.selectValid())
            {
                Response.Redirect("403.aspx");
            }

            try
            {
                var conn = ConnPool.getInstance;
                var res  = conn.exeQuery("select did as 'Department ID ',dname as 'Department Name' ,employee.eid as 'Employee ID',employee.ename as 'Employee Name',employee.age as 'Employee Age' from Department left join employee on (Department.did=employee.departID) where employee.director=1");
                GridView1.DataSource = res.DefaultView;
                GridView1.DataBind();
            }
            catch
            {
                ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('数据库链接错误! ');</script>");
            }
        }