Ejemplo n.º 1
0
        //数据插入
        public static bool insertUserInfo(UserInfoData data)
        {
            string sql = "insert into User_Login(UserID,UserName,UserPwd,UserRight) VALUE('" +
                         data.UserID + "','" + data.UserName + "','" + data.UserPwd + "','" + "'" + data.UserRight + "')";

            return(dataAccess.ExecuteSQL(sql));
        }
Ejemplo n.º 2
0
        public main()
        {
            InitializeComponent();

            User.UserInfoData data = new User.UserInfoData();
            data.UserName = User.Constants.UserName;
            ds            = User.UserInfoOperation.getUserInfoAll(data);
            if (ds.Tables[0].Rows.Count > 0)
            {
                User.Constants.UserRight = ds.Tables[0].Rows[0]["用户权限"].ToString();
                string str = "Welcome Back! \n" + "Dear:" + User.Constants.UserName + "\n Your Authority: " + User.Constants.UserRight;
                MessageBox.Show(str, "Welcome to WestWorld", MessageBoxButtons.OK);
            }
            if (User.Constants.UserRight.Trim() == "学生")
            {
                this.teacherUpdateToolStripMenuItem.Enabled  = false;
                this.teacherInsertToolStripMenuItem1.Enabled = false;
                this.teacherDeleteToolStripMenuItem.Enabled  = false;
                this.scoreUpdateToolStripMenuItem.Enabled    = false;
                this.scoreDeleteToolStripMenuItem.Enabled    = false;
                this.scoreInsertToolStripMenuItem.Enabled    = false;
                this.courseUpdateToolStripMenuItem.Enabled   = false;
                this.courseDeleteToolStripMenuItem.Enabled   = false;
                this.courseInsertToolStripMenuItem.Enabled   = false;
                this.TCUpdateToolStripMenuItem.Enabled       = false;
                this.TCDeleteToolStripMenuItem.Enabled       = false;
                this.studentDeleteToolStripMenuItem.Enabled  = false;
                this.studentUpdateToolStripMenuItem.Enabled  = false;
                this.TCInsertToolStripMenuItem.Enabled       = false;
                this.userInfoToolStripMenuItem.Enabled       = false;
                this.overviewToolStripMenuItem.Enabled       = false;
                this.editRightToolStripMenuItem.Enabled      = false;
            }
            if (User.Constants.UserRight.Trim() == "教师")
            {
                this.userInfoToolStripMenuItem.Enabled      = false;
                this.editRightToolStripMenuItem.Enabled     = false;
                this.overviewToolStripMenuItem.Enabled      = false;
                this.teacherUpdateToolStripMenuItem.Enabled = false;
                this.teacherDeleteToolStripMenuItem.Enabled = false;
                this.TCInsertToolStripMenuItem.Enabled      = false;
                this.TCDeleteToolStripMenuItem.Enabled      = false;
                this.scoreInsertToolStripMenuItem.Enabled   = false;
                this.scoreQueryToolStripMenuItem.Enabled    = false;
                this.studentUpdateToolStripMenuItem.Enabled = false;
                this.studentQueryToolStripMenuItem.Enabled  = false;
                this.studentDeleteToolStripMenuItem.Enabled = false;
            }
        }
Ejemplo n.º 3
0
        public static DataSet GetUserInfoAll(UserInfoData data)
        {
            string sql = "";

            if (data.UserName != null && data.UserName != "")
            {
                sql += "UserName='******'";
            }
            if (data.UserRight != null && data.UserRight != "")
            {
                sql += "and UserRight='" + data.UserRight + "'";
            }
            string sql1 = "select UserName 用户名,UserPwd 用户密码,UserRight 用户权限 from User_Login where " + sql;

            return(dataAccess.GetDataSet(sql1, "User_Login"));
        }
Ejemplo n.º 4
0
        //数据更新
        public static bool updateUserInfo(UserInfoData data)
        {
            string sql = "update User_Login set UserPwd='" + data.UserPwd + "',UserRight='" + data.UserRight + "' where UserName='******'";

            return(dataAccess.ExecuteSQL(sql));
        }