Exemplo n.º 1
0
        public static object sear(string pcbh, string keyword, string statuType, string pageCurrentCount, string cardNO)
        {
            string sql1 = "";

            if (!string.IsNullOrEmpty(pcbh))
            {
                sql1 += " and codeBH='" + pcbh + "'";
            }
            if (!string.IsNullOrEmpty(keyword))
            {
                sql1 += " and (m.name like '%" + keyword + "%' or m.phone like '%" + keyword + "%')";
            }
            if (!string.IsNullOrEmpty(cardNO))
            {
                sql1 += " and cardNO like '%" + cardNO + "%'";
            }
            if (statuType != "0")
            {
                sql1 += " and statu=" + statuType;
            }
            string sql        = "select p.*,m.name,m.phone from asm_payCodeList p left join asm_member m on p.memberID=m.id  where 1=1 " + sql1;
            int    startIndex = (int.Parse(pageCurrentCount) - 1) * Config.pageSize + 1;
            int    endIndex   = int.Parse(pageCurrentCount) * Config.pageSize;

            DataTable dt = Config.getPageDataTable("order by T.id desc", sql, startIndex, endIndex);
            DataTable da = DbHelperSQL.Query(sql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                double d = double.Parse((da.Rows.Count / double.Parse(Config.pageSize.ToString())).ToString());
                return(new { code = 200, db = OperUtil.DataTableToJsonWithJsonNet(dt), count = Math.Ceiling(d) });
            }
            return(new { code = 500, msg = "" });
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string code      = "";
                string companyID = "";
                if (Request.QueryString["code"] != null && Request.QueryString["code"] != "")
                {
                    code = Request.QueryString["code"].ToString();

                    string str = Request.QueryString["req"].ToString();
                    string req = PwdHelper.DecodeDES(str, "bingoseller");

                    companyID = req.Split('&')[2].Split('=')[1];
                    string    sql2 = "select * from asm_company where id=" + companyID;
                    DataTable d1   = DbHelperSQL.Query(sql2).Tables[0];

                    if (d1.Rows.Count > 0)
                    {
                        appid     = d1.Rows[0]["appId"].ToString();
                        appsecret = d1.Rows[0]["wx_appsecret"].ToString();
                    }

                    OAuth_Token Model           = Get_token(code, companyID);
                    OAuthUser   OAuthUser_Model = Get_UserInfo(Model.access_token, Model.openid);
                    if (OAuthUser_Model.openid != null && OAuthUser_Model.openid != "") //已获取得openid及其他信息
                    {
                        tupian = OAuthUser_Model.headimgurl.ToString();                 //头像图片
                        name   = OAuthUser_Model.nickname;                              //昵称
                        id     = OAuthUser_Model.openid;                                //opendid
                        string unionID  = OAuthUser_Model.unionid;
                        string country  = OAuthUser_Model.country;
                        string province = OAuthUser_Model.province;
                        string city     = OAuthUser_Model.city;
                        OperUtil.setCooki("vshop_openID", id);

                        string    sql = "select * from asm_member where openID='" + id + "' and companyID=" + companyID;
                        DataTable dt  = DbHelperSQL.Query(sql).Tables[0];
                        if (dt.Rows.Count <= 0)
                        {
                            //添加会员 会员不一定必须绑定机器  只有会员有订购产品的时候才必须绑定机器
                            string sql1 = "INSERT INTO [dbo].[asm_member]"
                                          + " ([name],[phone],[QQ],[province],[city],[country],[addres],[AvailableMoney],[sumConsume],[sumRecharge],[createDate],[mechineID],[companyID],[age],[LastTime],[memberBH],[consumeCount],[openID],[brithday],[headurl],[nickname],unionID)"
                                          + " VALUES('" + name + "','','','" + province + "','" + city + "','','',0,0,0,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','','" + companyID + "','0','','',0,'" + id + "','','" + tupian + "','" + name + "','" + unionID + "')";
                            DbHelperSQL.ExecuteSql(sql1);
                            wxHelper wx   = new wxHelper(companyID);
                            string   data = TemplateMessage.Member_ZC(id, OperUtil.getMessageID(companyID, "OPENTM203347141"), "恭喜您注册成为会员!", name, "恭喜您注册成为会员,您将享受到会员所有权利!");
                            TemplateMessage.SendTemplateMsg(wx.IsExistAccess_Token(companyID), data);
                        }
                        else
                        {
                            string update = "update asm_member set unionID='" + unionID + "',name='" + name + "',nickname='" + name + "',headurl='" + tupian + "' where openID='" + id + "'";
                            Util.Debuglog("Update=" + update, "更新会员信息.txt");
                        }

                        Response.Redirect("paypage.aspx?req=" + str);
                    }
                }
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                time               = this.end.Value;
                comID              = OperUtil.Get("companyID");
                operaID            = OperUtil.Get("operaID");
                this.agentID.Value = operaID;
                if (string.IsNullOrEmpty(comID) || string.IsNullOrEmpty(operaID))
                {
                    Response.Write("<script>alert('您尚未登录或已长时间未进行操作,请重新登录!');top.location.href='../../index.aspx';</script>");
                    return;
                }
                if (operaID != "0")
                {
                    this.companyID.Value = comID;
                    string  sqlme = "select  id sCode,bh sName from  asm_mechine where dls='" + operaID + "' and companyID=" + comID;
                    DataSet dd    = DbHelperSQL.Query(sqlme);

                    this.cbosDeparentment.dtDataList = dd;
                }
                else
                {
                    this.companyID.Value = comID;
                    string  sqlme = "select  id sCode,bh sName from  asm_mechine where companyID=" + comID;
                    DataSet dd    = DbHelperSQL.Query(sqlme);

                    this.cbosDeparentment.dtDataList = dd;
                }
            }
        }
Exemplo n.º 4
0
        public static object sear(string mechineID, string start, string end, string pageCurrentCount)
        {
            string sql1 = "";

            if (!string.IsNullOrEmpty(mechineID))
            {
                sql1 += " and r.mechineID in(" + mechineID + ")";
            }
            if (!string.IsNullOrEmpty(start))
            {
                sql1 += " and timeStr>'" + start + "'";
            }
            if (!string.IsNullOrEmpty(end))
            {
                sql1 += " and timeStr<'" + end + "'";
            }
            string sql        = "select r.*,m.name,(select mechineName from asm_mechine where asm_mechine.id=r.mechineID)mechineName,(select bh from asm_mechine where asm_mechine.id=r.mechineID)bh from  asm_mechineRecord r left join asm_member m on r.memberID=m.id where 1=1 " + sql1;
            int    startIndex = (int.Parse(pageCurrentCount) - 1) * Config.pageSize + 1;
            int    endIndex   = int.Parse(pageCurrentCount) * Config.pageSize;

            DataTable dt = Config.getPageDataTable("order by T.timeStr desc", sql, startIndex, endIndex);

            DataTable da = DbHelperSQL.Query(sql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                double d = double.Parse((da.Rows.Count / double.Parse(Config.pageSize.ToString())).ToString());
                return(new { code = 200, db = OperUtil.DataTableToJsonWithJsonNet(dt), count = Math.Ceiling(d) });
            }
            return(new { code = 500 });
        }
Exemplo n.º 5
0
        //30分钟查询是否有温度异常没发短信的,有则发短信
        private void minTimer_30_ElapsedT(object source, ElapsedEventArgs e)
        {
            //发送温度异常短信 //
            string    sqlT3 = "select * from asm_mechine where sendT=1 and lastReqTime is not null and  id =" + id;
            DataTable dt3   = DbHelperSQL.Query(sqlT3).Tables[0];

            if (dt3.Rows.Count > 0)
            {
                try
                {
                    string    sql21 = "select linkphone from asm_opera where id='" + dt3.Rows[0]["operaID"].ToString() + "'";
                    string    sql22 = "select linkphone from asm_company where id='" + dt3.Rows[0]["companyID"].ToString() + "'";
                    DataTable d21   = DbHelperSQL.Query(sql21).Tables[0];
                    DataTable d22   = DbHelperSQL.Query(sql22).Tables[0];
                    if (d21.Rows.Count > 0 && d21.Rows[0]["linkphone"].ToString() != "")
                    {
                        OperUtil.sendMessage3(d21.Rows[0]["linkphone"].ToString(), dt3.Rows[0]["mechineName"].ToString(), dt3.Rows[0]["lastReqTime"].ToString().Substring(11, 5), dt3.Rows[0]["temperture"].ToString());
                    }
                    if (d22.Rows.Count > 0 && d22.Rows[0]["linkphone"].ToString() != "")
                    {
                        OperUtil.sendMessage3(d22.Rows[0]["linkphone"].ToString(), dt3.Rows[0]["mechineName"].ToString(), dt3.Rows[0]["lastReqTime"].ToString().Substring(11, 5), dt3.Rows[0]["temperture"].ToString());
                    }
                    string sqlupdate = "update asm_mechine set sendT=0 where id=" + dt3.Rows[0]["id"].ToString();
                    DbHelperSQL.ExecuteSql(sqlupdate);
                }
                catch (Exception ex)
                {
                    OperUtil.Debuglog("cuowu=" + ex.Message, "短信_.txt");
                }
            }
        }
Exemplo n.º 6
0
        public static string getProductList(string keyword, string qy, string pageCurrentCount)
        {
            string sql1 = " and 1=1";

            if (keyword.Trim() != "")
            {
                sql1 += " and C.proName like '%" + keyword + "%'";
            }
            if (qy != "0")
            {
                sql1 += " and C.companyID=" + qy;
            }

            string sql        = "select C.*,D.typeName from (select A.*,B.name  from(select ap.* from asm_product ap left join  asm_mechine ac on ap.mechineID=ac.id) A left join asm_company B  on A.companyID=B.id) C left join asm_protype D on C.protype=D.productTypeID where 1=1 " + sql1;
            int    startIndex = (int.Parse(pageCurrentCount) - 1) * Config.pageSize + 1;
            int    endIndex   = int.Parse(pageCurrentCount) * Config.pageSize;

            DataTable dt = Config.getPageDataTable("order by T.productID ", sql, startIndex, endIndex);
            DataTable da = DbHelperSQL.Query(sql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                double d  = double.Parse((da.Rows.Count / double.Parse(Config.pageSize.ToString())).ToString());
                string ss = Math.Ceiling(d) + "@" + OperUtil.DataTableToJsonWithJsonNet(dt);

                //string ss =OperUtil.DataTableToJsonWithJsonNet(da);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (OperUtil.getCooki("vshop_openID") != "0")
            {
                this.member_ID.Value = Util.getMemberID();
            }
            else
            {
                string userAgent = Request.UserAgent;
                if (userAgent.ToLower().Contains("micromessenger"))
                {
                    Response.Redirect("WXCallback.aspx?companyID=" + OperUtil.getCooki("companyID"));
                    return;
                }
            }


            string sql1 = "select * from asm_member where id='" + this.member_ID.Value + "'";

            DataTable dt = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                this.nickname.Value = dt.Rows[0]["nickname"].ToString();
            }
        }
Exemplo n.º 8
0
        public static string getOrderList(string bh, string mechineID, string zq, string companyID)
        {
            string sql = " 1=1 ";

            if (!string.IsNullOrEmpty(bh))
            {
                sql += "  and A.orderNO='" + bh + "'";
            }
            if (!string.IsNullOrEmpty(mechineID) && mechineID != "0")
            {
                sql += " and A.mechineID=" + mechineID;
            }
            if (!string.IsNullOrEmpty(zq) && zq != "0")
            {
                sql += " and zq=" + zq;
            }
            string    sql1 = "select A.*,b.bh from (select ao.*,am.name,am.phone from asm_order ao left join asm_member  am on ao.memberID=am.id where am.companyID=" + companyID + ") A left join asm_mechine B on A.mechineID=B.id where  1=1 and " + sql;
            DataTable dt   = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                string ss = OperUtil.DataTableToJsonWithJsonNet(dt);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            companyID             = OperUtil.Get("companyID");
            this._companyID.Value = companyID;
            agentID             = OperUtil.Get("operaID");
            this._agentID.Value = agentID;
            if (string.IsNullOrEmpty(companyID))
            {
                Response.Write("<script>alert('您尚未登录或已长时间未进行操作,请重新登录!');top.location.href='../../index.aspx';</script>");
                return;
            }
            try
            {
                province     = Request.QueryString["province"].ToString();
                city         = Request.QueryString["city"].ToString();
                country      = Request.QueryString["country"].ToString();
                start        = Request.QueryString["start"].ToString();
                end          = Request.QueryString["end"].ToString();
                sxType       = Request.QueryString["sxType"].ToString();
                mechineIDStr = Request.QueryString["mechineIDStr"].ToString();

                getData(province, city, country, start, end, sxType, companyID, mechineIDStr, agentID);
            }
            catch
            {
                //初始化的时候查全部
                getData(null, null, null, null, null, null, companyID, null, this._agentID.Value);
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comID = OperUtil.Get("companyID");
            this._operaID.Value = OperUtil.Get("operaID");
            if (string.IsNullOrEmpty(comID))
            {
                Response.Write("<script>alert('您尚未登录或已长时间未进行操作,请重新登录!');top.location.href='../../index.aspx';</script>");
                return;
            }

            if (!IsPostBack)
            {
                this.companyID.Value = comID;
                string    sql = "select * from asm_mechine where companyID=" + comID;
                DataTable dt  = DbHelperSQL.Query(sql).Tables[0];
                this.mechineList.DataTextField  = "bh";
                this.mechineList.DataValueField = "id";
                this.mechineList.DataSource     = dt;
                this.mechineList.DataBind();
                this.mechineList.Items.Insert(0, new ListItem("所有机器", "0")); //添加项

                string    sql1 = "select * from  asm_activity where companyID=" + this.companyID.Value + " and  is_del=0";
                DataTable d1   = DbHelperSQL.Query(sql1).Tables[0];
                this.zqList.DataTextField  = "zqName";
                this.zqList.DataValueField = "zq";
                this.zqList.DataSource     = d1;
                this.zqList.DataBind();
                this.zqList.Items.Insert(0, new ListItem("所有周期", "0")); //添加项
            }
        }
Exemplo n.º 11
0
        public static string sear(string bh, string companyID, string province, string city, string country)
        {
            string sql1 = "";

            if (bh != "")
            {
                sql1 += " and bh='" + bh + "'";
            }
            if (companyID != "0")
            {
                sql1 += " and companyID=" + companyID;
            }
            if (province != "省份")
            {
                sql1 += " and province like '%" + province + "%'";
            }
            if (city != "地级市")
            {
                sql1 += " and city like '%" + city + "%'";
            }
            if (country != "市、县级市")
            {
                sql1 += " and  country like '%" + country + "%'";
            }
            string    sql = "select id,bh,mechineName,province,city,country,(select name from asm_company where asm_mechine.companyID=asm_company.id) companyName,case zt when '1' then '禁用' when '2' then '正常' when '3' then '过期' else '其他' end zt  from asm_mechine where 1=1 " + sql1;
            DataTable dt  = DbHelperSQL.Query(sql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(OperUtil.DataTableToJsonWithJsonNet(dt));
            }
            return("1");
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = OperUtil.Get("comOperID");

            this.operaID.Value = id;
            this.OPID.Value    = OperUtil.Get("operaID");
        }
Exemplo n.º 13
0
        public static string search(string gsid, string bh)
        {
            string sql = " where 1=1";

            if (bh != "")
            {
                sql += " and am.bh='" + bh + "'";
            }
            if (gsid != "0")
            {
                sql += " and am.companyID='" + gsid + "'";
            }
            string    sql1 = "select am.*,ac.name,amt.name mechineType,(select count(*) from asm_videoAddMechine where mechineID=am.id) num,case am.statu when '0' then '正常' when '1' then '脱机' when '2' then '温度异常'    else '其他' end sta from asm_mechine am left join asm_company ac on am.companyID=ac.id  left join asm_mechineType amt on am.version=amt.id " + sql;
            DataTable dt   = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                string ss = OperUtil.DataTableToJsonWithJsonNet(dt);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 14
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);
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comID = OperUtil.Get("companyID");

            if (string.IsNullOrEmpty(comID))
            {
                Response.Write("<script>alert('您尚未登录或已长时间未进行操作,请重新登录!');top.location.href='../../index.aspx';</script>");
                return;
            }

            this._activityID.Value = Request.QueryString["activityID"].ToString();
            this.companyID.Value   = comID;
            //获取选中的列表
            string    sql = "select * from asm_activity_fulldiscount_detail  where activityID='" + this._activityID.Value + "' and companyID='" + companyID.Value + "'";
            DataTable dt  = DbHelperSQL.Query(sql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    this.menu_id.Value += dt.Rows[i]["productTypeID"].ToString() + "_" + dt.Rows[i]["productID"].ToString() + "-";
                }
                this.menu_id.Value = this.menu_id.Value.Substring(0, this.menu_id.Value.Length - 1);
            }
        }
Exemplo n.º 16
0
        public static string search(string mechineID, string opera, string companyID, string agentID)
        {
            string sql = " where 1=1 and A.companyID=" + companyID;

            if (mechineID != "")
            {
                sql += " and A.id in(" + mechineID + ")";
            }
            if (opera != "")
            {
                sql += " and B.name='" + opera + "'";
            }
            //if (agentID != "0")
            //{
            //    sql += " and dls='" + agentID + "'";
            //}
            string    sql1 = "select A.*,B.name operaName,(select name from asm_opera where asm_opera.id=dls) dlsName from (select am.*,ac.name,amt.name mechineType, case am.statu when '0' then '正常' when '1' then '脱机' when '2' then '温度异常'   else '其他' end sta,case am.zt when '1' then '禁用' when '2' then '正常' when '3' then '过期'   else '其他' end t,(select des from asm_zfbhb where id=am.hbid) hbdes from asm_mechine am left join asm_company ac on am.companyID=ac.id  left join asm_mechineType amt on am.version=amt.id)   A left join asm_opera B on A.operaID=B.id" + sql;
            DataTable dt   = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                string ss = OperUtil.DataTableToJsonWithJsonNet(dt);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 17
0
 public static string getMechineList(string companyID)
 {
     if (companyID == "0")
     {
         string    sqlme = "select  id sCode,bh sName from  asm_mechine where 1=1";
         DataTable dd    = DbHelperSQL.Query(sqlme).Tables[0];
         if (dd.Rows.Count > 0)
         {
             return(OperUtil.DataTableToJsonWithJsonNet(dd));
         }
         else
         {
             return("1");
         }
     }
     else
     {
         string    sqlme = "select  id sCode,bh sName from  asm_mechine where companyID=" + companyID;
         DataTable dd    = DbHelperSQL.Query(sqlme).Tables[0];
         if (dd.Rows.Count > 0)
         {
             return(OperUtil.DataTableToJsonWithJsonNet(dd));
         }
         else
         {
             return("1");
         }
     }
 }
Exemplo n.º 18
0
        public static string sear(string name, string phone, string companyID, string operaID)
        {
            string sql1 = "";

            if (name.Trim() != "")
            {
                sql1 += " and (name like '%" + name + "%' or nickName like '%" + name + "%')";
            }
            if (phone.Trim() != "")
            {
                sql1 += " and  linkphone like '%" + phone + "%'";
            }
            //if (operaID!="0")
            //{
            //    sql1 += " and agentID="+operaID;
            //}
            string    sql = "select *,(select name from asm_role  ar where ar.id=ao.qx) roleName from asm_opera ao where ao.companyid=" + companyID + " " + sql1;
            DataTable dd  = DbHelperSQL.Query(sql).Tables[0];

            if (dd.Rows.Count > 0)
            {
                return(OperUtil.DataTableToJsonWithJsonNet(dd));
            }

            return("1");
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comID = OperUtil.Get("companyID");
            this._operaID.Value = OperUtil.Get("operaID");
            if (string.IsNullOrEmpty(comID))
            {
                Response.Write("<script>alert('您尚未登录或已长时间未进行操作,请重新登录!');top.location.href='../../index.aspx';</script>");
                return;
            }

            this.companyID.Value = comID;
            string    sql = "select * from asm_company where id=" + comID;
            DataTable dd  = DbHelperSQL.Query(sql).Tables[0];

            if (dd.Rows.Count > 0)
            {
                //this.appTime.Value = dd.Rows[0]["p2"].ToString();
                this.getTime.Value = dd.Rows[0]["p3"].ToString();
                //this.downTime.Value = dd.Rows[0]["p1"].ToString();

                this.jlc.Value = dd.Rows[0]["jlc"].ToString();

                this.syqx.Value         = dd.Rows[0]["p12"].ToString();
                this.biz.Value          = dd.Rows[0]["biz"].ToString();
                this.tkbs.Value         = dd.Rows[0]["tkbs"].ToString();
                this.minAppid.Value     = dd.Rows[0]["minAppid"].ToString();
                this.minAppSerect.Value = dd.Rows[0]["minSecret"].ToString();
                this.phone.Value        = dd.Rows[0]["customerPhone"].ToString();
            }
        }
Exemplo n.º 20
0
        public static string getOrderList(string mechineID, string companyID, string pageCurrentCount)
        {
            string sql = " 1=1 ";

            if (!string.IsNullOrEmpty(mechineID) && mechineID != "0")
            {
                sql += " and E.mechineID=" + mechineID;
            }
            if (!string.IsNullOrEmpty(companyID) && companyID != "0")
            {
                sql += " and E.companyID=" + companyID;
            }
            string sql1       = "select E.*,F.proName,F.price2 from (select C.*,D.name nickName from (select A.*,B.name from (select ao.*, am.bh,am.companyID from asm_order ao left join asm_mechine am on ao.mechineID=am.id) A left join asm_company B on A.companyID=B.id) C left join asm_member D on C.memberID=D.id) E left join asm_product F on E.productID=F.productID where 1=1 and " + sql;
            int    startIndex = (int.Parse(pageCurrentCount) - 1) * Config.pageSize + 1;
            int    endIndex   = int.Parse(pageCurrentCount) * Config.pageSize;

            DataTable dt = Config.getPageDataTable("order by T.id desc", sql1, startIndex, endIndex);
            DataTable da = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                double d  = double.Parse((da.Rows.Count / double.Parse(Config.pageSize.ToString())).ToString());
                string ss = Math.Ceiling(d) + "@" + OperUtil.DataTableToJsonWithJsonNet(dt);

                //string ss =OperUtil.DataTableToJsonWithJsonNet(da);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 21
0
 public static string getOperaList(string companyID)
 {
     if (companyID != "0")
     {
         string    sql = "select * from asm_opera where companyID=" + companyID + " and id IN(select operaID from asm_mechine where companyID=" + companyID + ")";
         DataTable dd  = DbHelperSQL.Query(sql).Tables[0];
         if (dd.Rows.Count > 0)
         {
             return(OperUtil.DataTableToJsonWithJsonNet(dd));
         }
         else
         {
             return("1");
         }
     }
     else
     {
         string    sql = "select * from asm_opera where companyID!=0";
         DataTable dd  = DbHelperSQL.Query(sql).Tables[0];
         if (dd.Rows.Count > 0)
         {
             return(OperUtil.DataTableToJsonWithJsonNet(dd));
         }
         else
         {
             return("1");
         }
     }
 }
Exemplo n.º 22
0
        /// <summary>
        /// 料道异常的时候发送短信
        /// </summary>
        /// <param name="mechineID"></param>
        public static void sendMsgWhenLDError(string mechineID, string ldNO)
        {
            string    sqlT3 = "select * from asm_mechine where id=" + mechineID;
            DataTable dt3   = DbHelperSQL.Query(sqlT3).Tables[0];

            if (dt3.Rows.Count > 0)
            {
                for (int i = 0; i < dt3.Rows.Count; i++)
                {
                    try
                    {
                        string    sql21 = "select linkphone from asm_opera where id='" + dt3.Rows[i]["operaID"].ToString() + "'";
                        string    sql22 = "select linkphone from asm_company where id='" + dt3.Rows[i]["companyID"].ToString() + "'";
                        DataTable d21   = DbHelperSQL.Query(sql21).Tables[0];
                        DataTable d22   = DbHelperSQL.Query(sql22).Tables[0];
                        if (d21.Rows.Count > 0 && d21.Rows[0]["linkphone"].ToString() != "")
                        {
                            OperUtil.sendMessage4(d21.Rows[0]["linkphone"].ToString(), dt3.Rows[0]["mechineName"].ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Substring(11, 5), ldNO);
                        }
                        if (d22.Rows.Count > 0 && d22.Rows[0]["linkphone"].ToString() != "")
                        {
                            OperUtil.sendMessage4(d22.Rows[0]["linkphone"].ToString(), dt3.Rows[0]["mechineName"].ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Substring(11, 5), ldNO);
                        }
                    }
                    catch (Exception ex)
                    {
                        OperUtil.Debuglog("cuowu=" + ex.Message, "料道异常短信_.txt");
                    }
                }
            }
        }
Exemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (OperUtil.getCooki("vshop_openID") != "0")
     {
         this._companyID.Value = OperUtil.getCooki("companyID");
         this._openID.Value    = OperUtil.getCooki("vshop_openID");
         this.memberID.Value   = Util.getMemberID();
         string    sql = "select * from asm_member where id=" + this.memberID.Value;
         DataTable dd  = DbHelperSQL.Query(sql).Tables[0];
         yue = dd.Rows[0]["AvailableMoney"].ToString();
         if (dd.Rows[0]["pwd"].ToString() == "000000")
         {
             Response.Write("<script>alert('您当前交易密码为初始密码,请前往个人中心修改!');</script>");
         }
     }
     else
     {
         this._companyID.Value = OperUtil.getCooki("companyID");
         string userAgent = Request.UserAgent;
         if (userAgent.ToLower().Contains("micromessenger"))
         {
             Response.Redirect("WXCallback.aspx?companyID=" + OperUtil.getCooki("companyID"));
             return;
         }
     }
     if (!IsPostBack)
     {
     }
 }
Exemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.companyID.Value = OperUtil.Get("companyID");
            this._operaID.Value  = OperUtil.Get("operaID");
            if (string.IsNullOrEmpty(OperUtil.Get("companyID")))
            {
                Response.Write("<script>alert('您尚未登录或已长时间未进行操作,请重新登录!');top.location.href='../../index.aspx';</script>");
                return;
            }

            string    sql = "select * from asm_protype where 1=1";
            DataTable dt  = DbHelperSQL.Query(sql).Tables[0];

            this.typeLB.DataTextField  = "typeName";
            this.typeLB.DataValueField = "productTypeID";
            this.typeLB.DataSource     = dt;
            this.typeLB.DataBind();

            string    sql1 = "select * from asm_brand where companyID=" + this.companyID.Value;
            DataTable dts  = DbHelperSQL.Query(sql1).Tables[0];

            this.brandlist.DataTextField  = "brandName";
            this.brandlist.DataValueField = "id";
            this.brandlist.DataSource     = dts;
            this.brandlist.DataBind();
        }
Exemplo n.º 25
0
        public static string getData(string mechineID, string time)
        {
            string sql = "select distinct am.time,at.temperature from asm_Mtime am left join asm_temperature at on am.time=SUBSTRING(at.time,11,6) where mechineID=" + mechineID;

            if (!string.IsNullOrEmpty(time))
            {
                sql += " and at.time like '" + time + "%'";
            }
            else
            {
                sql += " and at.time like '" + DateTime.Now.ToString("yyyy-MM-dd") + "%'";
            }
            sql += " order by am.time";
            string    timeStr = "", dataStr = "";
            DataTable da = DbHelperSQL.Query(sql).Tables[0];

            if (da.Rows.Count > 0)
            {
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    //timeStr += OperUtil.ConvertDateTimeToInt(DateTime.Parse(dt.Rows[i]["time"].ToString())) +",";
                    timeStr += "" + da.Rows[i]["time"].ToString().Trim() + ",";
                    dataStr += da.Rows[i]["temperature"].ToString() + ",";
                }
                timeStr = timeStr.Substring(0, timeStr.Length - 1);
                dataStr = dataStr.Substring(0, dataStr.Length - 1);
                string ss = OperUtil.DataTableToJsonWithJsonNet(da) + "@" + timeStr + "@" + dataStr;
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 26
0
 public static string getProductList(string typeID, string companyID)
 {
     if (typeID != "0")
     {
         string    sql = "select * from asm_product where companyID=" + companyID + " and protype=" + typeID;
         DataTable dt  = DbHelperSQL.Query(sql).Tables[0];
         if (dt.Rows.Count > 0)
         {
             string ss = OperUtil.DataTableToJsonWithJsonNet(dt);
             return(ss);
         }
         else
         {
             return("1");
         }
     }
     else
     {
         string    sql = "select * from asm_product where companyID=" + companyID;
         DataTable dt  = DbHelperSQL.Query(sql).Tables[0];
         if (dt.Rows.Count > 0)
         {
             string ss = OperUtil.DataTableToJsonWithJsonNet(dt);
             return(ss);
         }
         else
         {
             return("1");
         }
     }
 }
Exemplo n.º 27
0
        public static string search(string startTime, string endTime, string bh, string type, string companyID)
        {
            string sql = " where companyID= " + companyID;

            if (startTime != "")
            {
                sql += " and am.validateTime>'" + startTime + "'";
            }
            if (endTime != "")
            {
                sql += " and am.validateTime<'" + endTime + "'";
            }
            if (bh != "")
            {
                sql += " and am.bh='" + bh + "'";
            }
            if (type != "0")
            {
                sql += " and am.zt=" + type;
            }
            string    sql1 = "select am.*,ac.name,amt.name mechineType, case am.statu when '0' then '正常' when '1' then '脱机' when '2' then '温度异常'   else '其他' end sta,case am.zt when '1' then '禁用' when '2' then '正常' when '3' then '过期'   else '其他' end t from asm_mechine am left join asm_company ac on am.companyID=ac.id  left join asm_mechineType amt on am.version=amt.id  " + sql;
            DataTable dt   = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                string ss = OperUtil.DataTableToJsonWithJsonNet(dt);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 28
0
        public static string getOrderList(string zt, string orderNO, string pageCurrentCount)
        {
            string sql = " orderNO = '" + orderNO + "' ";

            if (zt != "0")
            {
                sql += " and zt='" + zt + "'";
            }
            string sql1 = "select *,"
                          + " (select name from asm_member where asm_member.id = asm_orderlistDetail.memberID) name ,"
                          + " (select proName from asm_product where asm_product.productID = asm_orderlistDetail.productID) pname,"
                          + " case zt when '1' then '已完成' when '2' then '已失效' when '3' then '已转售' when '4' then '待取货' when '5' then '待配送' when '6' then '已售出' when '7' then '兑换' else '' end ztName"
                          + " from asm_orderlistDetail  where  " + sql;

            int startIndex = (int.Parse(pageCurrentCount) - 1) * Config.pageSize + 1;
            int endIndex   = int.Parse(pageCurrentCount) * Config.pageSize;

            DataTable dt = Config.getPageDataTable("order by T.id ", sql1, startIndex, endIndex);
            DataTable da = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                double d  = double.Parse((da.Rows.Count / double.Parse(Config.pageSize.ToString())).ToString());
                string ss = Math.Ceiling(d) + "@" + OperUtil.DataTableToJsonWithJsonNet(dt);

                //string ss =OperUtil.DataTableToJsonWithJsonNet(da);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 29
0
        public static string getOrderList(string bh, string mechineID, string zq, string companyID, string pageCurrentCount, string zt, string keywords, string start, string end)
        {
            string sql = " 1=1 ";

            if (!string.IsNullOrEmpty(bh))
            {
                sql += "  and A.orderNO='" + bh + "'";
            }
            if (!string.IsNullOrEmpty(mechineID) && mechineID != "0")
            {
                sql += " and A.mechineID=" + mechineID;
            }
            if (!string.IsNullOrEmpty(zq) && zq != "0")
            {
                sql += " and zqNum=" + zq;
            }
            if (!string.IsNullOrEmpty(zt) && zt != "-1")
            {
                sql += " and A.orderZT=" + zt;
            }
            if (!string.IsNullOrEmpty(keywords))
            {
                sql += " and (A.phone like '%" + keywords + "%' or A.memberID='" + keywords + "')";
            }
            if (!string.IsNullOrEmpty(start))
            {
                sql += " and A.createTime>'" + start + "'";
            }
            if (!string.IsNullOrEmpty(end))
            {
                sql += " and A.createTime<'" + end + "'";
            }
            string where = string.Empty;
            if (!companyID.Equals("0"))
            {
                where = " and am.companyID=" + companyID;
            }
            string sql1 = "select A.*,b.bh,(select payType from asm_pay_info api where api.trxid=A.trxID) payType1 ,(select proName from asm_product ap where ap.productID=A.productID) proName from (select ao.*,am.name,am.phone from asm_orderlist ao left join asm_member  am on ao.memberID=am.id  where   fkzt=1 " + where + ") A left join asm_mechine B on A.mechineID=B.id where  1=1 and " + sql;

            int startIndex = (int.Parse(pageCurrentCount) - 1) * Config.pageSize + 1;
            int endIndex   = int.Parse(pageCurrentCount) * Config.pageSize;

            DataTable dt = Config.getPageDataTable("order by T.id desc", sql1, startIndex, endIndex);
            DataTable da = DbHelperSQL.Query(sql1).Tables[0];

            if (dt.Rows.Count > 0)
            {
                double d  = double.Parse((da.Rows.Count / double.Parse(Config.pageSize.ToString())).ToString());
                string ss = Math.Ceiling(d) + "@@@" + OperUtil.DataTableToJsonWithJsonNet(dt);

                //string ss =OperUtil.DataTableToJsonWithJsonNet(da);
                return(ss);
            }
            else
            {
                return("1");
            }
        }
Exemplo n.º 30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //查询该会员是否设置支付密码没有的话弹出提示框设置
                string str = Request.QueryString["req"].ToString();//trxid=111111&money=2222;
                req                   = PwdHelper.DecodeDES(str, "bingoseller");
                trxid                 = req.Split('&')[0].Split('=')[1];
                money                 = req.Split('&')[1].Split('=')[1];
                companyID             = req.Split('&')[2].Split('=')[1];
                this._money.Value     = money;
                this._trxid.Value     = trxid;
                this._companyID.Value = companyID;

                if (OperUtil.getCooki("vshop_openID") != "0")
                {
                    string    sql = "select * from asm_member where openID='" + OperUtil.getCooki("vshop_openID") + "' and companyID=" + companyID;
                    DataTable dd  = DbHelperSQL.Query(sql).Tables[0];
                    if (dd.Rows.Count <= 0)
                    {
                        //判断是否关注
                        wxHelper wx = new wxHelper(companyID);
                        if (wx.Get_UserInfo(OperUtil.getCooki("vshop_openID")).subscribe == "1")
                        {
                            Response.Redirect("WXCallback.aspx?companyID=" + this._companyID.Value);
                        }
                        else
                        {
                            //没关注
                            string    sql12 = "select * from asm_company where id=" + companyID;
                            DataTable dt    = DbHelperSQL.Query(sql12).Tables[0];
                            url = @"https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=" + dt.Rows[0]["biz"].ToString() + "#wechat_redirect";
                            Util.Debuglog("关注链接=" + url, "微信回调_.txt");
                            Response.Redirect(url);
                        }
                    }
                    else
                    {
                        //正常已经关注的
                    }
                    headURL = dd.Rows[0]["headurl"].ToString();
                    ye      = dd.Rows[0]["AvailableMoney"].ToString();
                    string sql1 = "select * from asm_company where id=" + companyID;

                    DataTable d1 = DbHelperSQL.Query(sql1).Tables[0];
                    this._openID.Value = OperUtil.getCooki("vshop_openID");
                    companyName        = d1.Rows[0]["name"].ToString();
                }
                else
                {
                    Response.Redirect("weixincallback.aspx?companyID=" + companyID + "&req=" + str);
                }
            }
            catch
            {
                Response.Write("<span style='color:#FF0000;font-size:20px'>" + "参数有误,请重试" + "</span>");
            }
        }