Пример #1
0
        public List <object> getMachineUserDate(JObject passJson, String mac)
        {
            try
            {
                sqlHelper       sh = new sqlHelper();
                ISqlSugarClient db = sh.dbClient();

                string sql = "";
                sql += " select u.*,t.teamName from tb_Machine_user u" +
                       " inner join public_team  t on t.teamId = u.belongsId and t.flag = 1 " +
                       " where u.flag = 1 and cpuid = '" + mac + "'";


                //这里把查询的语句记录到内存中
                sysSearchSql sss = new sysSearchSql();
                sss.loginInIp = public_method.GetIPAddress();
                sss.gridkey   = "getMachineUserDate";//这里记录一下
                sss.sql       = sql;

                MvcApplication.setsysSearchSql(sss);

                var list = db.SqlQueryable <object>(sql).ToList();

                return(list);
            }
            catch (Exception ex)
            {
                return(new List <object>());
            }
        }
Пример #2
0
        public static void writeLog(string keyName, string sql)
        {
            //这里把查询的语句记录到内存中
            sysSearchSql sss = new sysSearchSql();

            sss.loginInIp = public_method.GetIPAddress();
            sss.gridkey   = keyName;//这里记录一下
            sss.sql       = sql;

            MvcApplication.setsysSearchSql(sss);
        }
Пример #3
0
        public DataTable getSysLog(JObject passJson)
        {
            DataTable dt = new DataTable();

            try
            {
                sqlHelper       sh = new sqlHelper();
                ISqlSugarClient db = sh.dbClient();

                string sql = "";
                sql = " select s.*,u.userName createUserName  from sys_log s left join sys_user u on s.createUserId=u.userId where 1=1  ";
                if (passJson != null)
                {
                    JArray passSearchJarry = JArray.Parse(passJson["centerSearchArray"].ToString());
                    for (var i = 0; i < passSearchJarry.Count; i++)
                    {
                        string key   = passSearchJarry[i]["fieldName"].ToString();
                        string op    = passSearchJarry[i]["op"].ToString();
                        string value = passSearchJarry[i]["fieldValue"].ToString();;
                        if (!string.IsNullOrEmpty(key) &&
                            !string.IsNullOrEmpty(op) &&
                            !string.IsNullOrEmpty(value))
                        {
                            sql += " and " + key + public_method.get_opTimeReset_sql(op, value);
                        }
                    }
                }
                // sql += "  order by s.createDate desc ";

                //这里把查询的语句记录到内存中
                sysSearchSql sss = new sysSearchSql();
                sss.loginInIp = public_method.GetIPAddress();
                sss.gridkey   = "getSysLog";//这里记录一下
                sss.sql       = sql;

                MvcApplication.setsysSearchSql(sss);

                dt = db.SqlQueryable <object>(sql).OrderBy("createDate desc").ToDataTable();

                return(dt);
            }
            catch (Exception ex)
            {
                return(dt);
            }
        }
Пример #4
0
        public List <object> getUserManger(JObject passJson)
        {
            try
            {
                sqlHelper       sh = new sqlHelper();
                ISqlSugarClient db = sh.dbClient();

                string sql = "";
                sql += " select * from vw_userManger where 1=1";
                if (passJson != null)
                {
                    JArray passSearchJarry = JArray.Parse(passJson["centerSearchArray"].ToString());
                    for (var i = 0; i < passSearchJarry.Count; i++)
                    {
                        string key   = passSearchJarry[i]["fieldName"].ToString();
                        string op    = passSearchJarry[i]["op"].ToString();
                        string value = passSearchJarry[i]["fieldValue"].ToString();;
                        if (!string.IsNullOrEmpty(key) &&
                            !string.IsNullOrEmpty(op) &&
                            !string.IsNullOrEmpty(value))
                        {
                            sql += " and " + key + public_method.get_opTimeReset_sql(op, value);
                        }
                    }
                }

                //这里把查询的语句记录到内存中
                sysSearchSql sss = new sysSearchSql();
                sss.loginInIp = public_method.GetIPAddress();
                sss.gridkey   = "getUserManger";//这里记录一下
                sss.sql       = sql;

                MvcApplication.setsysSearchSql(sss);

                var list = db.SqlQueryable <object>(sql).OrderBy("orderNum").ToList();

                return(list);
            }
            catch (Exception ex)
            {
                return(new List <object>());
            }
        }