示例#1
0
        public void ProcessRequest(HttpContext context)
        {
            int      toUserId    = Convert.ToInt32(context.Request["to_user_id"]);
            UserInfo toUserModel = bllUser.GetUserInfoByAutoID(toUserId);

            if (toUserModel == null)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                apiResp.msg  = "不存在关注的用户";
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            if (this.bLLCommRelation.DelCommRelation(BLLJIMP.Enums.CommRelationType.FollowUser, toUserModel.UserID, CurrentUserInfo.UserID))
            {
                apiResp.code   = (int)BLLJIMP.Enums.APIErrCode.IsSuccess;
                apiResp.msg    = "取消完成";
                apiResp.status = true;
            }
            else
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = "取消失败";
            }
            bllUser.ContextResponse(context, apiResp);
        }
示例#2
0
        public void ProcessRequest(HttpContext context)
        {
            string trueName = context.Request["true_name"];
            string phone    = context.Request["phone"];

            UserInfo model = new UserInfo();

            model.UserID          = string.Format("PCUser{0}", Guid.NewGuid().ToString());//Guid
            model.Password        = ZentCloud.Common.Rand.Str_char(12);
            model.UserType        = 2;
            model.WebsiteOwner    = bllUser.WebsiteOwner;
            model.Regtime         = DateTime.Now;
            model.WXOpenId        = "";
            model.RegIP           = ZentCloud.Common.MySpider.GetClientIP();
            model.LastLoginIP     = ZentCloud.Common.MySpider.GetClientIP();
            model.LastLoginDate   = DateTime.Now;
            model.LoginTotalCount = 1;
            model.TrueName        = trueName;
            model.Phone           = phone;
            if (bllUser.GetCount <UserInfo>(string.Format("Websiteowner='{0}' And Phone='{1}'", bllUser.WebsiteOwner, phone)) > 0)
            {
                apiResp.msg = "手机号重复";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (bllUser.Add(model))
            {
                apiResp.status = true;
                apiResp.msg    = "ok";
            }
            else
            {
            }
            bllUser.ContextResponse(context, apiResp);
        }
示例#3
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string storeIds = context.Request["store_ids"];
                if (string.IsNullOrEmpty(storeIds))
                {
                    resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                    resp.msg  = "store_ids 参数必传";
                    bllUser.ContextResponse(context, resp);
                    return;
                }

                if (bllUser.Update(new UserInfo(), string.Format(" UserType=0"), string.Format(" AutoId in({0})", storeIds)) > 0)
                {
                    bllUser.Update(new JuActivityInfo(), string.Format(" IsDelete=1"), string.Format(" WebsiteOwner='{0}' And ArticleType='Outlets' And K5 in({1})", bllUser.WebsiteOwner, storeIds));
                    resp.status = true;
                    resp.msg    = "ok";
                }
                else
                {
                    resp.msg = "删除失败";
                }
            }
            catch (Exception ex)
            {
                resp.msg    = ex.Message;
                resp.result = ex.ToString();
            }
            bllUser.ContextResponse(context, resp);
        }
示例#4
0
        /// <summary>
        /// 跳转到登录页面
        /// </summary>
        /// <param name="application"></param>
        private void GotoLoginPage(HttpApplication application, string pageExtraName)
        {
            if (pageExtraName == ".ashx")
            {
                dynamic result = new
                {
                    status = false,
                    code   = (int)APIErrCode.UserIsNotLogin,
                    msg    = "对不起,您没有登录!"
                };
                bllUser.ContextResponse(application.Context, result);
                application.Response.End();
            }
            string loginUrl  = Common.ConfigHelper.GetConfigString("loginUrl").ToLower();
            string logoutUrl = Common.ConfigHelper.GetConfigString("logoutUrl").ToLower();

            //手机跳转登录页
            //BLLJIMP.BLL bll=new BLLJIMP.BLL();
            //if (bll.IsMobile)
            //{
            //    application.Response.Redirect(string.Format("/App/Cation/Wap/login.aspx?redirecturl={0}", application.Request.Url.PathAndQuery.ToString()));
            //}
            //手机跳转登录页
            //PC 跳转登录页
            if (CurrentPath != null && CurrentPath != loginUrl && CurrentPath != logoutUrl)
            {
                application.Response.Redirect(logoutUrl);
            }
            //PC 跳转登录页
        }
示例#5
0
        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);
        }
示例#6
0
文件: Step1.ashx.cs 项目: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            string phone   = context.Request["phone"];    //手机号
            string verCode = context.Request["ver_code"]; //验证码

            if (string.IsNullOrEmpty(phone))
            {
                apiResp.msg = "Please Type The Cell Phone";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (string.IsNullOrEmpty(verCode))
            {
                apiResp.msg = "Please Type The Code";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (context.Session["CheckCode"] == null)
            {
                apiResp.msg = "CheckCode NULL";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (verCode != context.Session["CheckCode"].ToString().ToLower())
            {
                apiResp.msg = "Code Error";
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            //发送验证码到手机
            bool   isSuccess  = false;
            string smsVerCode = new Random().Next(111111, 999999).ToString();
            string msg        = "";

            string smsContent = string.Format("Your verification code {0}", smsVerCode);

            string smsSignature = string.Format("{0}", bllSms.GetWebsiteInfoModelFromDataBase().SmsSignature);//短信签名

            bllSms.SendSmsVerificationCode(phone, smsContent, smsSignature, smsVerCode, out isSuccess, out msg);
            if (isSuccess)
            {
                apiResp.status           = true;
                context.Session["Phone"] = phone;
            }
            else
            {
                apiResp.msg = "Send Fail";
            }
            //发送验证码到手机
            bllUser.ContextResponse(context, apiResp);
        }
示例#7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         string userId   = context.Request["userId"];
         var    userInfo = bllUser.GetUserInfo(userId, bllUser.WebsiteOwner);
         if (userInfo != null && userInfo.UserType == 7)
         {
             apiResp.status = true;
             apiResp.result = new
             {
                 id           = userInfo.AutoID,
                 user_id      = userInfo.UserID,
                 head_img_url = userInfo.WXHeadimgurl,
                 image        = userInfo.Images,
                 ex1          = userInfo.Ex1,
                 ex2          = userInfo.Ex2, //供应商代码
                 ex3          = userInfo.Ex3,
                 ex4          = userInfo.Ex4, //提醒
                 company      = userInfo.Company,
                 desc         = userInfo.Description.Replace("\n", "<br/>")
             };
         }
         else
         {
             apiResp.msg = "专柜码错误";
         }
     }
     catch (Exception)
     {
         apiResp.msg = "专柜码错误";
     }
     bllUser.ContextResponse(context, apiResp);
 }
示例#8
0
 /// <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);
 }
示例#9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         string id       = context.Request["id"];
         var    userInfo = bllUser.GetUserInfoByAutoID(int.Parse(id));
         if (userInfo != null && userInfo.UserType == 7)
         {
             apiResp.status = true;
             apiResp.result = new
             {
                 id      = userInfo.AutoID,
                 user_id = userInfo.UserID
                           //head_img_url=userInfo.WXHeadimgurl,
                           //image=userInfo.Images,
                           //ex1=userInfo.Ex1
             };
         }
         else
         {
             apiResp.msg = "专柜码错误";
         }
     }
     catch (Exception)
     {
         apiResp.msg = "专柜码错误";
     }
     bllUser.ContextResponse(context, apiResp);
 }
示例#10
0
        public void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod != "POST")
            {
                resp.code = (int)APIErrCode.OperateFail;
                resp.msg  = "请用POST提交";
                bllUser.ContextResponse(context, resp);
                return;
            }
            string openId       = context.Request["openid"];        //openId
            string json         = context.Request["json"];          //json
            string serialNumber = context.Request["serial_number"]; //流水号

            json = HttpUtility.UrlDecode(json);
            if (string.IsNullOrEmpty(openId))
            {
                resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.msg  = "openid 参数必传";
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            if (string.IsNullOrEmpty(json))
            {
                resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.msg  = "json 参数必传";
                bllWeixin.ContextResponse(context, resp);
                return;
            }

            UserInfo userInfo = bllUser.GetUserInfoByOpenId(openId);

            if (userInfo == null && (bllUser.WebsiteOwner == "dongwu" || bllUser.WebsiteOwner == "dongwudev"))
            {
                userInfo = bllUser.CreateNewUser(bllUser.WebsiteOwner, openId, "");
            }
            if (userInfo == null)
            {
                resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.msg  = "openid 不存在";
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            string msg       = "";
            var    isSuccess = bllWeixin.SendTemplateMessageCustomize(json, out msg);

            if (isSuccess)
            {
                resp.status = true;
                resp.msg    = "ok";
                bllLog.Add(bllLog.WebsiteOwner, EnumApiModule.WeixinMessage, string.Format("发送微信消息\njson内容{0}", json), openId, userInfo.UserID, serialNumber);
            }
            else
            {
                resp.code = (int)APIErrCode.OperateFail;
                resp.msg  = msg;
            }
            bllWeixin.ContextResponse(context, resp);
        }
示例#11
0
文件: Add.ashx.cs 项目: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            string pId   = context.Request["product_id"];
            string props = context.Request["props"];
            string count = context.Request["num"];
            string pName = context.Request["product_name"];

            if (string.IsNullOrEmpty(pId))
            {
                apiResp.msg  = "必填参数为空";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllUser.ContextResponse(context, apiResp);
                return;
            }


            UserInfo curUser = bllUser.GetCurrentUserInfo();

            ProductStock stock = new ProductStock();

            stock.ProductId    = Convert.ToInt32(pId);
            stock.UserId       = curUser.UserID;
            stock.PName        = pName;
            stock.CreateDate   = DateTime.Now;
            stock.Count        = Convert.ToInt32(count);
            stock.WebsiteOwner = bllUser.WebsiteOwner;
            stock.Props        = props;
            stock.WXNickname   = curUser.WXNickname;
            stock.WXHeadimgurl = curUser.WXHeadimgurl;


            if (bllUser.Add(stock))
            {
                apiResp.msg    = "成功";
                apiResp.status = true;
            }
            else
            {
                apiResp.msg  = "失败";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            bllUser.ContextResponse(context, apiResp);
        }
示例#12
0
        public void ProcessRequest(HttpContext context)
        {
            int pageIndex = Convert.ToInt32(context.Request["pageindex"]),
                pageSize  = Convert.ToInt32(context.Request["pagesize"]);
            var commentId = context.Request["commentid"];

            var totalCount = 0;

            curUser = bllUser.GetCurrentUserInfo();

            //仅显示审核通过的
            var sourceData = this.bllReview.GetReviewList(BLLJIMP.Enums.ReviewTypeKey.CommentReply, out totalCount, pageIndex, pageSize, commentId, bllReview.WebsiteOwner, this.curUser == null ? "" : curUser.UserID, " AutoId ASC ");

            List <dynamic> returnList = new List <dynamic>();

            foreach (var item in sourceData)
            {
                returnList.Add(new
                {
                    id               = item.ReviewMainId,
                    content          = item.ReviewContent,
                    createDate       = item.InsertDate.ToString(),
                    replyCount       = item.ReplyCount,  //回复数
                    praiseCount      = item.PraiseCount, //点赞数
                    currUserIsPraise = item.CurrUserIsPraise,
                    pubUser          = new
                    {
                        id       = item.PubUser == null ? 0 : item.PubUser.AutoID,
                        userId   = item.PubUser == null ? "" : item.PubUser.UserID,
                        userName = item.PubUser == null ? "" : bllUser.GetUserDispalyName(item.PubUser),
                        avatar   = item.PubUser == null ? "" : bllUser.GetUserDispalyAvatar(item.PubUser),
                        isTutor  = item.PubUser == null ? false : bllUser.IsTutor(item.PubUser)
                    },
                    replayToUser = new
                    {
                        id       = item.ReplayToUser == null ? 0 : item.ReplayToUser.AutoID,
                        userId   = item.ReplayToUser == null ? "" : item.ReplayToUser.UserID,
                        userName = item.ReplayToUser == null ? "" : bllUser.GetUserDispalyName(item.ReplayToUser),
                        avatar   = item.ReplayToUser == null ? "" : bllUser.GetUserDispalyAvatar(item.ReplayToUser),
                        isTutor  = item.ReplayToUser == null ? false : bllUser.IsTutor(item.ReplayToUser)
                    }
                });
            }

            dynamic result = new
            {
                totalcount = totalCount,
                list       = returnList
            };

            apiResp.status = true;
            apiResp.msg    = "查询完成";
            apiResp.result = result;
            bllUser.ContextResponse(context, apiResp);
        }
示例#13
0
 public void ProcessRequest(HttpContext context)
 {
     BLLJIMP.Model.UserInfo currUser = bllUser.GetCurrentUserInfo();
     if (!string.IsNullOrEmpty(currUser.PayPassword))
     {
         apiResp.status = true;
         apiResp.result = currUser.PayPassword;
         apiResp.msg    = "已设置支付密码";
     }
     bllUser.ContextResponse(context, apiResp);
 }
示例#14
0
        public void ProcessRequest(HttpContext context)
        {
            string company = context.Request["company"];
            string autoid  = context.Request["autoid"];

            if (!string.IsNullOrEmpty(autoid))
            {
                apiResp.msg  = "autoid为空";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (!string.IsNullOrEmpty(company))
            {
                apiResp.msg  = "请输入公司";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            UserInfo model = bllUser.GetUserInfoByAutoID(int.Parse(autoid));

            if (model == null)
            {
                apiResp.msg  = "公司不存在";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (bllUser.UpdateUserInfo(model))
            {
                apiResp.msg    = "编辑完成";
                apiResp.status = true;
            }
            else
            {
                apiResp.msg    = "编辑出错";
                apiResp.status = false;
            }
            bllUser.ContextResponse(context, apiResp);
        }
示例#15
0
文件: List.ashx.cs 项目: uvbs/mmp
        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;

            if (pageIndex == 0)
            {
                pageIndex = 1;
            }
            string keyWord     = context.Request["keyword"];
            string regTimeFrom = context.Request["reg_time_from"];
            string regTimeTo   = context.Request["reg_time_to"];
            int    totalCount  = 0;
            var    userList    = bllUser.GetUserList(pageIndex, pageSize, keyWord, "", "", "", "", out totalCount, regTimeFrom, regTimeTo);
            var    data        = from p in userList
                                 select new
            {
                id                = p.AutoID,
                head_img          = p.WXHeadimgurl,
                nick_name         = p.WXNickname,
                true_name         = p.TrueName,
                phone             = p.Phone,
                company           = p.Company,
                position          = p.Postion,
                email             = p.Email,
                tag               = p.TagName,
                total_score       = p.TotalScore,
                is_subscribe      = p.IsWeixinFollower,
                subscribe_time    = p.SubscribeTime,
                un_subscribe_time = p.UnSubscribeTime,
                reg_time          = p.Regtime != null ? ((DateTime)p.Regtime).ToString("yyyy-MM-dd HH:mm:ss") : ""
            };

            resp.msg    = "ok";
            resp.status = true;
            resp.result = new
            {
                totalcount = totalCount,
                list       = data
            };
            bllUser.ContextResponse(context, resp);
        }
示例#16
0
        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);
        }
示例#17
0
文件: Step2.ashx.cs 项目: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            string code = context.Request["code"];//手机验证码

            if (string.IsNullOrEmpty(code))
            {
                apiResp.msg = "Please Type The Cell Phone";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (string.IsNullOrEmpty(code))
            {
                apiResp.msg = "Please Type The Code";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (context.Session["Phone"] == null)
            {
                apiResp.msg = "Phone Is Null";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            var    phone    = context.Session["Phone"].ToString();
            string lastCode = bllSms.GetLastSmsVerificationCode(phone).VerificationCode;

            if (code != lastCode)
            {
                apiResp.msg = "Code Error";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            else
            {
                context.Session["FindPasswordResult"] = "true";
                apiResp.status = true;
                bllUser.ContextResponse(context, apiResp);
            }
            bllUser.ContextResponse(context, apiResp);
        }
示例#18
0
文件: Send.ashx.cs 项目: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod != "POST")
            {
                resp.code = (int)APIErrCode.OperateFail;
                resp.msg  = "请用POST提交";
                bllUser.ContextResponse(context, resp);
                return;
            }
            string openId       = context.Request["openid"];        //openId
            string title        = context.Request["title"];         //标题
            string content      = context.Request["content"];       //备注
            string link         = context.Request["link"];          //网页链接
            string serialNumber = context.Request["serial_number"]; //流水号

            title   = HttpUtility.UrlDecode(title);
            content = HttpUtility.UrlDecode(content);
            if (string.IsNullOrEmpty(openId))
            {
                resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.msg  = "openid 参数必传";
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            if (string.IsNullOrEmpty(title))
            {
                resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.msg  = "title 参数必传";
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            if (string.IsNullOrEmpty(content))
            {
                resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.msg  = "content 参数必传";
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            UserInfo userInfo = bllUser.GetUserInfoByOpenId(openId);

            if (userInfo == null && (bllUser.WebsiteOwner == "dongwu" || bllUser.WebsiteOwner == "dongwudev"))
            {
                userInfo = bllUser.CreateNewUser(bllUser.WebsiteOwner, openId, "");
            }
            if (userInfo == null)
            {
                resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.msg  = "openid 不存在";
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            var isSuccess = bllWeixin.SendTemplateMessageNotifyComm(userInfo, title, content, link);

            if (isSuccess)
            {
                resp.status = true;
                resp.msg    = "ok";
                bllLog.Add(bllLog.WebsiteOwner, EnumApiModule.WeixinMessage, string.Format("发送微信消息\n标题:{0},内容:{1},链接:{2}", title, content, link), openId, userInfo.UserID, serialNumber);
            }
            else
            {
                resp.code = (int)APIErrCode.OperateFail;
                resp.msg  = "发送失败";
            }
            bllWeixin.ContextResponse(context, resp);
        }
示例#19
0
        public void ProcessRequest(HttpContext context)
        {
            string company         = context.Request["company"]; //公司名称
            string licence         = context.Request["licence"]; //营业执照
            string password        = context.Request["pwd"];     //密码
            string confirmPassword = context.Request["confirm_pwd"];

            if (string.IsNullOrEmpty(company))
            {
                apiResp.msg  = "请输入公司名称";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (string.IsNullOrEmpty(licence))
            {
                apiResp.msg  = "请上传你的营业执照";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete;
                bllUser.ContextResponse(context, apiResp);
            }
            if (string.IsNullOrEmpty(password) || string.IsNullOrEmpty(confirmPassword))
            {
                apiResp.msg  = "请输入密码";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete;
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            if (password != confirmPassword)
            {
                apiResp.msg  = "两次输入的密码不一致";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (password.Length < 6)
            {
                apiResp.msg  = "密码长度不少于6位";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            UserInfo userInfo = bllUser.GetUserInfoByCompany(company);

            if (userInfo != null)
            {
                apiResp.msg  = "公司名称重复";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsRepeat;
                bllUser.ContextResponse(context, apiResp);
                return;
            }


            string pattern = @"^[A-Za-z0-9]+$";
            Regex  regex   = new Regex(pattern);

            if (!regex.IsMatch(password))
            {
                apiResp.msg  = "密码只能为字母或者数字";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            string userId = "";

            try
            {
                userId = "JRWJ" + bllUser.GetNewGUID(bllUser.WebsiteOwner, "Company", 6);
            }
            catch (Exception ex)
            {
                apiResp.msg  = "生成id出错:" + ex.Message;
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.RegisterFailure;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            userInfo                   = new UserInfo();
            userInfo.UserID            = userId;
            userInfo.Password          = password;
            userInfo.UserType          = 6;//6公司  2普通用户
            userInfo.WebsiteOwner      = bllUser.WebsiteOwner;
            userInfo.Regtime           = DateTime.Now;
            userInfo.Company           = company;
            userInfo.TrueName          = company;
            userInfo.RegIP             = ZentCloud.Common.MySpider.GetClientIP();
            userInfo.LastLoginIP       = ZentCloud.Common.MySpider.GetClientIP();
            userInfo.LastLoginDate     = DateTime.Now;
            userInfo.LoginTotalCount   = 1;
            userInfo.MemberApplyStatus = 1;       //待审核
            userInfo.Ex3               = licence; //营业执照


            try
            {
                if (bllUser.Add(userInfo))
                {
                    bllUser.UpdateNewGUID(bllUser.WebsiteOwner, "Company");
                    apiResp.msg = "注册成功,您的公司账号为:" + userInfo.UserID;
                    context.Session[SessionKey.UserID]     = userInfo.UserID;
                    context.Session[SessionKey.LoginStatu] = 1;
                    apiResp.status = true;
                }
                else
                {
                    apiResp.msg  = "注册失败";
                    apiResp.code = (int)BLLJIMP.Enums.APIErrCode.RegisterFailure;
                }
            }
            catch (Exception ex)
            {
                apiResp.msg  = "添加账号出错:" + ex.Message;
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.RegisterFailure;
            }
            bllUser.ContextResponse(context, apiResp);
        }
示例#20
0
        public void ProcessRequest(HttpContext context)
        {
            string password        = context.Request["password"];//手机验证码
            string passwordConfirm = context.Request["passwordconfirm"];

            if (string.IsNullOrEmpty(password))
            {
                apiResp.msg = "Please Type new password";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (string.IsNullOrEmpty(passwordConfirm))
            {
                apiResp.msg = "Please Type new password again";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (password != passwordConfirm)
            {
                apiResp.msg = "our confirmed password and new password do not match";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (context.Session["Phone"] == null)
            {
                apiResp.msg = "Phone Is Null";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (context.Session["FindPasswordResult"] == null)
            {
                apiResp.msg = "FindPasswordResult Error";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            string phone = context.Session["Phone"].ToString();

            if (context.Session["FindPasswordResult"].ToString() == "true" && !string.IsNullOrEmpty(phone))
            {
                var userInfo = bllUser.GetUserInfoByPhone(phone, bllUser.WebsiteOwner);

                if (bllUser.Update(new BLLJIMP.Model.UserInfo(), string.Format(" Password='******'", password), string.Format(" AutoId={0}", userInfo.AutoID)) > 0)
                {
                    context.Session[SessionKey.LoginStatu] = 1;
                    context.Session[SessionKey.UserID]     = userInfo.UserID;
                    apiResp.status = true;
                }
                else
                {
                    apiResp.msg = "operation failed";
                    bllUser.ContextResponse(context, apiResp);
                    return;
                }
            }
            else
            {
                apiResp.msg = "Check Error";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            bllUser.ContextResponse(context, apiResp);
        }
示例#21
0
文件: Comment.ashx.cs 项目: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            var articleId = context.Request["articleid"];
            var content   = context.Request["content"];
            var replyId   = Convert.ToInt32(context.Request["replyid"]);//评论了文章里的哪个评论

            int isHideUserName = Convert.ToInt32(context.Request["ishideusername"]);

            currentUserInfo = bllUser.GetCurrentUserInfo();
            if (this.currentUserInfo == null)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.UserIsNotLogin;
                apiResp.msg  = "请先登录";
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            if (string.IsNullOrWhiteSpace(articleId) || string.IsNullOrWhiteSpace(content))
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete;
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            if (bllUser.GetCount <JuActivityInfo>(string.Format(" JuActivityID = {0} ", articleId)) == 0)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.ContentNotFound;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            //敏感词检查
            BLLFilterWord bllFilterWord = new BLLFilterWord();
            string        errmsg        = "";

            if (!bllFilterWord.CheckFilterWord(content, this.bllUser.WebsiteOwner, out errmsg, "0"))
            {
                apiResp.msg  = errmsg;
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            //添加评论
            int            reviewId = 0;
            JuActivityInfo article  = bll.GetJuActivity(int.Parse(articleId), true);

            BLLJIMP.Enums.ReviewTypeKey reviewType = BLLJIMP.Enums.ReviewTypeKey.ArticleComment;
            if (article.ArticleType == "Question")
            {
                reviewType = BLLJIMP.Enums.ReviewTypeKey.Answer;
            }
            var addResult = bllReview.AddReview(reviewType, articleId, replyId, this.currentUserInfo.UserID, "评论", content, this.bll.WebsiteOwner, out reviewId, isHideUserName);

            if (addResult)
            {
                if (reviewType == BLLJIMP.Enums.ReviewTypeKey.Answer)
                {
                    bllUser.AddUserScoreDetail(this.currentUserInfo.UserID, EnumStringHelper.ToString(ScoreDefineType.AnswerQuestions), this.bll.WebsiteOwner, null, null);
                }

                if (article.ArticleType == "Question")
                {
                    bllSystemNotice.SendNotice(BLLJIMP.BLLSystemNotice.NoticeType.QuestionIsAnswered, this.currentUserInfo, article, article.UserID, content);

                    List <UserInfo> users = bllUser.GetRelationUserList(BLLJIMP.Enums.CommRelationType.JuActivityFollow, articleId);
                    bllSystemNotice.SendNotice(BLLJIMP.BLLSystemNotice.NoticeType.FollowQuestionIsAnswered, this.currentUserInfo, article, users, content);
                }
                apiResp.status = true;
                apiResp.msg    = "评论完成";
                apiResp.result = reviewId.ToString();
                apiResp.code   = (int)BLLJIMP.Enums.APIErrCode.IsSuccess;
            }
            else
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = "评论出错";
            }
            bllReview.ContextResponse(context, apiResp);
        }
示例#22
0
        public void ProcessRequest(HttpContext context)
        {
            int pageIndex  = Convert.ToInt32(context.Request["pageindex"]),
                pageSize   = Convert.ToInt32(context.Request["pagesize"]);
            var articleId  = context.Request["articleid"];
            var userAutoId = context.Request["user_autoid"];
            var reviewType = context.Request["review_type"];

            currentUserInfo = bllUser.GetCurrentUserInfo();

            var totalCount = 0;

            BLLJIMP.Enums.ReviewTypeKey nType = BLLJIMP.Enums.ReviewTypeKey.ArticleComment;
            if (string.IsNullOrWhiteSpace(reviewType) && !string.IsNullOrWhiteSpace(articleId))
            {
                int            artId    = Convert.ToInt32(articleId);
                JuActivityInfo juArtcle = bll.GetJuActivity(artId);
                if (juArtcle.ArticleType.ToLower() == "question")
                {
                    nType = BLLJIMP.Enums.ReviewTypeKey.Answer;
                }
            }
            else
            {
                Enum.TryParse(reviewType, out nType);
            }
            string userId = "";

            if (!string.IsNullOrWhiteSpace(userAutoId))
            {
                UserInfo user = bllUser.GetUserInfoByAutoID(int.Parse(userAutoId));
                if (user != null)
                {
                    userId = user.UserID;
                }
                else
                {
                    userId = "-1";
                }
            }
            //仅显示审核通过的
            var sourceData = this.bllReview.GetReviewList(nType, out totalCount, pageIndex, pageSize, articleId, this.bll.WebsiteOwner, this.currentUserInfo == null ? "" : this.currentUserInfo.UserID, "", userId);

            List <dynamic> returnList = new List <dynamic>();

            foreach (var item in sourceData)
            {
                int actId = 0;
                int.TryParse(item.Expand1, out actId);
                JuActivityInfo actInfo = bll.GetJuActivity(actId);
                returnList.Add(new
                {
                    id               = item.ReviewMainId,
                    content          = item.ReviewContent,
                    createDate       = item.InsertDate.ToString(),
                    replyCount       = item.ReplyCount,  //回复数
                    praiseCount      = item.PraiseCount, //点赞数
                    pv               = item.Pv,          //浏览数
                    currUserIsPraise = item.CurrUserIsPraise,
                    articleId        = actInfo != null ? actInfo.JuActivityID : 0,
                    articleName      = actInfo != null ? actInfo.ActivityName : "",
                    pubUser          = new
                    {
                        id       = item.PubUser == null ? 0 : item.PubUser.AutoID,
                        userId   = item.PubUser == null ? "" : item.PubUser.UserID,
                        userName = item.PubUser == null ? "" : bllUser.GetUserDispalyName(item.PubUser),
                        avatar   = item.PubUser == null ? "" : bllUser.GetUserDispalyAvatar(item.PubUser),
                        isTutor  = item.PubUser == null ? false : bllUser.IsTutor(item.PubUser)
                    },
                    replayToUser = new
                    {
                        id       = item.ReplayToUser == null ? 0 : item.ReplayToUser.AutoID,
                        userId   = item.ReplayToUser == null ? "" : item.ReplayToUser.UserID,
                        userName = item.ReplayToUser == null ? "" : bllUser.GetUserDispalyName(item.ReplayToUser),
                        avatar   = item.ReplayToUser == null ? "" : bllUser.GetUserDispalyAvatar(item.ReplayToUser),
                        isTutor  = item.ReplayToUser == null ? false : bllUser.IsTutor(item.ReplayToUser)
                    }
                });
            }

            dynamic result = new
            {
                totalcount = totalCount,
                list       = returnList
            };

            apiResp.status = true;
            apiResp.msg    = "查询完成";
            apiResp.result = result;
            bllUser.ContextResponse(context, apiResp);
        }
示例#23
0
        public void ProcessRequest(HttpContext context)
        {
            var commentId      = context.Request["commentid"];
            var replyId        = Convert.ToInt32(context.Request["replyid"]);//回复了评论里的哪个回复
            var content        = context.Request["content"];
            int isHideUserName = Convert.ToInt32(context.Request["isHideUserName"]);

            currentUserInfo = bllUser.GetCurrentUserInfo();
            if (this.currentUserInfo == null)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.UserIsNotLogin;
                apiResp.msg  = "请先登录";
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            if (string.IsNullOrWhiteSpace(commentId) || string.IsNullOrWhiteSpace(content))
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete;
                bllReview.ContextResponse(context, apiResp);
                return;
            }


            if (bllReview.GetCount <ReviewInfo>(string.Format(" ReviewMainId = {0} ", commentId)) == 0)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.ContentNotFound;
                bllReview.ContextResponse(context, apiResp);
                return;
            }

            //敏感词检查
            BLLFilterWord bllFilterWord = new BLLFilterWord();
            string        errmsg        = "";

            if (!bllFilterWord.CheckFilterWord(content, this.bllReview.WebsiteOwner, out errmsg, "0"))
            {
                apiResp.msg  = errmsg;
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                bllReview.ContextResponse(context, apiResp);
                return;
            }

            //添加回复

            int reviewId = 0;

            var addResult = bllReview.AddReview(BLLJIMP.Enums.ReviewTypeKey.CommentReply, commentId, replyId, this.currentUserInfo.UserID, "评论", content, this.bllReview.WebsiteOwner, out reviewId, isHideUserName);

            if (addResult)
            {
                apiResp.status = true;
                apiResp.result = reviewId.ToString();

                if (bllUser.IsTutor(this.currentUserInfo.UserID))
                {
                    bllTutor.UpdateAnswers(this.currentUserInfo.UserID);
                }
            }
            else
            {
                apiResp.status = false;
            }
            bllReview.ContextResponse(context, apiResp);
        }
示例#24
0
文件: List.ashx.cs 项目: uvbs/mmp
        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"]) : 5;
            string date      = context.Request["time"];

            if (string.IsNullOrEmpty(date))
            {
                apiResp.msg  = "time 为必填项,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            System.DateTime myTime              = DateTimeHelper.UnixTimestampToDateTime(long.Parse(date));
            int             totalCount          = 0;
            List <UserCreditAcountDetails> list = bllUser.GetUserCreditAcountDetailsByMonth(pageIndex, pageSize, bllUser.GetCurrUserID(), myTime, out totalCount);

            apiResp.status = true;
            List <dynamic> returnList = new List <dynamic>();

            foreach (UserCreditAcountDetails item in list)
            {
                switch (item.Type)
                {
                case "ApplyCost":    //报名消耗信用
                    returnList.Add(new
                    {
                        title         = "你报名了一个约会",
                        credit_acount = item.CreditAcount,
                        create_time   = DateTimeHelper.DateTimeToUnixTimestamp(item.AddTime)
                    });
                    break;

                case "ApplyReturn":    //报名未通过解冻(返还)信用
                    returnList.Add(new
                    {
                        title         = "你报名的约会未通过",
                        credit_acount = item.CreditAcount,
                        create_time   = DateTimeHelper.DateTimeToUnixTimestamp(item.AddTime)
                    });
                    break;

                case "PublishCost":    //发布消耗信用
                    returnList.Add(new
                    {
                        title         = "你发布了一个约会",
                        credit_acount = item.CreditAcount,
                        create_time   = DateTimeHelper.DateTimeToUnixTimestamp(item.AddTime)
                    });
                    break;

                case "Recharge":    //充值获得信用
                    returnList.Add(new
                    {
                        title         = "你的银行卡" + item.CreditAcount + "充值成功",
                        credit_acount = item.CreditAcount,
                        create_time   = DateTimeHelper.DateTimeToUnixTimestamp(item.AddTime)
                    });
                    break;

                case "ReturnPublisher":    //无人报名返还信用金
                    returnList.Add(new
                    {
                        title         = "你发起的约会无人报名",
                        credit_acount = item.CreditAcount,
                        create_time   = DateTimeHelper.DateTimeToUnixTimestamp(item.AddTime)
                    });
                    break;

                case "SignReturn":    //签到返还信用
                    returnList.Add(new
                    {
                        title         = "签到返还",
                        credit_acount = item.CreditAcount,
                        create_time   = DateTimeHelper.DateTimeToUnixTimestamp(item.AddTime)
                    });
                    break;

                default:
                    break;
                }
            }
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = returnList
            };
            bllUser.ContextResponse(context, apiResp);
        }