public void loaddata() { //Session["open_id"] = "ozBiSt0zxI4W3ROkC4Xf0IxAC_Qg"; if (Session["userinfo"] == null) { Response.Write("<script>alert('获取不到微信信息!');window.location='index.aspx'</script>"); } else { wx_u_mod = (Maticsoft.Model.weixin_userinfo)Session["userinfo"]; } Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1(); DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); strWhere.Append("[start_time] < '"); strWhere.Append(DateTime.Today.AddDays(30).Date.ToShortDateString()); strWhere.Append("' and [end_time] > '"); strWhere.Append(DateTime.Today.AddDays(-30).Date.ToShortDateString()); strWhere.Append("'"); ds = bll.GetList(strWhere.ToString()); qishu.DataSource = ds; qishu.DataTextField = "name"; qishu.DataValueField = "id"; qishu.DataBind(); }
/// <summary> /// 主要用于判定是否有绑定微信号 /// </summary> public void loaddata() { if (Session["userinfo"] == null) { Response.Write(@"<script>alert('无法获取您的微信号,返回首页');window.location='..\m_weixin\index.aspx'</script>"); } else { Maticsoft.Model.weixin_userinfo wx_u_mod = (Maticsoft.Model.weixin_userinfo)Session["userinfo"]; mem_info.Text = "尊敬的" + wx_u_mod.remark + "(" + wx_u_mod.nickname + "),您的评价是课程不断改进的基础,请认真填写"; } }
protected void Button1_Click(object sender, EventArgs e) { skv = (Maticsoft.Model.shangke_view)Session["shangke_vie"]; string open_id = ""; string name = ""; string nickname = ""; if (Session["userinfo"] == null) { Response.Write(@"<script>alert('无法获取您的微信号,返回首页');window.location='start.aspx'</script>"); } else { Maticsoft.Model.weixin_userinfo wx_u_mod = (Maticsoft.Model.weixin_userinfo)Session["userinfo"]; open_id = wx_u_mod.openid; name = wx_u_mod.remark; nickname = wx_u_mod.nickname; int count = 0; //获取每一行的打分序号以及得分数 foreach (GridViewRow row in VoteView.Rows) { TextBox teb = (TextBox)row.FindControl("TextBox1"); Label lb = (Label)row.FindControl("id_Label"); Maticsoft.Model.dafen_jieguo dfjg_m = new Model.dafen_jieguo(); dfjg_m.shangke_id = skv.id; dfjg_m.fenzu_id = skv.fenzu_id; dfjg_m.neirong = teb.Text.ToString().Trim(); dfjg_m.dafen_xuhao = Convert.ToInt16(lb.Text); dfjg_m.time = DateTime.Now; dfjg_m.open_id = open_id; dfjg_m.name = name; dfjg_m.beizhu = nickname; Maticsoft.BLL.dafen_jieguo dfjg_b = new BLL.dafen_jieguo(); int dafen_id = dfjg_b.get_id(Convert.ToInt16(dfjg_m.shangke_id), Convert.ToInt16(dfjg_m.dafen_xuhao), dfjg_m.open_id); if (dafen_id == 0) { if (dfjg_b.Add(dfjg_m) != 0) { count++; } else { count = -10000; }; } else { dfjg_m.id = dafen_id; if (dfjg_b.Update(dfjg_m)) { count++; } else { count = -10000; }; } } if (count == 0) { Response.Write("<script>alert('提交不成功!')</script>"); } else { Session["dafen_shu"] = count; tixing.Text = count.ToString(); Response.Redirect("tongji.aspx"); //Literal1.Text = @"<script language='javascript' type='text/javascript'> window.location.href = 'tongji.aspx' ; </script> "; } } }
protected void Button2_Click(object sender, EventArgs e) { skv = (Maticsoft.Model.shangke_view)Session["shangke_vie"]; if (Session["userinfo"] == null) { Response.Write(@"<script>alert('无法获取您的微信号,返回首页');window.location='start.aspx'</script>"); } else { Maticsoft.Model.weixin_userinfo wx_u_mod = (Maticsoft.Model.weixin_userinfo)Session["userinfo"]; int count = 0; //获取每一行的打分序号以及得分数 foreach (GridViewRow row in VoteView.Rows) { RadioButtonList rbl = (RadioButtonList)row.FindControl("RadioButtonList2"); Label lb = (Label)row.FindControl("id_Label"); Maticsoft.Model.dafen_jieguo dfjg_m = new Model.dafen_jieguo(); dfjg_m.shangke_id = skv.id; dfjg_m.fenzu_id = skv.fenzu_id; dfjg_m.fenshu = Convert.ToInt16(rbl.SelectedValue.ToString()); dfjg_m.dafen_xuhao = Convert.ToInt16(lb.Text); dfjg_m.time = DateTime.Now; dfjg_m.open_id = wx_u_mod.openid; dfjg_m.name = wx_u_mod.remark; dfjg_m.beizhu = wx_u_mod.nickname; Maticsoft.BLL.dafen_jieguo dfjg_b = new BLL.dafen_jieguo(); int dafen_id = dfjg_b.get_id(Convert.ToInt16(dfjg_m.shangke_id), Convert.ToInt16(dfjg_m.dafen_xuhao), dfjg_m.open_id); if (dafen_id == 0) { if (dfjg_b.Add(dfjg_m) != 0) { count++; } else { count = -10000; }; } else { dfjg_m.id = dafen_id; if (dfjg_b.Update(dfjg_m)) { count++; } else { count = -10000; }; } } if (count == 0) { Response.Write("<script>alert('提交不成功!')</script>"); } else { Session["dafen_shu"] = count; tixing.Text = "共提交" + count + "行数据"; tixing.CssClass = "alert"; Response.Redirect("pingjia.aspx?style=1"); //Literal1.Text = @"<script language='javascript' type='text/javascript'> window.location.href = 'pingjia.aspx' ; </script> "; } } }
public void loaddata1() { if (Session["userinfo"] == null) { code = Request.QueryString["code"]; if (string.IsNullOrEmpty(code)) { Response.Write("<script>alert('请从微信端登陆系统!')</script>"); } else { Response.Write("<script>alert('感谢您进入温氏学院系统!')</script>"); Maticsoft.BLL.weixin wx_bll = new BLL.weixin(); Maticsoft.Model.access_web_token awt_mod = new Model.access_web_token(); awt_mod = wx_bll.get_web_accesstoken(code)[0]; if (awt_mod == null || string.IsNullOrEmpty(awt_mod.openid)) { Response.Write("<script>alert('无法获取你的识别号!')</script>"); } else { string opend_id = awt_mod.openid; string accesstonken = awt_mod.access_token; Maticsoft.Model.weixin_userinfo wx_u_mod = wx_bll.get_userinfo(opend_id, accesstonken)[0]; if (wx_u_mod == null) { Response.Write("<script>alert('无法获取你的微信信息!')</script>"); } else { openid.Text = "您好," + wx_u_mod.remark + "(" + wx_u_mod.nickname + "),欢迎进入温氏学院测试系统"; touxiang.ImageUrl = wx_u_mod.headimgurl; Session["userinfo"] = wx_u_mod; //if(string.IsNullOrEmpty(wx_u_mod.remark)) //{ // Response.Write("<script>alert('请录入个人信息');window.location='mem_info_fill.aspx'</script>"); //} } } } } else { Maticsoft.Model.weixin_userinfo wx_u_mod = (Maticsoft.Model.weixin_userinfo)Session["userinfo"]; Maticsoft.BLL.member mem_bll = new BLL.member(); wx_u_mod.remark = mem_bll.get_name(wx_u_mod.openid); openid.Text = "您好," + wx_u_mod.remark + "(" + wx_u_mod.nickname + "),欢迎进入温氏学院测试系统"; touxiang.ImageUrl = wx_u_mod.headimgurl; Session["userinfo"] = wx_u_mod; } // code = Request.QueryString["code"]; // //WebClient requestClinet1 = new WebClient(); // //string jsonArray1 = requestClinet1.DownloadString("https://api.weixin.qq.com/sns/oauth2/access_token?appid=zheshiyigejiadeid&secret=zhendemimazaibendibaocun&code=" + code + "&grant_type=authorization_code"); // Maticsoft.BLL.weixin wx_bll = new BLL.weixin(); // Maticsoft.Model.access_web_token awt_mod = new Model.access_web_token(); // awt_mod = wx_bll.get_web_accesstoken(code)[0]; //string opend_id= awt_mod.openid; // string accesstonken=awt_mod.access_token; //Literal1.Text = code + "色打发士大夫大师傅个" +opend_id+"士大夫士大夫" +accesstonken; //Maticsoft.Model.weixin_userinfo wx_u_mod = wx_bll.get_userinfo(opend_id, accesstonken)[0]; //openid.Text = wx_u_mod.nickname; //touxiang.ImageUrl = wx_u_mod.headimgurl; }