Esempio n. 1
0
        public DataTable GetAllRoleInfo(string rolename)
        {
            string sql = string.Empty;

            if (String.IsNullOrEmpty(rolename))
            {
                sql = "select * from roleinfo";
            }
            else
            {
                sql = "select * from roleinfo where rolename like '%" + rolename + "%'";
            }
            return(sqlconn.Query(sql).Tables[0]);
        }
Esempio n. 2
0
        public DataTable LoadData()
        {
            string    sql = "select * from tbl_pathValue";
            DataTable dt  = sqlconn.Query(sql).Tables[0];

            return(dt);
        }
Esempio n. 3
0
        public bool login(string username, string password)
        {
            string sql = "select * from sysuser where username=@username and password=@password and status=1";

            SqlParameter[] param = new SqlParameter[] {
                new SqlParameter("@username", username),
                new SqlParameter("@password", password)
            };
            DataSet ds = sqlconn.Query(sql, param);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 实时信息记录
        /// </summary>
        /// <returns></returns>
        public DataTable GetInfo()
        {
            string sql = @"select top 10 key_process,equipment,productno,createtime 
                        from productlog
                        order by createtime desc";

            return(sqlconn.Query(sql).Tables[0]);
        }
Esempio n. 5
0
        public static string Msg(string site, int bytes, int bit)
        {
            TempTest  sqlconn = new TempTest();
            DataTable dt      = sqlconn.Query("select * from PLC_Msg where site='" + site + "',byte=" + bytes + ",bit=" + bit + "").Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(dt.Rows[0]["message"].ToString());
            }
            else
            {
                return(string.Empty);
            }
        }
Esempio n. 6
0
        public DataTable GetAllDeptInfo(string deptname)
        {
            string sql = string.Empty;

            if (String.IsNullOrEmpty(deptname))
            {
                sql = "select * from department";
            }
            else
            {
                sql = "select * from department where deptname like '%" + deptname + "%'";
            }
            return(sqlconn.Query(sql).Tables[0]);
        }
Esempio n. 7
0
        public DataTable GetEmailConfig()
        {
            string sql = "select * from email_config ";

            return(test.Query(sql).Tables[0]);
        }
Esempio n. 8
0
        public DataTable GetAllMenuInfo()
        {
            string sql = "select menuid,parentid,menuname from menuinfo order by sort";

            return(sqlconn.Query(sql).Tables[0]);
        }