/// <summary> /// 用户关注 /// </summary> /// <param name="loggingSesssionInfo"></param> /// <returns></returns> public string SetSignIn(LoggingSessionInfo loggingSesssionInfo) { //关注:openID,城市,性别,昵称 string content = string.Empty; #region 参数 string OpenID = Request["openID"].ToString().Trim(); string City = Request["city"].ToString().Trim(); string Gender = Request["gender"].ToString().Trim(); string VipName = Request["vipName"].ToString().Trim(); string IsShow = Request["isShow"].ToString().Trim(); #endregion #region 1.处理日志 VipShowLogEntity vipShowLogInfo = new VipShowLogEntity(); vipShowLogInfo.VipLogID = System.Guid.NewGuid().ToString().Replace("-", ""); vipShowLogInfo.OpenID = OpenID; vipShowLogInfo.City = City; vipShowLogInfo.IsShow = Convert.ToInt32(IsShow); VipShowLogBLL vipShowLogBll = new VipShowLogBLL(loggingSesssionInfo); vipShowLogBll.Create(vipShowLogInfo); #endregion #region 2.判断是新建还是修改 VipEntity vipInfo = new VipEntity(); #endregion return(content); }
public void StoreRebateRepeaterMessage(VipEntity vipEntity, string content) { BaseService.WriteLogWeixin(content); //发送消息 JIT.CPOS.BS.BLL.WX.CommonBLL.SendWeixinMessage("对不起,该返利码已经被领取", "1", requestParams.LoggingSessionInfo, vipEntity); }
private VipEntity Convert(VipContract contract) { var dbEntity = new VipEntity { VIPID = contract.VipId, VipName = contract.VipName, VipCode = contract.VipCode, CreateTime = contract.CreateTime, LastUpdateTime = contract.ModifyTime, VipLevel = 1,//contract.VipLevel, Phone = contract.Phone, IDType = contract.IdType, IDNumber = contract.IdNumber, Birthday = contract.Birthday != null?contract.Birthday.Value.ToString("yyyy-MM-dd") : null, Gender = contract.Gender == 0 ? 2 : 1, Email = contract.Email, ClientID = ConfigMgr.CustomerId, WeiXinUserId = contract.OpenID, //新增会员id IsDelete = 0, WeiXin = string.IsNullOrEmpty(contract.OpenID) ? "" : ConfigMgr.WeiXinID //微信标识 , Status = 2, VipRealName = contract.VipName, CouponInfo = ConfigMgr.HeadUnitId }; return(dbEntity); }
/// <summary> /// 修改用户 /// </summary> public bool EditUser(VipEntity user) { StringBuilder strSql = new StringBuilder(); strSql.Append("update tbvip set "); strSql.Append("vip_AN=@AccountName,vip_mp=@MobilePhone,vip_email=@Email,status_id=@StatusID,agent_id=@RoleID"); strSql.Append(" where id=@Id"); SqlParameter[] paras = { new SqlParameter("@UserAcountName", user.VipAccountName), new SqlParameter("@UserMobliePhone", user.VipMobliePhone), new SqlParameter("@Email", user.VipEmail), new SqlParameter("@StatusID", user.StatusID), new SqlParameter("@RoleID", user.AgentAccountName), new SqlParameter("@Id", user.VipID), }; object obj = SqlHelper.ExecuteNonQuery(SqlHelper.connStr, CommandType.Text, strSql.ToString(), paras); if (Convert.ToInt32(obj) > 0) { return(true); } else { return(false); } }
/// <summary> /// 获取近期关注的会员 /// </summary> /// <param name="Weixin"></param> /// <param name="TimeLength"></param> /// <returns></returns> public IList <VipShowLogEntity> GetRecentfollowers(string Weixin, string TimeLength) { IList <VipShowLogEntity> vipShowLogInfoList = new List <VipShowLogEntity>(); DataSet ds = new DataSet(); ds = _currentDAO.GetRecentfollowers(Weixin, TimeLength); if (ds != null && ds.Tables[0].Rows.Count > 0) { vipShowLogInfoList = DataTableToObject.ConvertToList <VipShowLogEntity>(ds.Tables[0]); if (vipShowLogInfoList != null && vipShowLogInfoList.Count > 0) { VipBLL vipService = new VipBLL(this.CurrentUserInfo); foreach (var info in vipShowLogInfoList) { if (info.VipCode == null || info.VipCode.Equals("")) { VipEntity vipInfo = new VipEntity(); vipInfo.VipCode = vipService.GetVipCode(); info.VipCode = vipInfo.VipCode; vipInfo.VIPID = info.VIPID; vipService.Update(vipInfo, false); } } } } return(vipShowLogInfoList); }
/// <summary> /// 查询 /// </summary> public string GetUnitRewardData() { string error = string.Empty; var service = new VipBLL(CurrentUserInfo); VipEntity listObj = null; string content = string.Empty; VipEntity queryEntity = new VipEntity(); queryEntity.Page = Utils.GetIntVal(Request("page")); queryEntity.PageSize = PageSize; //queryEntity.VipInfo = FormatParamValue(form.VipInfo); queryEntity.UnitId = FormatParamValue(Request("UnitId")); queryEntity.IntegralSourceIds = FormatParamValue(Request("IntegralSourceIds")); queryEntity.BeginDate = FormatParamValue(Request("BeginDate")); queryEntity.EndDate = FormatParamValue(Request("EndDate")); if (queryEntity.IntegralSourceIds.StartsWith(",")) { queryEntity.IntegralSourceIds = queryEntity.IntegralSourceIds.Substring(1); } listObj = service.GetUnitIntegral(queryEntity, out error); var jsonData = new JsonData(); jsonData.totalCount = listObj.ICount.ToString(); jsonData.data = listObj.vipInfoList; content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}", jsonData.data.ToJSON(), jsonData.totalCount); return(content); }
/// <summary> /// 更新会员信息 /// </summary> /// <returns></returns> public string UpdateUserInfo() { string content = string.Empty; var respData = new ambassadorLoginInRespData(); try { //接收参数 string reqContent = HttpContext.Current.Request["ReqContent"]; var reqObj = reqContent.DeserializeJSONTo <ambassadorLoginInReqData>(); reqObj = reqObj == null ? new ambassadorLoginInReqData() : reqObj; //获取客户ID if (!string.IsNullOrEmpty(reqObj.common.customerId)) { customerId = reqObj.common.customerId; } //初始化返回对象 respData.content = new ambassadorLoginInRespContentData(); respData.content.vipList = new List <ambassadorLoginInRespContentDataItem>(); //用户登录信息 var loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); VipBLL vipBLL = new VipBLL(loggingSessionInfo); VipEntity entity = new VipEntity(); //是否有此人 var vip = vipBLL.Query(new IWhereCondition[] { new EqualsCondition() { FieldName = "VipID", Value = reqObj.special.vipID }, new EqualsCondition() { FieldName = "ClientID", Value = customerId } }, null).FirstOrDefault(); if (vip != null) { entity = vipBLL.GetByID(vip.VIPID); entity.Col16 = reqObj.special.remark; entity.LastUpdateTime = DateTime.Now; vipBLL.Update(entity); } respData.code = "200"; respData.description = "操作成功"; } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); } content = respData.ToJSON(); return(content); }
internal void Delete(VipEntity dbEntity) { using (var conn = new SqlConnection(ConnectionString.XgxInsert)) { conn.Open(); conn.Delete(dbEntity); } }
/// <summary> /// 设置用户token信息 /// </summary> /// <param name="UserId">用户标识</param> /// <param name="AccessToken">token不存在</param> private void SetAccessToken(string UserId, string AccessToken, LoggingSessionInfo loggingSessionInfo, string resultErrorUrl) { try { if (UserId == null || UserId.Trim().Equals("")) { Loggers.Debug(new DebugLogInfo() { Message = string.Format("新浪回调页面2-用户标识为空") }); } Response.Write("设置用户token信息1"); #region 处理业务 #region 判断用户是否存在会员表中 VipBLL vipServer = new VipBLL(loggingSessionInfo); VipEntity vipInfo = vipServer.GetByID(UserId); if (vipInfo == null || vipInfo.VIPID == null || vipInfo.VIPID.Equals("")) { vipInfo.VIPID = UserId; vipInfo.VipCode = vipServer.GetVipCode(); vipInfo.ClientID = loggingSessionInfo.CurrentUser.customer_id; vipInfo.Status = 1; vipServer.Create(vipInfo); } #endregion #region 判断用户是否存在会员的新浪微博扩展表中 VipExpandSinaWbBLL vipSinaWbServer = new VipExpandSinaWbBLL(loggingSessionInfo); VipExpandSinaWbEntity vipSinaWbInfo = new VipExpandSinaWbEntity(); vipSinaWbInfo = vipSinaWbServer.GetByID(UserId); if (vipSinaWbInfo != null && vipSinaWbInfo.VipId != null && !vipSinaWbInfo.VipId.Equals("")) { vipSinaWbInfo.AccessToken = AccessToken; vipSinaWbServer.Update(vipSinaWbInfo, false); } else { VipExpandSinaWbEntity vipSinaWbInfo1 = new VipExpandSinaWbEntity(); vipSinaWbInfo1.VipId = UserId; vipSinaWbInfo1.AccessToken = AccessToken; vipSinaWbServer.Create(vipSinaWbInfo1); } #endregion #endregion Loggers.Debug(new DebugLogInfo() { Message = string.Format("新浪回调页面3-设置用户信息成功.") }); } catch (Exception ex) { Loggers.Debug(new DebugLogInfo() { Message = string.Format("新浪回调页面4-错误信息提示 {0}:" + ex.ToString()) }); Response.Write(ex.ToString()); } }
private void SetLegalizeInfo(string OpenId, string amount) { #region 链接客户参数 var loggingSessionInfo = Default.GetLoggingSession(); //根据客户标识获取连接字符串 qianzhi 2013-07-30 if (Request["customerId"].Equals("null") || Request["customerId"].ToString().Equals("")) { Loggers.Debug(new DebugLogInfo() { Message = string.Format("认证界面customerId: {0}", "没有接收到客户信息") }); strText = "<div style=\"position:absolute; left:50px; top:70px; line-height:30px; z-index:2; font-size:18px; font-weight:bold; color:#697d7d\">没有接收到客户信息</div>"; return; } if (!string.IsNullOrEmpty(Request["customerId"])) { loggingSessionInfo = Default.GetBSLoggingSession(Request["customerId"].Trim(), ""); } Loggers.Debug(new DebugLogInfo() { Message = string.Format("认证界面loggingSessionInfo: {0}", loggingSessionInfo.ToJSON()) }); #endregion WLegalizeBLL server = new WLegalizeBLL(loggingSessionInfo); string strError = string.Empty; string strNo = string.Empty; VipEntity vipInfo = new VipEntity(); vipInfo = server.SetVipLegalize(OpenId, loggingSessionInfo.CurrentUser.customer_id.ToString(), amount, out strError); string str = "<div style=\"position:absolute; left:50px; top:70px; line-height:30px; z-index:2; font-size:18px; font-weight:bold; color:#697d7d\">"; if (strError.Equals("OK")) { //vipInfo.Integration // 某某某,您的本次积分为****,累积积分为**** int theIntegral = CPOS.Common.Utils.GetParseInt(amount); if (vipInfo.Integration == null) { vipInfo.Integration = theIntegral; } else { vipInfo.Integration = vipInfo.Integration + theIntegral; } str += "" + vipInfo.VipName + "<br>您的本次积分为" + theIntegral.ToString() + "<br>累积积分为" + Convert.ToString(CPOS.Common.Utils.GetParseInt((vipInfo.Integration))) + ""; str += "<br>"; str += "请向门店工作人员展示:"; str += "<br>"; str += "流水号 :" + vipInfo.SerialNumber + ""; } else { //Response.Write("提示 : " + strError + ""); str += strError; } str += "</div>"; strText = str; }
internal void Update(VipEntity dbEntity) { using (var conn = new SqlConnection(ConnectionString.XgxInsert)) { dbEntity.LastUpdateTime = System.DateTime.Now; //dbEntity.LastUpdateBy = "ERP"; conn.Open(); conn.Update(dbEntity); } }
//处理事件 事件类型(subscribe, unsubscribe, click) protected void HandlerEvent(VipEntity vip) { string eventStr = requestParams.XmlNode.SelectSingleNode("//Event").InnerText.Trim().ToLower(); var eventKey = string.Empty; switch (eventStr) { //关注(扫描二维码时,如果没有关注的,就会进入到关注事件里,而不会走下面的扫码事件,因此这里也要记录一下扫码记录) case EventType.SUBSCRIBE: BaseService.WriteLogWeixin("用户加关注!"); // /****/虽然是用户关注,但也分为两种情况:搜索关注,扫二维码关注。扫二维码关注,eventkey不为空 //和普通的扫码得到的key不一样: qrscene_114,前面带了 qrscene_ #region test sending template message to new vip //if (null != vip) //{ // var vipBll = new VipBLL(requestParams.LoggingSessionInfo); // vipBll.SendNotification2NewVip(vip); //} #endregion UserSubscribe(); break; //取消关注 case EventType.UNSUBSCRIBE: BaseService.WriteLogWeixin("用户取消关注!"); UserUnSubscribe(); break; //点击 case EventType.CLICK: BaseService.WriteLogWeixin("click事件"); eventKey = requestParams.XmlNode.SelectSingleNode("//EventKey").InnerText; BaseService.WriteLogWeixin("EventKey:" + eventKey); HandlerClickJermyn(eventKey); //新版本 Jermyn20140512 HandlerClick(eventKey); //旧版本,需要兼容 break; //扫描带参数二维码事件 case EventType.SCAN: BaseService.WriteLogWeixin("扫描带参数二维码事件,用户已关注时的事件推送"); eventKey = requestParams.XmlNode.SelectSingleNode("//EventKey").InnerText; BaseService.WriteLogWeixin("EventKey:" + eventKey); HandlerScan(eventKey); break; case EventType.TEMPLATESENDJOBFINISH: BaseService.WriteLogWeixin("发送模板消息完成推送"); var status = requestParams.XmlNode.SelectSingleNode("//Status").InnerText; HandleSendTemplateMessage(status); break; } }
/// <summary> /// 客户认证是否存在 /// </summary> /// <param name="OpenId"></param> /// <param name="CustomerId"></param> /// <param name="strError"></param> /// <returns></returns> public VipEntity SetVipLegalize(string OpenId, string CustomerId, string SalesAmount, out string strError) { string strNo = string.Empty; VipEntity vipInfo = new VipEntity(); try { VipBLL vipServer = new VipBLL(this.CurrentUserInfo); //从总部获取信息 bool bReturn = vipServer.GetVipInfoFromApByOpenId(OpenId, null); if (bReturn) { //获取当前最大值 int No = _currentDAO.GetMaxNo(CustomerId); #region 插入本次信息 WLegalizeEntity info = new WLegalizeEntity(); info.LegalizeId = BaseService.NewGuidPub(); info.OpenId = OpenId; info.CustomerId = CustomerId; info.CreateBy = OpenId; info.LastUpdateBy = OpenId; info.No = No; info.SalesAmount = Convert.ToDecimal(SalesAmount); Create(info); #endregion strNo = No.ToString(); #region VipEntity[] vipObj = { }; vipObj = vipServer.QueryByEntity(new VipEntity() { WeiXinUserId = OpenId }, null); if (vipObj != null && vipObj.Length > 0 && vipObj[0] != null) { vipInfo = vipObj[0]; vipInfo.SerialNumber = strNo; strError = "OK"; } else { strError = "您还不未关注微信账号</br>请联系门店工作人员!"; } #endregion } else { strError = "获取总部数据出错,请找管理员帮助."; } } catch (Exception ex) { strError = ex.ToString(); } return(vipInfo); }
private void GetPurchasingGuideIntegral() { LoggingSessionInfo loggingSessionInfo = new LoggingSessionInfo(); loggingSessionInfo = new CLoggingSessionService().GetLoggingSessionInfo("f6a7da3d28f74f2abedfc3ea0cf65c01", "17e02a6dd0094de9b18da1ca73d37027"); VipEntity vipSearchInfo = new VipEntity(); VipEntity info = new VipEntity(); VipBLL vipServer = new VipBLL(loggingSessionInfo); string strError = string.Empty; info = vipServer.GetPurchasingGuideIntegral(vipSearchInfo, out strError); }
/// <summary> /// 查询 /// </summary> public string GetVipListData() { var form = Request("form").DeserializeJSONTo <VipQueryEntity>(); var service = new VipBLL(CurrentUserInfo); VipEntity listObj = null; string content = string.Empty; VipSearchEntity queryEntity = new VipSearchEntity(); queryEntity.Page = Utils.GetIntVal(Request("page")); queryEntity.PageSize = PageSize; queryEntity.VipInfo = FormatParamValue(form.VipInfo); queryEntity.Phone = FormatParamValue(form.Phone); queryEntity.UnitId = FormatParamValue(Request("UnitId")); queryEntity.MembershipShopId = FormatParamValue(Request("MembershipShopId")); queryEntity.VipSourceId = FormatParamValue(form.VipSourceId); if (form.VipSourceId == null) { queryEntity.VipSourceId = FormatParamValue(Request("VipSourceId")); } queryEntity.Status = Utils.GetIntVal(FormatParamValue(form.Status)); queryEntity.VipLevel = Utils.GetIntVal(FormatParamValue(form.VipLevel)); queryEntity.RegistrationDateBegin = FormatParamValue(form.RegistrationDateBegin); queryEntity.RegistrationDateEnd = FormatParamValue(form.RegistrationDateEnd); queryEntity.RecentlySalesDateBegin = FormatParamValue(form.RecentlySalesDateBegin); queryEntity.RecentlySalesDateEnd = FormatParamValue(form.RecentlySalesDateEnd); queryEntity.IntegrationBegin = Utils.GetIntVal(FormatParamValue(form.IntegrationBegin)); queryEntity.IntegrationEnd = Utils.GetIntVal(FormatParamValue(form.IntegrationEnd)); queryEntity.UserId = CurrentUserInfo.CurrentUser.User_Id; queryEntity.CustomerId = CurrentUserInfo.CurrentUser.customer_id; //Jermyn20130801 if (Request("tags") != "") // 标签及组合关系 { queryEntity.Tags = FormatParamValue(Request("tags")); } listObj = service.SearchVipInfo(queryEntity); var jsonData = new JsonData(); jsonData.totalCount = listObj.ICount.ToString(); jsonData.data = listObj.vipInfoList; content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}", jsonData.data.ToJSON(), jsonData.totalCount); return(content); }
public string ReplaceTemplate(string message, EventVipEntity eventVip, VipEntity vip, LEventsEntity eventEntity) { message = message.Replace("$VipName$", eventVip.VipName); message = message.Replace("$Region$", eventVip.Seat); message = message.Replace("$Seat$", eventVip.Seat); message = message.Replace("$Ver$", new Random().Next().ToString()); message = message.Replace("$CustomerId$", eventVip.CustomerId); message = message.Replace("$UserId$", vip.VIPID); message = message.Replace("$OpenId$", vip.WeiXinUserId); message = message.Replace("$EventName$", eventEntity.Title); return(message); }
/// <summary> /// 保存会员 /// </summary> public string SaveVipData() { var service = new VipBLL(CurrentUserInfo); VipEntity vip = new VipEntity(); string content = string.Empty; var responseData = new ResponseData(); string key = string.Empty; string vip_id = string.Empty; if (Request("vip") != null && Request("vip") != string.Empty) { key = Request("vip").ToString().Trim(); } if (Request("VipId") != null && Request("VipId") != string.Empty) { vip_id = Request("VipId").ToString().Trim(); } vip = key.DeserializeJSONTo <VipEntity>(); if (vip.VipName == null || vip.VipName.Trim().Length == 0) { responseData.success = false; responseData.msg = "会员名称不能为空"; return(responseData.ToJSON()); } bool status = true; string message = "保存成功"; if (vip.VIPID.Trim().Length == 0) { vip.VIPID = Utils.NewGuid(); vip.ClientID = this.CurrentUserInfo.CurrentUser.customer_id; vip.Status = 1; service.Create(vip); } else { vip.VIPID = vip_id; service.Update(vip, false); } responseData.success = status; responseData.msg = message; content = responseData.ToJSON(); return(content); }
protected override EmptyResponseData ProcessRequest(DTO.Base.APIRequest <UpdateVipRP> pRequest) { var rd = new EmptyResponseData(); var para = pRequest.Parameters; var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; //会员 var VipBLL = new VipBLL(loggingSessionInfo); try { VipEntity UpData = VipBLL.GetByID(para.VipID); if (UpData == null) { throw new APIException("会员不存在!") { ErrorCode = ERROR_CODES.INVALID_REQUEST_LACK_REQUEST_PARAMETER } } ; //UpData.VipName = para.VipName; UpData.VipRealName = para.VipName; UpData.Phone = para.Phone; if (!string.IsNullOrWhiteSpace(para.Col22)) { if (para.Col22.Equals("Y")) { UpData.Birthday = para.Birthday; UpData.Col22 = "N"; } } UpData.Gender = para.Gender; UpData.IDNumber = para.IDNumber; VipBLL.Update(UpData); } catch (APIException apiEx) { throw new APIException(apiEx.ErrorCode, apiEx.Message); } return(rd); }
/// <summary> /// 用户登录 /// </summary> public VipEntity UserLogin(string loginId, string loginPwd) { StringBuilder sbSql = new StringBuilder(); sbSql.Append("select top 1 id,vip_AN,[vip_pwd],vip_email,vip_mp,vip_CDT,agent_id,status_id from tbvip "); sbSql.Append("where vip_AN=@UserId and vip_pwd=@UserPwd"); SqlParameter[] paras = { new SqlParameter("@UserId", loginId), new SqlParameter("@UserPwd", loginPwd) }; VipEntity user = null; DataTable dt = SqlHelper.GetDataTable(SqlHelper.connStr, CommandType.Text, sbSql.ToString(), paras); if (dt.Rows.Count > 0) { user = new VipEntity(); if (!DBNull.Value.Equals(dt.Rows[0]["id"])) { user.VipID = int.Parse(dt.Rows[0]["id"].ToString()); } if (!DBNull.Value.Equals(dt.Rows[0]["vip_AN"])) { user.VipAccountName = dt.Rows[0]["vip_AN"].ToString(); } if (!DBNull.Value.Equals(dt.Rows[0]["vip_pwd"])) { user.VipPassword = dt.Rows[0]["vip_pwd"].ToString(); } if (!DBNull.Value.Equals(dt.Rows[0]["vip_mp"])) { user.VipMobliePhone = dt.Rows[0]["vip_mp"].ToString(); } if (!DBNull.Value.Equals(dt.Rows[0]["vip_email"])) { user.VipEmail = dt.Rows[0]["vip_email"].ToString(); } if (!DBNull.Value.Equals(dt.Rows[0]["status_id"])) { user.StatusID = int.Parse(dt.Rows[0]["status_id"].ToString()); } return(user); } return(user); }
/// <summary> /// 页面跳转 /// </summary> /// <param name="openId"></param> private void PageRedict(string openId) { if (openId == null || openId.Equals("")) { Response.Write("未获取合法的OpenId"); Response.Redirect(ConfigurationManager.AppSettings["website_WWW"] + "/HtmlApps/auth.html?pageName=LJscanFail", true); Loggers.Debug(new DebugLogInfo() { Message = "1-1: code为空,跳转: redirecting, strGotoUrl:{0}" + ConfigurationManager.AppSettings["website_WWW"] + "/HtmlApps/auth.html?pageName=LJscanFail" }); Response.End(); } else { VipEntity vipInfo = new VipEntity(); vipInfo = authBll.GetUserIdByOpenId(loggingSessionInfo, openId); if (vipInfo == null || vipInfo.VIPID == null || vipInfo.VIPID.Equals("")) { Response.Write("未获取合法的vip信息"); } else { Response.Write("获取vip信息"); Response.Write("</br>"); goUrl = "http://" + HttpUtility.UrlDecode(goUrl) + ""; string strGotoUrl = "";//"/OnlineClothing/tmpGoUrl.html?customerId=" + customerId + "&openId=" + OpenId + "&userId=" + vipId + "&backUrl=" + HttpUtility.UrlEncode(goUrl) + ""; Random rad = new Random(); if (goUrl.IndexOf("?") > 0) { strGotoUrl = goUrl + "&customerId=" + customerId + "&openId=" + openId + "&userId=" + vipInfo.VIPID + "&rid=" + rad.Next(1000, 100000) + ""; } else { strGotoUrl = goUrl + "?customerId=" + customerId + "&openId=" + openId + "&userId=" + vipInfo.VIPID + "&rid=" + rad.Next(1000, 100000) + ""; } Response.Write(strGotoUrl); Loggers.Debug(new DebugLogInfo() { Message = "1-1: code为空,跳转: redirecting, strGotoUrl:" + strGotoUrl }); Response.Redirect(strGotoUrl, false); } } }
/// <summary> /// 保存经销商头像 /// </summary> /// <param name="vipEntity"></param> /// <param name="pEntity"></param> internal void SaveRetailTraderHeadImg(VipEntity vipEntity, RetailTraderEntity pEntity) { ObjectImagesEntity imgEntity = new ObjectImagesEntity(); imgEntity.ImageId = System.Guid.NewGuid().ToString(); imgEntity.CustomerId = pEntity.CustomerId; imgEntity.ObjectId = pEntity.RetailTraderID; imgEntity.ImageURL = vipEntity.HeadImgUrl; imgEntity.DisplayIndex = 0; imgEntity.CreateTime = DateTime.Now; imgEntity.CreateBy = "sys"; imgEntity.LastUpdateBy = "sys"; imgEntity.LastUpdateTime = DateTime.Now; imgEntity.IsDelete = 0; imgEntity.Title = ""; imgEntity.Description = ""; this._currentDAO.Create(imgEntity); }
/// <summary> /// 把DataRow行转成实体类对象 /// </summary> private void DataRowToModel(VipEntity model, DataRow dr) { if (!DBNull.Value.Equals(dr["id"])) { model.VipID = int.Parse(dr["id"].ToString()); } if (!DBNull.Value.Equals(dr["vip_AN"])) { model.VipAccountName = dr["vip_AN"].ToString(); } if (!DBNull.Value.Equals(dr["vip_pwd"])) { model.VipPassword = dr["vip_pwd"].ToString(); } if (!DBNull.Value.Equals(dr["vip_mp"])) { model.VipMobliePhone = dr["vip_mp"].ToString(); } if (!DBNull.Value.Equals(dr["vip_email"])) { model.VipEmail = dr["vip_email"].ToString(); } if (!DBNull.Value.Equals(dr["vip_CDT"])) { model.CreateTime = Convert.ToDateTime(dr["vip_CDT"]); } if (!DBNull.Value.Equals(dr["agent_id"])) { model.AgentAccountName = dr["agent_id"].ToString(); } if (!DBNull.Value.Equals(dr["status_id"])) { model.StatusID = int.Parse(dr["status_id"].ToString()); } }
/// <summary> /// 添加用户 /// </summary> public int AddUser(VipEntity user) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into tbVip(vip_AN,[vip_pwd],vip_email,vip_mp,vip_CDT,agent_id,status_id)"); strSql.Append(" values "); strSql.Append("(@UserAcountName,@UserPassword,@UserMobliePhone,@UserEmail,@UserCreateBy,@UserCreateDate,@RoleID,@StatusID)"); strSql.Append(";SELECT @@IDENTITY"); //返回插入用户的主键 SqlParameter[] paras = { new SqlParameter("@UserAcountName", user.VipAccountName), new SqlParameter("@UserPassword", user.VipPassword), new SqlParameter("@UserMobliePhone", user.VipMobliePhone), new SqlParameter("@UserEmail", user.VipEmail), new SqlParameter("@UserCreateDate", user.CreateTime), new SqlParameter("@RoleID", user.AgentAccountName), new SqlParameter("@StatusID", user.StatusID) }; return(Convert.ToInt32(SqlHelper.ExecuteScalar(SqlHelper.connStr, CommandType.Text, strSql.ToString(), paras))); }
/// <summary> /// 查询 /// </summary> /// <param name="vipSearchInfo"></param> /// <returns></returns> public VipEntity WebGetListAdd(VipSearchEntity vipSearchInfo) { try { VipEntity vipInfo = new VipEntity(); //int iCount = _currentDAO.WebGetListCount(vipSearchInfo); int iCount = _currentDAO.WebGetListCountAdd(vipSearchInfo); IList <VipEntity> vipInfoList = new List <VipEntity>(); DataSet ds = _currentDAO.WebGetListAdd(vipSearchInfo); if (ds != null && ds.Tables[0].Rows.Count > 0) { //vipInfoList = DataTableToObject.ConvertToList<VipEntity>(ds.Tables[0]); foreach (DataRow dr in ds.Tables[0].Rows) { var vipObj = new VipEntity(); vipObj.VIPID = dr["VIPID"] != DBNull.Value ? dr["VIPID"].ToString() : ""; vipObj.VipCode = dr["VipCode"] != DBNull.Value ? dr["VipCode"].ToString() : ""; vipObj.VipLevel = dr["VipLevel"] != DBNull.Value ? Convert.ToInt32(dr["VipLevel"].ToString()) : 0; vipObj.VipName = dr["VipName"] != DBNull.Value ? dr["VipName"].ToString() : ""; vipObj.Phone = dr["Phone"] != DBNull.Value ? dr["Phone"].ToString() : ""; vipObj.WeiXin = dr["WeiXin"] != DBNull.Value ? dr["WeiXin"].ToString() : ""; vipObj.Integration = dr["Integration"] != DBNull.Value ? Convert.ToDecimal(dr["Integration"].ToString()) : 0; vipObj.LastUpdateTime = dr["LastUpdateTime"] != DBNull.Value ? Convert.ToDateTime(dr["LastUpdateTime"].ToString()) : DateTime.Now; vipObj.PurchaseAmount = dr["PurchaseAmount"] != DBNull.Value ? Convert.ToDecimal(dr["PurchaseAmount"].ToString()) : 0; vipObj.PurchaseCount = dr["PurchaseCount"] != DBNull.Value ? Convert.ToInt32(dr["PurchaseCount"].ToString()) : 0; vipInfoList.Add(vipObj); } } vipInfo.ICount = iCount; vipInfo.vipInfoList = vipInfoList; return(vipInfo); } catch (Exception ex) { throw (ex); } }
protected override EmptyResponseData ProcessRequest(DTO.Base.APIRequest <SetVipDealerRP> pRequest) { var rd = new EmptyResponseData(); var VipBLL = new VipBLL(CurrentUserInfo); bool Flag = VipBLL.IsSetVipDealer(pRequest.UserID); try { if (Flag) { VipEntity Entity = VipBLL.GetByID(pRequest.UserID); if (Entity != null) { Entity.Col48 = "1"; VipBLL.Update(Entity); } else { throw new APIException("会员不存在!") { ErrorCode = 103 }; } } else { //var Result = VipBLL.GetSetVipDealerUpset(); throw new APIException("您当前会员卡等级不符合!") { ErrorCode = 105 }; } } catch (Exception ex) { throw new APIException(ex.Message); } return(rd); }
/// <summary> /// 获取Vip信息 /// </summary> public string GetVipInfoById() { var service = new VipBLL(CurrentUserInfo); VipEntity obj = new VipEntity(); string content = string.Empty; string key = string.Empty; if (Request("vip_id") != null && Request("vip_id") != string.Empty) { key = Request("vip_id").ToString().Trim(); } obj = service.GetVipDetailByVipID(key); var jsonData = new JsonData(); jsonData.totalCount = obj == null ? "0" : "1"; jsonData.data = obj; content = jsonData.ToJSON(); return(content); }
private void SearchVipInfo() { VipSearchEntity vipSearchInfo = new VipSearchEntity(); vipSearchInfo.Page = 1; vipSearchInfo.PageSize = 15; LoggingSessionInfo loggingSessionInfo = new LoggingSessionInfo(); loggingSessionInfo = new CLoggingSessionService().GetLoggingSessionInfo("29E11BDC6DAC439896958CC6866FF64E", "7d4cda48970b4ed0aa697d8c2c2e4af3"); VipBLL vipServer = new VipBLL(loggingSessionInfo); VipEntity vipInfo = new VipEntity(); vipInfo = vipServer.SearchVipInfo(vipSearchInfo); if (vipInfo != null) { this.lb1.Text = vipInfo.ICount.ToString(); if (vipInfo.ICount > 0) { this.GridView1.DataSource = vipInfo.vipInfoList; this.GridView1.DataBind(); } } }
/// <summary> /// (基金赎回)2201 /// </summary> /// <param name="dt">当前时间</param> /// <param name="pLogisticsinfo">交易号</param> /// <returns></returns> private ReceiveRansomMessage AssertRanson(LoggingSessionInfo pLoggingSessionInfo, string customerID, string userID, string detailID, DateTime dt) { //获取用户信息 VipBLL vbll = new VipBLL(pLoggingSessionInfo); VipEntity vip = vbll.GetVipDetailByVipID(userID); if (vip == null) { throw new Exception("该用户不存在!"); } //交易号 string logisticsinfo = m_logisticsinfo; //客户协议号 //string assignbuyer = GetClientAgreementNo(pLoggingSessionInfo, userID, customerID); string assignbuyer = vip.VipCode; ReceiveRansomMessage pEnity = new ReceiveRansomMessage(); pEnity.MerchantID = HuaAnConfigurationAppSitting.MerchantID; pEnity.Merchantdate = dt.ToString("yyyyMMdd"); pEnity.Logisticsinfo = logisticsinfo; // 交易号 pEnity.Assignbuyer = assignbuyer; //客户协议号 :客户协议号唯一的标识世联的用户和华安用户之前的绑定关系。备注:一个用户只能绑定一次,所以一个用户只能有一个协议号 pEnity.Assbuyername = vip.VipName; pEnity.Assbuyermobile = vip.Phone; pEnity.Fee = "0"; //用于回调更新 &=>& pEnity.Commonreturn = "mappingID=" + 1000 + "&prePaymentID=" + 100; //回调url pEnity.PageURL = string.Format(HuaAnConfigurationAppSitting.CallBackPageUrl, "RansomCallBack"); pEnity.Memo = ""; pEnity.RetURL = ""; return(pEnity); }
/// <summary> /// 确认收单,并且推送消息告知客户 /// </summary> /// <param name="orderId">确认单据</param> /// <param name="userId">收单确认人</param> /// <returns></returns> public bool GetReceiptConfirm(string orderId, string userId, string msgUrl, out string strError) { try { DataSet ds = new DataSet(); ds = _currentDAO.GetReceiptConfirm(orderId, userId); VipEntity vipInfo = new VipEntity(); if (ds != null && ds.Tables[0].Rows.Count > 0) { vipInfo = DataTableToObject.ConvertToObject <VipEntity>(ds.Tables[0].Rows[0]); string msgText = string.Format("信息提示用户。{0}分钟内,工号为{1}的员工将上门收取衣物,该员工的手机号为{2}", "30", vipInfo.VipCode, vipInfo.Phone); string msgData = "<xml><OpenID><![CDATA[" + vipInfo.WeiXinUserId + "]]></OpenID><Content><![CDATA[" + msgText + "]]></Content></xml>"; var msgResult = Common.Utils.GetRemoteData(msgUrl, "POST", msgData); #region 发送日志 MarketSendLogBLL logServer = new MarketSendLogBLL(CurrentUserInfo); MarketSendLogEntity logInfo = new MarketSendLogEntity(); logInfo.LogId = BaseService.NewGuidPub(); logInfo.IsSuccess = 1; logInfo.MarketEventId = orderId; logInfo.SendTypeId = "2"; logInfo.TemplateContent = msgData; logInfo.VipId = vipInfo.VIPID; logInfo.WeiXinUserId = vipInfo.WeiXinUserId; logInfo.CreateTime = System.DateTime.Now; logServer.Create(logInfo); #endregion } strError = ""; return(true); } catch (Exception ex) { strError = ex.ToString(); return(false); } }
/// <summary> /// 会员查询 /// </summary> /// <param name="vipSearchInfo"></param> /// <returns></returns> public VipEntity GetVipList(VipSearchEntity vipSearchInfo) { try { VipEntity vipInfo = new VipEntity(); int iCount = _currentDAO.GetVipListCount(vipSearchInfo); IList <VipEntity> vipInfoList = new List <VipEntity>(); DataSet ds = _currentDAO.GetVipList(vipSearchInfo); if (ds != null && ds.Tables[0].Rows.Count > 0) { vipInfoList = DataTableToObject.ConvertToList <VipEntity>(ds.Tables[0]); } vipInfo.ICount = iCount; vipInfo.vipInfoList = vipInfoList; return(vipInfo); } catch (Exception ex) { throw (ex); } }