Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["formno"] != null)
        {
            _formno = Request.QueryString["formno"].ToString();
        }
        if (Request.QueryString["stepid"] != null)
        {
            _stepid = Request.QueryString["stepid"].ToString();
        }

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";

            formno.Text = _formno; stepid.Text = _stepid;

            if (_formno != "")
            {
                init_data(_formno, _stepid);
            }
        }
    }
Пример #2
0
    public string uri;           //url

    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";

            bind_pgino();
            bind_source("");

            timestamp = DateTime.Now.Ticks.ToString().Substring(0, 10);
            noncestr  = new Random().Next(10000).ToString();
            uri       = Request.Url.ToString().Replace("#", "").Replace(WeiXin.Port, ""); //本地地址
            string entAccessTicket = WeiXin.GetEntAccessToken();                          //企业AccessTicket
            ent_ticket    = WeiXin.GetEntJsapi_Ticket(entAccessTicket);
            ent_signature = WeiXin.GetSignature(ent_ticket, noncestr, timestamp, uri);    //企业签名
        }
    }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         wxuserid.Text = WeiXin.GetCookie("userid");
     }
 }
Пример #4
0
        protected void btnGroup_Click(object sender, EventArgs e)
        {
            //创建分组
            var ginfo = WeiXin.CreateGroup("groupName", access_token);
            //ginfo.error 一如既往的判断error

            //修改分组
            var retcode = WeiXin.UpdateGroup(23, "newGroupName", access_token);
            //移动分组
            int newGroupid = 1;

            retcode = WeiXin.MoveGroup("openid", newGroupid, access_token);


            //得到所有分组
            var groups = WeiXin.GetGroups(access_token);

            //循环分组
            foreach (var g in groups)
            {
                //g.name
            }

            //得到openid的分组
            var gid = WeiXin.GetUserGroup("openid", access_token);
            //gid.error 一如既往的判断error
        }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString(); // "四车间";
        _dh       = Request.QueryString["dh"].ToString();       //"W1497589";


        dt_append = new DataTable();
        dt_append.Columns.Add("zyb");
        dt_append.Columns.Add("lot_no");
        dt_append.Columns.Add("act_qty");
        dt_append.Columns.Add("cl");
        dt_append.Columns.Add("yzj_no");
        dt_append.Columns.Add("zyb_lot");
        dt_append.Columns.Add("idno");



        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            txt_emp.Text = lu.WorkCode;
            txt_dh.Text  = _dh;
            ShowValue(txt_emp.Text);
        }
    }
Пример #6
0
    protected void btnStart_Click(object sender, EventArgs e)
    {
        MES.Model.MES_SB_WX m = new MES.Model.MES_SB_WX();
        string wx_dh          = Request["dh"];

        //txtHidden.Value = wx_dh;
        m.wx_dh         = wx_dh;
        m.wx_begin_date = DateTime.Now;
        m.wx_banbie     = "";                           //txtBanBie.Value;
        m.wx_banzhu     = "";                           //txtBanZu.Value;
        m.wx_gonghao    = WeiXin.GetCookie("workcode"); //dropWXGongHao.SelectedValue;
        m.wx_name       = ((LoginUser)WeiXin.GetJsonCookie()).UserName;
        m.p_status      = "维修中";
        MES.DAL.MES_SB_WX dal = new MES.DAL.MES_SB_WX();
        try
        {
            if (DbHelperSQL.GetSingle("select count(1) from MES.[dbo].[MES_SB_wx] where wx_dh='" + wx_dh + "'").ToString() == "0")
            {
                int result = dal.Add(m);//因经常出现资料未插入事件
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"alert('接修成功.');self.location='BXMonitor.aspx';  ", true);
            }
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"layer.alert('失败,请重试.[ex:" + ex.Message + "]'); ", true);
        }
        finally { }
    }
Пример #7
0
 public static string GetScanQRCode(string url)
 {
     try
     {
         url = url.Replace(":63780", "").Replace(":8010", "");
         //生成tokcen
         string tocken = WeiXin.GetEntAccessToken();
         //JObject TokenJO = (JObject)JsonConvert.DeserializeObject(tocken);
         //验证签名
         //string Jsapi_Ticket = WeiXin.GetEntJsapi_Ticket(tocken);//TokenJO["access_token"].ToString()
         //JObject Jsapi_TicketJo = (JObject)JsonConvert.DeserializeObject(Jsapi_Ticket);
         #region
         string rtn           = "";
         string jsapi_ticket  = WeiXin.GetEntJsapi_Ticket(tocken);;//Jsapi_TicketJo["ticket"].ToString();
         string noncestr      = CreatenNonce_str();
         long   timestamp     = CreatenTimestamp();
         string outstring     = "";
         string JS_SDK_Result = WeiXin.GetSignature(jsapi_ticket, noncestr, timestamp.ToString(), url);
         //拼接json串返回前台
         rtn = "{\"appid\":\"" + ConfigurationManager.AppSettings["wxqy_CorpID"] + "\",\"jsapi_ticket\":\"" + jsapi_ticket + "\",\"noncestr\":\"" + noncestr + "\",\"timestamp\":\"" + timestamp + "\",\"outstring\":\"" + outstring + "\",\"signature\":\"" + JS_SDK_Result.ToLower() + "\"}";
         #endregion
         return(rtn);
     }
     catch (Exception ex)
     {
         return(string.Empty);
     }
 }
Пример #8
0
        protected void btnCreateMenu_Click(object sender, EventArgs e)
        {
            var json = File.ReadAllText(Server.MapPath("~/WeiXinMenu.js"));
            var ret  = WeiXin.CreateMenu(json, access_token);

            Response.Write(ret.ToString());
        }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _lotno = Request.QueryString["lotno"].ToString();
        _para  = Request.QueryString["para"].ToString();
        if (Request.QueryString["workshop"] != null)
        {
            _workshop = Request.QueryString["workshop"].ToString();
        }
        if (Request.QueryString["needno"] != null)
        {
            _needno = Request.QueryString["needno"].ToString();
        }

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();

        _emp = lu.WorkCode + lu.UserName;
        //_emp = "02432何桂勤";

        GetData(_lotno, lu.WorkCode);
    }
Пример #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        _workorder   = Request.QueryString["workorder"].ToString();
        _workorder_f = Request.QueryString["workorder_f"].ToString();

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;
            //emp_code_name.Text = "02432何桂勤";
            //domain.Text = "200";

            workorder.Text = _workorder; workorder_f.Text = _workorder_f;
            init_data(_workorder, _workorder_f);
        }
    }
Пример #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString(); // "四车间";
        _dh       = Request.QueryString["dh"].ToString();       //"W1497589";


        dt_append = new DataTable();
        dt_append.Columns.Add("sku");
        dt_append.Columns.Add("lot_no");
        dt_append.Columns.Add("need_off_qty");
        dt_append.Columns.Add("need_no");
        dt_append.Columns.Add("idno");
        dt_append.Columns.Add("ps_qty_per");



        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            ViewState["STEPVALUE"] = "";
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            txt_emp.Text = lu.WorkCode;
            txt_dh.Text  = _dh;
            ShowValue(txt_emp.Text);
        }
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["workshop"] != null)
        {
            _workshop = Request.QueryString["workshop"].ToString();
        }
        if (Request.QueryString["dh"] != null)
        {
            _dh = Request.QueryString["dh"].ToString();
        }
        if (Request.QueryString["ck"] != null)
        {
            _ck = Request.QueryString["ck"].ToString();
        }

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";
        }
        GetData();
    }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        WeiXin.delCookies("userid");
        WeiXin.delCookies("workcode");
        WeiXin.delCookies("usermodel");

        Response.Write("ok");
    }
Пример #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (WeiXin.GetCookie("workcode") == null)
     {
         Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
         return;
     }
     GetData();
 }
Пример #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*
         * string year = DateTime.Now.Year.ToString();
         * string month = DateTime.Now.Month.ToString();
         * string day = DateTime.Now.Day.ToString();
         *
         * string dn = "白班";
         * DateTime t1 = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
         * DateTime t2 = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd") + " 07:00:00");
         * DateTime t3 = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd") + " 19:00:00");
         *
         * if (DateTime.Compare(t1, t2) >= 0 && DateTime.Compare(t1, t3) <= 0)
         * {
         *  dn = "白班";
         * }
         * else
         * {
         *  dn = "夜班";
         * }
         *
         * file = Server.MapPath(@"/file/" + year + @"/" + month + @"月/" + month + "-" + day + dn + @"/");
         */
        file = Server.MapPath(@"/file/");

        if (Request.QueryString["id"] != null)
        {
            _id = Request.QueryString["id"].ToString();
        }
        if (Request.QueryString["dh"] != null)
        {
            _dh = Request.QueryString["dh"].ToString();
        }                                                                                     //扫码进来的

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }
        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;
            //emp_code_name.Text = "02432何桂勤";
            domain.Text = "200";

            txt_dh.Text = _dh;

            id.Text = _id;
            if (_id != "" || _dh != "")
            {
                init_data(_id, _dh, connString);
            }
        }
    }
Пример #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bind_data();

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
        }
    }
Пример #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();
        bind_data();

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
        }
    }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }


        TraceByDH(Request.QueryString["dh"].ToString());
    }
Пример #19
0
        protected void btnGetUser_Click(object sender, EventArgs e)
        {
            //获取关注者列表
            var list = WeiXin.GetAllFollowers(access_token);

            //循环关注者
            foreach (var openid in list.data.openid)
            {
                //得到用户信息
                var userinfo = WeiXin.GetUserInfo(openid, LangType.zh_CN, access_token);
            }
        }
Пример #20
0
 protected void ResetCookie()
 {
     if (WeiXin.GetCookie("cookiedate") != "")
     {
         var date = Convert.ToDateTime(WeiXin.GetCookie("cookiedate"));
         if (date.AddDays(1) < DateTime.Now)
         {
             WeiXin.delCookies("userid");
             WeiXin.delCookies("workcode");
             WeiXin.delCookies("usermodel");
         }
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            if (string.IsNullOrEmpty(context.Request.QueryString["echostr"]))
            {
                context.Response.End();
            }

            #region --------验证URL

            WXBizMsgCrypt wxcpt            = new WXBizMsgCrypt(WXToken, sEncodingAESKey, sCorpID);
            string        sVerifyMsgSig    = HttpUtility.UrlDecode(context.Request.QueryString["msg_signature"].ToString());
            string        sVerifyTimeStamp = HttpUtility.UrlDecode(context.Request.QueryString["timestamp"].ToString());
            string        sVerifyNonce     = HttpUtility.UrlDecode(context.Request.QueryString["nonce"].ToString());
            string        sVerifyEchoStr   = HttpUtility.UrlDecode(context.Request.QueryString["echostr"].ToString());
            int           ret      = 0;
            string        sEchoStr = "";
            ret = wxcpt.VerifyURL(sVerifyMsgSig, sVerifyTimeStamp, sVerifyNonce, sVerifyEchoStr, ref sEchoStr);
            Log.WriteLog("\n" + sEchoStr);
            if (ret != 0)
            {
                Log.WriteLog("ERR: VerifyURL fail, ret: " + ret);
                return;
            }
            else
            {
                context.Response.Write(sEchoStr);
                context.Response.End();
            }
            //return;
            #endregion

            if (WeiXin.CheckSignature(sVerifyMsgSig, sVerifyTimeStamp, sVerifyNonce, WXToken))
            {
                try
                {
                    var replyMsg = WeiXin.ReplyMsg().GetXML();
                    //这里可以记录日志
                    Log.WriteLog(replyMsg);
                    context.Response.Write(replyMsg);
                }
                catch (Exception exp)
                {
                    //记录异常
                    Log.WriteLog("error");
                }
            }
            else
            {
                context.Response.Write("");
            }
        }
Пример #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        //if (!IsPostBack)
        //{
        GetData();
        //}
    }
Пример #23
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            WeiXin weixin   = new WeiXin();
            string savePath = BP.Sys.SystemConfig.PathOfDataUser + "UserIcon";
            bool   result   = weixin.DownLoadUserIcon(savePath);

            if (result == true)
            {
                return("执行成功...");
            }
            else
            {
                return("执行失败...");
            }
        }
Пример #24
0
        protected void btnCreaeQR_Click(object sender, EventArgs e)
        {
            var isTemp = true;//是临时的,还是永久的

            var ticket = WeiXin.CreateQRCode(isTemp, int.Parse(tbQR.Text), access_token);

            if (ticket.error == null)
            {
                //出错了,请查看error
            }
            else
            {
                imgQR.ImageUrl = WeiXin.GetQRUrl(ticket.ticket);
            }
        }
Пример #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();

        GetData(lu.WorkCode);
        //GetData("02432");
    }
Пример #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (WeiXin.GetCookie("workcode") == null)
     {
         Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
         return;
     }
     if (!IsPostBack)
     {
         LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
         txt_empname.Value = lu.WorkCode + lu.UserName;
         // txt_empname.Value = "01744孙娟";
         bind_sb();
     }
 }
Пример #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;

            //登入岗位的域
            string strsql_d    = "select * from [Mes_App_EmployeeLogin] with(readpast) where emp_code='" + lu.WorkCode + "' and on_date is not null and off_date is null";
            var    value_login = SQLHelper.reDs(strsql_d).Tables[0];
            if (value_login != null && value_login.Rows.Count > 0)
            {
                if (domain.Text == "100" || domain.Text == "")
                {
                    domain.Text = value_login.Rows[0]["domain"].ToString();
                }
            }

            lbl_emp.Text = lu.Telephone + lu.UserName;
            if (string.IsNullOrEmpty(lu.Telephone)) //增加手机号的获取,因为cookIE里的手机号有可能会是空值
            {
                string strsql     = "select * from [172.16.5.26].[Production].[dbo].[Hrm_Emp] with(nolock) where employeeid = '" + lu.WorkCode + "'";
                var    value_rout = SQLHelper.reDs(strsql).Tables[0];
                if (value_rout != null && value_rout.Rows.Count > 0)
                {
                    lbl_emp.Text = value_rout.Rows[0]["tel"].ToString() + lu.UserName;
                }
            }


            //emp_code_name.Text = "02432何桂勤";
            //domain.Text = "200";
            //lbl_emp.Text = "15850349106何桂勤";

            //绑定岗位
            ShowValue(lu.WorkCode);
            //ShowValue("02432");
        }
    }
Пример #28
0
    //已完成确认
    public void BindWanChengmy(string strWhere = "")
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("select     bx_date, bx_banbie, bx_gonghao, bx_name, bx_banzhu, bx_dh, bx_moju_no, bx_moju_type, bx_part, bx_mo_no, bx_gz_type, bx_gz_desc, bx_sbno, bx_sbname, status,level,b.cellphone,moju_repair ");
        //strSql.Append(" ,cast(datediff(mi,bx_date,getdate())/60 as varchar)+'小时 '+right('00'+cast(datediff(mi,bx_date,getdate())%60  as varchar),2)+' 分' bx_shichang ");
        strSql.Append(" ,cast(cast(datediff(ss, bx_date, qr_date) / 3600 as int) as varchar)+':'+right('00' + cast(cast(datediff(ss, bx_date, qr_date) % 3600 / 60 as int) as varchar), 2) bx_shichang ");
        //strSql.Append(" ,(select top 1 product_leibie from form3_Sale_Product_MainTable where pgino =(select left(xmh,5)  from [172.16.5.6].report.dbo.MoJu  where mojuno= bx_moju_no) ) as pd_type ");
        strSql.Append(" FROM mes.dbo.MES_SB_BX a join mes.dbo.MES_SB_QR c on a.bx_dh=c.dh  join mes.dbo.mes_sb_wx d on a.bx_dh=d.wx_dh  join [172.16.5.6].[eHR_DB].dbo.view_hr_emp b on b.employeeid=a.bx_gonghao  where  dateadd(hh,24,qr_date )>getdate() ");
        strSql.Append("    and status = '确认完成'  and ( bx_gonghao='" + WeiXin.GetCookie("workcode") + "' or wx_gonghao='" + WeiXin.GetCookie("workcode") + "' or c.qr_gh='" + WeiXin.GetCookie("workcode") + "' )   order by a.id asc");

        DataSet ds = DbHelperSQL.Query(strSql.ToString());

        listWCmy.DataSource = ds;
        listWCmy.DataBind();
    }
Пример #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _workshop = Request.QueryString["workshop"].ToString();
     if (WeiXin.GetCookie("workcode") == null)
     {
         Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
         return;
     }
     //调整中
     BindData1();
     //检测中
     BindData2();
     //检测结果待确认
     BindData3();
     //换夹完成(30天内)
     BindData4();
 }
Пример #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }
        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;

            //emp_code_name.Text = "02432何桂勤";
            domain.Text = "200";
        }
    }