Beispiel #1
0
        public static string getMechine(string mechineID)
        {
            string mechineInfo = null;

            try
            {
                mechineInfo = RedisHelper.GetRedisModel <string>(mechineID + "_mechineInfoSet");
            }
            catch
            {
            }

            if (string.IsNullOrEmpty(mechineInfo))
            {
                string    sql = "select am.*,ac.p1,ac.p2,ac.p3,ac.p4,ac.p5,ac.p6,ac.p7,ac.p8,ac.p9,ac.p10,am.setTem,'' videoListNo,'' productTypeNo,'' androidProductNo,'' priceSwitch from asm_mechine am left join asm_company ac on am.companyID=ac.id where am.id='" + mechineID + "'";
                DataTable dt  = DbHelperSQL.Query(sql).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    RedisHelper.SetRedisModel <string>(mechineID + "_mechineInfoSet", OperUtil.DataTableToJsonWithJsonNet(dt));
                    mechineInfo = OperUtil.DataTableToJsonWithJsonNet(dt);
                }
            }

            return(mechineInfo);
        }
Beispiel #2
0
        public static string getCompany(string companyID)
        {
            string result = RedisHelper.GetRedisModel <string>(companyID + "_companyInfo");

            if (string.IsNullOrEmpty(result))
            {
                string    sql = "select * from asm_company where id=" + companyID;
                DataTable dt  = DbHelperSQL.Query(sql).Tables[0];
                result = OperUtil.DataTableToJsonWithJsonNet(dt);
                RedisHelper.SetRedisModel <string>(companyID + "_companyInfo", result, new TimeSpan(2, 0, 0));
            }
            return(result);
        }
Beispiel #3
0
        public static string getOperaID()
        {
            string    openID = OperUtil.getCooki("vshop_openID").ToString();
            string    sql    = "select * from asm_opera where id='" + openID + "'";
            DataTable dt     = DbHelperSQL.Query(sql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(dt.Rows[0]["id"].ToString());
            }
            else
            {
                return("0");
            }
        }