/// <summary> /// 微信小程序获取信息 /// </summary> /// <param name="dicPar"></param> public void GetMember(Dictionary <string, object> dicPar) { ///要检测的参数信息 List <string> pra = new List <string>() { "openid", "mobile" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } var openid = dicPar["openid"].ToString(); var mobile = dicPar["mobile"].ToString(); if (string.IsNullOrEmpty(mobile)) { ReturnResultJson("2", "手机号为空,请在微信中绑定手机号"); return; } if (openid == "undefined") { ReturnResultJson("2", "网络繁忙,请稍后再试"); return; } bllmembers bllmembers = new bllmembers(); membersEntity member = bllmembers.GetEntitySigInfo(" where wxaccount='" + openid + "'"); if (!string.IsNullOrWhiteSpace(member.memid))//已注册过会员 { ReturnJsonStr(JsonHelper.ObjectToJSON(member)); } else//未注册过会员 { bllmembers.Add("", "", "", "", openid, mobile, "", "1"); member = bllmembers.GetEntitySigInfo(" where wxaccount='" + openid + "'"); ReturnJsonStr(JsonHelper.ObjectToJSON(member)); } }
/// <summary> /// 设置页面信息 /// </summary> /// <param name="id">ID</param> private void SetPage(string id, string from) { string filter = " where memcode='" + id + "'"; membersEntity entity = bll.GetEntitySigInfo(filter); if (entity != null) { hidId.Value = entity.memid; url = "MemberCardShow.aspx?id=" + hidId.Value; memcode = hidId.Value; txt_wxaccount.Text = entity.wxaccount; txt_mobile.Text = entity.mobile; //txt_email.Text = entity txt_tel.Text = entity.mobile; ddl_provinceid_SelectedIndexChanged(null, null); ddl_cityid_SelectedIndexChanged(null, null); txt_remark.Text = entity.remark; } }
/// <summary> /// ToolBar所有按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ToolBar1_Click(object sender, ToolBarEventArgs e) { DataTable dt = new DataTable(); if (e != null) { string Selected = string.Empty; switch (((ToolBarEventArgs)(e)).btntype.ToLower()) { //搜索事件代码 case "search": GotoSearch(); break; //刷新事件代码 case "refresh": BindGridView(); break; case "delete": { //日志信息 Selected = GetSelectStr(gv_list); if (Selected.Length == 0) { sp_showmes.InnerText = "请至少选择一项"; return; } string[] coldelist = Selected.Split(','); if (coldelist.Length > 1) { sp_showmes.InnerText = "一次只能删除一条数据"; return; } bll.Delete("0", "0", coldelist[0]); sp_showmes.InnerText = bll.oResult.Msg; anp_top.CurrentPageIndex = 1; } break; //有效 case "active": Selected = GetSelectStr(gv_list, true); if (Selected.Length == 0) { sp_showmes.InnerText = "请至少选择一项"; } else { bll.UpdateStatus("", "0", Selected, "1"); if (ShowResult(bll.oResult.Code, bll.oResult.Msg, sp_showmes)) { BindGridView(); } } break; //无效 case "invalid": Selected = GetSelectStr(gv_list, true); if (Selected.Length == 0) { sp_showmes.InnerText = "请选择要操作记录!"; } else { bll.UpdateStatus("", "0", Selected, "0"); if (ShowResult(bll.oResult.Code, bll.oResult.Msg, sp_showmes)) { BindGridView(); } } break; case "memeditphone": Selected = GetSelectStr(gv_list, true); if (Selected.Length == 0) { sp_showmes.InnerText = "请选择要操作记录!"; } else { var dto = bll.GetEntitySigInfo(string.Format("memcode ={0}", Selected)); Script(this.Page, "ShowOpenpage('修改手机号', '/memberCard/membersPhoneEdit.aspx?id=" + dto.memcode + "', '100%', '100%', true, true);"); } break; //导出事件代码 case "export": int recount; int pagenums; string order = string.Format("{0} {1}", HidSortExpression.Value, HidOrder.Value); dt = bll.GetPagingInfoByList("", "0", 50000, 1, HidWhere.Value, order, out recount, out pagenums); string fileName = "会员信息.xls"; string strColumnName = "编号,姓名,性别,电话,证件类型,证件号码,状态"; string ColumnCode = "memcode,cname,sexname,mobile,idtypeName,IDNO,statusname"; ExcelsHelp.ExportExcelFileB(dt, System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8), strColumnName.Split(','), ColumnCode.Split(',')); break; } } }