/// <summary> /// /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { try { string code = context.Request["code"]; var userInfo = bllUser.Get <UserInfo>(string.Format("WebsiteOwner='{0}' And Ex2='{1}'", bllUser.WebsiteOwner, code)); if (userInfo != null && userInfo.UserType == 7) { apiResp.status = true; apiResp.result = new { id = userInfo.AutoID, user_id = userInfo.UserID }; } else { apiResp.msg = "专柜码错误"; } } catch (Exception) { apiResp.msg = "专柜码错误"; } bllUser.ContextResponse(context, apiResp); }
protected void Page_Load(object sender, EventArgs e) { var payConfig = bllPay.GetPayConfig(); if (payConfig != null) { if ((!string.IsNullOrEmpty(payConfig.WXAppId)) && (!string.IsNullOrEmpty(payConfig.WXMCH_ID)) && (!string.IsNullOrEmpty(payConfig.WXPartnerKey))) { isShowWeixin = true; } } if (CurrentUserInfo.WebsiteOwner == "songhe") { isShowWeixin = false; } config = bllWebsite.GetCompanyWebsiteConfig(); if (config == null) { config = new CompanyWebsite_Config(); } if (Request["ischannel"] != null && Request["ischannel"].ToString() == "1") { UserInfo channelUserInfo = bllUser.Get <UserInfo>(string.Format("MgrUserId='{0}'", CurrentUserInfo.UserID)); if (channelUserInfo == null && (!bllDis.IsChannel(CurrentUserInfo))) { Response.Redirect("/error/commonmsg.aspx?msg=您还不是渠道身份,无法访问,请联系商家升级为渠道。"); return; } CurrentUserInfo = channelUserInfo; } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["lotteryId"])) { int lotteryId = Convert.ToInt32(Request["lotteryId"]); lottery = bllUser.Get <WXLotteryV1>(string.Format(" LotteryID={0} ", lotteryId)); } }
/// <summary> /// 获取导师详情 /// </summary> /// <param name="UserId"></param> private void GetTutor(string UserId) { tInfo = bllUser.Get <BLLJIMP.Model.TutorInfo>(string.Format(" AutoId='{0}'", UserId)); if (tInfo != null) { BLLJIMP.Model.UserInfo uInfo = bllUser.Get <BLLJIMP.Model.UserInfo>(string.Format("UserId='{0}'", tInfo.UserId)); IheadImg.Src = tInfo.TutorImg; txtExplain.Text = tInfo.TutorExplain; txtTrade.Text = GetTradeStr(tInfo.TradeStr); //行业标签 txtProfessiona.Text = GettxtProfessionaStr(tInfo.ProfessionalStr); //专业标签 IsFollowedString = bllUser.CheckFollow(bllUser.GetCurrentUserInfo().UserID, tInfo.UserId) ? "关注" : "已关注"; FansNum.InnerText = uInfo.FansCount.ToString(); FansNumInt = uInfo.FansCount; BLLJIMP.Model.ForwardingRecord frecord = bllUser.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND websiteOwner='{2}' AND TypeName='导师赞'", DataLoadTool.GetCurrUserModel().UserID, tInfo.UserId, bllUser.WebsiteOwner)); if (frecord != null) { zan = true; } UserLevel = bllUserScore.GetUserLevelByTotalScore(uInfo.HistoryTotalScore); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["lotteryId"])) { int lotteryId = Convert.ToInt32(Request["lotteryId"]); lottery = bllLotery.Get <WXLotteryV1>(string.Format(" WebsiteOwner='{0}' AND LotteryID={1} ", bllLotery.WebsiteOwner, lotteryId)); webSite = bllLotery.GetWebsiteInfoModel(); var currentUserInfo = bllUser.GetCurrentUserInfo(); if (string.IsNullOrEmpty(currentUserInfo.WXNickname)) { Session.Clear(); Response.Redirect(Request.Url.ToString()); } lotteryUser = bllUser.Get <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryId={1} AND UserId='{2}' ", bllUser.WebsiteOwner, lotteryId, currentUserInfo.UserID)); if (lotteryUser == null) { lotteryUser = new BLLJIMP.Model.LotteryUserInfo(); lotteryUser.WebsiteOwner = bllUser.WebsiteOwner; lotteryUser.CreateDate = DateTime.Now; lotteryUser.WinnerDate = DateTime.Now; lotteryUser.IsWinning = 0; lotteryUser.LotteryId = Convert.ToInt32(lotteryId); lotteryUser.UserId = currentUserInfo.UserID; lotteryUser.WXHeadimgurl = currentUserInfo.WXHeadimgurl; lotteryUser.WXNickname = bllUser.GetUserDispalyName(currentUserInfo); if (bllUser.Add(lotteryUser)) { msg = "加入成功"; isSuccess = true; int count = bllUser.GetCount <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryID={1}", bllUser.WebsiteOwner, lotteryId)); bllUser.UpdateByKey <WXLotteryV1>("LotteryID", Request["lotteryId"], "WinnerCount", count.ToString()); } else { isSuccess = false; msg = "加入失败"; } } else { msg = "您已参加抽奖"; isSuccess = true; } } }
public void ProcessRequest(HttpContext context) { string lotteryId = context.Request["lottery_id"]; curUser = bllUser.GetCurrentUserInfo(); if (string.IsNullOrEmpty(lotteryId)) { apiResp.msg = "抽奖活动id为空"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bllUser.ContextResponse(context, apiResp); return; } BLLJIMP.Model.LotteryUserInfo model = bllUser.Get <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryId={1} AND UserId='{2}' ", bllUser.WebsiteOwner, lotteryId, curUser.UserID)); if (model != null) { apiResp.msg = "您已参加抽奖"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsRepeat; bllUser.ContextResponse(context, apiResp); return; } model = new BLLJIMP.Model.LotteryUserInfo(); model.WebsiteOwner = bllUser.WebsiteOwner; model.CreateDate = DateTime.Now; model.WinnerDate = DateTime.Now; model.IsWinning = 0; model.LotteryId = Convert.ToInt32(lotteryId); model.UserId = curUser.UserID; model.WXHeadimgurl = curUser.WXHeadimgurl; model.WXNickname = bllUser.GetUserDispalyName(curUser); if (model.WXNickname.Trim() == string.Empty) { apiResp.msg = "无昵称不能加入"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail; bllUser.ContextResponse(context, apiResp); return; } if (bllUser.Add(model)) { int count = bllUser.GetCount <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryID={1}", bllUser.WebsiteOwner, lotteryId)); bllUser.UpdateByKey <WXLotteryV1>("LotteryID", lotteryId, "WinnerCount", count.ToString()); apiResp.msg = "加入成功"; apiResp.status = true; } else { apiResp.msg = "加入失败"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail; } bllUser.ContextResponse(context, apiResp); }
protected void Page_Load(object sender, EventArgs e) { UserInfo channelUserInfo = bllUser.Get <UserInfo>(string.Format("MgrUserId='{0}'", CurrentUserInfo.UserID)); if (channelUserInfo == null) { Response.Redirect("/error/commonmsg.aspx?msg=您还不是渠道身份,无法访问,请联系商家升级为渠道。"); return; } CurrentUserInfo = channelUserInfo; websiteInfo = bllUser.GetWebsiteInfoModelFromDataBase(); //头部图标引用 string iconfontPath = Common.ConfigHelper.GetConfigString("iconfont_comeoncloud"); if (!string.IsNullOrWhiteSpace(iconfontPath)) { string iconJson = File.ReadAllText(this.Server.MapPath(iconfontPath)); JToken jToken = JToken.Parse(iconJson); StringBuilder icoSbu = new StringBuilder(); icoSbu.AppendLine("@charset \"utf-8\";"); if (jToken["css_file"] != null) { icoSbu.AppendLine(string.Format("@import url(\"{0}\");", jToken["css_file"].ToString())); } icoSbu.AppendLine(string.Format("@font-face {0}", "{")); icoSbu.AppendLine("font-family: \"iconfont\";"); if (jToken["svg_file"] != null) { icoSbu.AppendLine(string.Format("src:url(\"{0}#iconfont\") format('svg');", jToken["svg_file"].ToString())); } icoSbu.AppendLine(string.Format("{0}", "}")); icoimport = icoSbu.ToString(); } LevelName = bllUser.Get <UserLevelConfig>(string.Format("AutoId={0}", CurrentUserInfo.ChannelLevelId)).LevelString; }
/// <summary> /// 获取核销渠道 /// </summary> /// <param name="hexiaoCode"></param> /// <param name="chanel"></param> /// <returns></returns> private bool GetHexiaoChannel(string hexiaoCode, out string chanel) { chanel = ""; WebsiteInfo websiteInfo = bllMall.GetWebsiteInfoModelFromDataBase(); if (!string.IsNullOrEmpty(websiteInfo.HexiaoCode) && (hexiaoCode.ToLower() == websiteInfo.HexiaoCode.ToLower())) { chanel = "系统"; return(true); } UserInfo userInfo = bllUser.Get <UserInfo>(string.Format(" WebsiteOwner='{0}' And HexiaoCode='{1}'", bllUser.WebsiteOwner, hexiaoCode)); if (userInfo != null) { chanel = bllUser.GetUserDispalyName(userInfo); return(true); } return(false); }
public void ProcessRequest(HttpContext context) { int pageIndex = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1; int pageSize = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 10; int totalCount = 0; var list = this.bLLCommRelation.GetRelationListDesc(BLLJIMP.Enums.CommRelationType.FollowUser, null, CurrentUserInfo.UserID , pageIndex, pageSize, out totalCount); apiResp.status = true; List <dynamic> returnList = new List <dynamic>(); foreach (var item in list) { UserInfo userInfo = bllUser.Get <UserInfo>(string.Format(" UserID='{0}'", item.MainId)); if (userInfo == null) { continue; } returnList.Add(new { id = userInfo.AutoID, avatar = userInfo.Avatar, nick_name = userInfo.WXNickname, birthday = DateTimeHelper.DateTimeToUnixTimestamp(userInfo.Birthday), gender = userInfo.Gender, identification = userInfo.Ex5, distance = userInfo.Distance }); } apiResp.result = new { totalcount = totalCount, list = returnList }; bllUser.ContextResponse(context, apiResp); }
/// <summary> /// 注册 /// </summary> /// <param name="context"></param> /// <returns></returns> private string Reg(HttpContext context) { int regType = int.Parse(context.Request["RegType"]); //注册类型 2销售人员 3海马内部人员 string phone = context.Request["Phone"]; //手机号 string smsVerCode = context.Request["VerCode"]; //手机验证码 string trueName = context.Request["TrueName"]; string province = context.Request["Province"]; //省份 string storeName = context.Request["StoreName"]; //门店名称 string storeCode = context.Request["StoreCode"]; //门店代码 string position = context.Request["Position"]; //岗位 string ex1 = context.Request["Ex1"]; //本部 string ex2 = context.Request["Ex2"]; //部门 if (bllHaiMa.IsReg(CurrentUserInfo)) { resp.errcode = 8; resp.errmsg = "已经注册过了"; return(Common.JSONHelper.ObjectToJson(resp)); } if ((!Common.ValidatorHelper.PhoneNumLogicJudge(phone)))//验证手机号格式 { resp.errcode = 1; resp.errmsg = "手机号码无效"; return(Common.JSONHelper.ObjectToJson(resp)); } var lastVerCode = bllSms.GetLastSmsVerificationCode(phone); if (lastVerCode == null) { resp.errcode = 2; resp.errmsg = "请先获取验证码"; return(Common.JSONHelper.ObjectToJson(resp)); } if (string.IsNullOrEmpty(smsVerCode)) { resp.errcode = 3; resp.errmsg = "请输入手机验证码"; return(Common.JSONHelper.ObjectToJson(resp)); } if (!smsVerCode.Equals(lastVerCode.VerificationCode)) { resp.errcode = 4; resp.errmsg = "验证码不正确"; return(Common.JSONHelper.ObjectToJson(resp)); } //检查门店 if ((bllHaiMa.GetSingleStore(province, storeName, storeCode) == null) && (regType == 2)) { resp.errcode = 5; resp.errmsg = "店代码输入有误,请重新输入"; return(Common.JSONHelper.ObjectToJson(resp)); } if (bllUser.Get <UserInfo>(string.Format("Phone='{0}' And WebSiteOwner='{1}'", phone, bllUser.WebsiteOwner)) != null) { resp.errcode = 6; resp.errmsg = "此手机号已经被注册"; return(Common.JSONHelper.ObjectToJson(resp)); } CurrentUserInfo.Phone = phone; CurrentUserInfo.TrueName = trueName; CurrentUserInfo.Province = province;//省份 CurrentUserInfo.Postion = position; CurrentUserInfo.UserType = regType; CurrentUserInfo.Ex1 = ex1; //本部 CurrentUserInfo.Ex2 = ex2; //部门 CurrentUserInfo.Ex3 = storeName; //销售店名称 CurrentUserInfo.Ex4 = storeCode; //销售店代码 string setPar = string.Format(" TrueName='{0}',Phone='{1}',Postion='{2}',UserType={3},Province='{4}',Ex1='{5}',Ex2='{6}',Ex3='{7}',Ex4='{8}'", CurrentUserInfo.TrueName, CurrentUserInfo.Phone, CurrentUserInfo.Postion, CurrentUserInfo.UserType, CurrentUserInfo.Province, CurrentUserInfo.Ex1, CurrentUserInfo.Ex2, CurrentUserInfo.Ex3, CurrentUserInfo.Ex4); if (bllUser.Update(CurrentUserInfo, setPar, string.Format(" AutoID={0}", CurrentUserInfo.AutoID)) > 0) { resp.errmsg = "成功注册"; } else { resp.errcode = 7; resp.errmsg = "注册失败"; } return(Common.JSONHelper.ObjectToJson(resp)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (bllUser.IsLogin == false) { resp.errcode = -1; resp.errmsg = "你还没有登录,请先登录"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } string data = context.Request["data"]; RequestModel requestModel; try { requestModel = ZentCloud.Common.JSONHelper.JsonToModel <RequestModel>(context.Request["data"]); } catch (Exception) { resp.errcode = -1; resp.errmsg = "json格式错误,请检查"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } //检查必填项 if (requestModel.order_id <= 0) { resp.errcode = 1; resp.errmsg = "订单号出错"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_name)) { resp.errcode = 1; resp.errmsg = "请输入收货人姓名"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_phone)) { resp.errcode = 1; resp.errmsg = "请输入收货人电话"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_province)) { resp.errcode = 1; resp.errmsg = "请输入收货人省份名称"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_province_code)) { resp.errcode = 1; resp.errmsg = "请输入收货人省份代码"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_city)) { resp.errcode = 1; resp.errmsg = "请输入收货人城市名称"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_city_code)) { resp.errcode = 1; resp.errmsg = "请输入收货人城市代码"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_dist)) { resp.errcode = 1; resp.errmsg = "请输入收货人区域名称"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_dist_code)) { resp.errcode = 1; resp.errmsg = "请输入收货人区域代码"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_address)) { resp.errcode = 1; resp.errmsg = "请输入收货人街道地址"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } if (string.IsNullOrEmpty(requestModel.receiver_zip)) { resp.errcode = 1; resp.errmsg = "请输入收货人邮政编码"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } WXMallGiftOrderInfo giftorder = bllUser.Get <WXMallGiftOrderInfo>(string.Format(" OrderId={0} AND UserId='{1}' AND WebsiteOwner='{2}'", requestModel.order_id, bllUser.GetCurrUserID(), bllUser.WebsiteOwner)); //检查是否已经领取 if (giftorder != null) { resp.errcode = -1; resp.errmsg = "你已经领取过了"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } //查看订单详情 WXMallOrderDetailsInfo orderdetail = bllUser.Get <WXMallOrderDetailsInfo>(string.Format(" OrderID={0} ", requestModel.order_id)); int OrderCount = bllUser.GetCount <WXMallGiftOrderInfo>(string.Format(" OrderId={0} ", requestModel.order_id)); if (OrderCount >= orderdetail.TotalCount) { resp.errcode = -1; resp.errmsg = "已经领完"; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; } WXMallGiftOrderInfo mallGiftOrderInfo = new WXMallGiftOrderInfo(); mallGiftOrderInfo.GiftOrderId = int.Parse(bllUser.GetGUID(BLLJIMP.TransacType.CommAdd)); mallGiftOrderInfo.OrderId = requestModel.order_id; mallGiftOrderInfo.ReceiveName = requestModel.receiver_name; mallGiftOrderInfo.ReceivePhone = requestModel.receiver_phone; mallGiftOrderInfo.InsertDate = DateTime.Now; mallGiftOrderInfo.WebsiteOwner = bllUser.WebsiteOwner; mallGiftOrderInfo.UserId = bllUser.GetCurrUserID(); mallGiftOrderInfo.ReceiverProvince = requestModel.receiver_province; mallGiftOrderInfo.ReceiverProvinceCode = requestModel.receiver_province_code; mallGiftOrderInfo.ReceiverCity = requestModel.receiver_city; mallGiftOrderInfo.ReceiverCityCode = requestModel.receiver_city_code; mallGiftOrderInfo.ReceiverDist = requestModel.receiver_dist; mallGiftOrderInfo.ReceiverDistCode = requestModel.receiver_dist_code; mallGiftOrderInfo.Address = requestModel.receiver_address; mallGiftOrderInfo.ZipCode = requestModel.receiver_zip; if (bllUser.Add(mallGiftOrderInfo)) { resp.errcode = 0; resp.errmsg = "领取成功"; } else { resp.errcode = -1; resp.errmsg = "领取出错"; } context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); return; }