protected void btnFind_Click(object sender, EventArgs e) { condObj = new WEC_U_USER(); //if(txtID.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.ID, Convert.ToDecimal(txtID.Value)); //if(txtOPENID.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.OPENID, Convert.ToString(txtOPENID.Value)); //if(txtUSERNAME.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.USERNAME, Convert.ToString(txtUSERNAME.Value)); //if(txtSEX.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.SEX, Convert.ToString(txtSEX.Value)); //if(txtCOMMENT.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.COMMENT, Convert.ToString(txtCOMMENT.Value)); //if(txtADDTIME.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.ADDTIME, Convert.ToDateTime(txtADDTIME.Value)); hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new WEC_U_USER(); //if(txtID.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.ID, Convert.ToDecimal(txtID.Value)); //if(txtOPENID.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.OPENID, Convert.ToString(txtOPENID.Value)); //if(txtUSERNAME.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.USERNAME, Convert.ToString(txtUSERNAME.Value)); //if(txtSEX.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.SEX, Convert.ToString(txtSEX.Value)); //if(txtCOMMENT.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.COMMENT, Convert.ToString(txtCOMMENT.Value)); //if(txtADDTIME.Value !="" ) // condObj.Like(WEC_U_USER.Attribute.ADDTIME, Convert.ToDateTime(txtADDTIME.Value)); hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<WEC_U_USER>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <WEC_U_USER>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void btnSetPageSize_Click(object sender, EventArgs e) { aspPager.PageSize = int.Parse(txtPageSize.Value); if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<WEC_U_USER>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void btnSetPageSize_Click(object sender, EventArgs e) { aspPager.PageSize = int.Parse(txtPageSize.Value); if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <WEC_U_USER>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
/// <summary> /// 根据openid判断 WEC_U_USER是否已存在 /// </summary> /// <param name="user"></param> /// <returns></returns> public Boolean isExist(WEC_U_USER user) { WEC_U_USER conf = new WEC_U_USER(); conf.AID = wx_publiclist.AID; conf.OPENID = user.OPENID; WEC_U_USER u = BLLTable <WEC_U_USER> .GetRowData(conf); if (u != null) { return(true); } return(false); }
private void BindList(WEC_U_USER condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(WEC_U_USER.Attribute.ID, Order.Desc); } valObj.Distinct = true; #region//数据权限条件 #endregion //condObj.PID = decimal.Parse(pid); condObj.AID = Convert.ToDecimal(userBase2.Curraid); listObj = BLLTable <WEC_U_USER> .SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
/// <summary> /// 当用户发送信息或者订阅时保存用户信息 /// ygh 2014/4/24 /// </summary> /// <param name="openid"></param> /// <param name="type"></param> public void saveUser(string openid, int type, int channelid, string toUserName) { string access_token = HttpUtil.getAccessToken(this.APPID, this.APPSECRET); string user_info = HttpUtil.httpForm("", "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + access_token + "&openid=" + openid + "&lang=zh_CN", "GET"); JavaScriptSerializer jss = new JavaScriptSerializer(); Dictionary <string, object> map = (Dictionary <string, object>)jss.DeserializeObject(user_info); WEC_U_USER user = new WEC_U_USER(); WEC_PUBLICLIST conf = new WEC_PUBLICLIST(); conf.PLC_SOURCEID = toUserName; WEC_PUBLICLIST publiclist = BLLTable <WEC_PUBLICLIST> .GetRowData(new WEC_PUBLICLIST(), conf); user.AID = publiclist.AID;//用户所订阅公众号ID user.OPENID = openid; //如果公众号没有访问用户信息的借口的权限则报错,则不包含以下键值 if (map.ContainsKey("nickname")) { user.USERNAME = (string)map["nickname"]; int sex = (int)map["sex"]; if (sex == 0) { user.SEX = "未知"; } else if (sex == 1) { user.SEX = "男"; } else if (sex == 2) { user.SEX = "女"; } user.ADDTIME = GetTime(map["subscribe_time"] + ""); } if (!isExist(user)) { BLLTable <WEC_U_USER> .Insert(user, WEC_U_USER.Attribute.ID); } else { BLLTable <WEC_U_USER> .Update(user, WEC_U_USER.Attribute.ID); } saveUserMessage(openid, type, "", channelid, toUserName); }
private void BindList(WEC_U_USER condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(WEC_U_USER.Attribute.ID, Order.Desc); valObj.Distinct = true; #region//����Ȩ������ #endregion //condObj.PID = decimal.Parse(pid); condObj.AID = Convert.ToDecimal(userBase2.Curraid); listObj = BLLTable<WEC_U_USER>.SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }