Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userModel = DataLoadTool.GetCurrUserModel();
            juBll     = new BLLJIMP.BLLJuActivity();
            //获取活动ID
            int jid = Convert.ToInt32(Request["jid"], 16);//由16进制转换

            pubjid          = Request["jid"];
            juActivityModel = juBll.GetJuActivity(jid);

            //判断权限
            if (this.userModel.UserType != 1)
            {
                if (juActivityModel.UserID != this.userModel.UserID)
                {
                    Response.Write("<script>alert('无权访问该贺卡!');</script>");
                    Response.End();
                    return;
                }
            }

            try
            {
                //获取活动报名数据
                signUpDataList = this.juBll.QueryJuActivitySignUpData(jid);
            }
            catch { }

            if (signUpDataList == null)
            {
                signUpDataList = new List <BLLJIMP.Model.ActivityDataInfo>();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            currUser       = DataLoadTool.GetCurrUserModel();
            cateRootId     = Convert.ToInt32(Request["cateRootId"]);
            isNoPreSelect  = Convert.ToInt32(Request["isNoPreSelect"]);
            selectMaxDepth = Convert.ToInt32(Request["selectMaxDepth"]);
            if (selectMaxDepth.Equals(0))
            {
                selectMaxDepth = int.MaxValue;
            }
            isHide = bllMenupermission.CheckPerRelationByaccount(bllUser.GetCurrUserID(), -1);

            //是否传入了名称
            var inputShowName = Request["currShowName"];

            hasKeyValue = Request["hasKeyValue"];
            if (!string.IsNullOrWhiteSpace(inputShowName))
            {
                currShowName        = inputShowName;
                nCategoryTypeConfig = new ArticleCategoryTypeConfig();
                return;
            }

            //检查配置取名称
            CategoryType        = Request["type"];
            nCategoryTypeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, CategoryType);
            if (nCategoryTypeConfig != null)
            {
                currShowName = nCategoryTypeConfig.CategoryTypeExDispalyName;
            }
            else
            {
                currShowName = "分类"; nCategoryTypeConfig = new ArticleCategoryTypeConfig();
            }
        }
Exemple #3
0
        //private string EditUserInfoByOpenId(HttpContext context)
        //{
        //    //获取编辑数据
        //    string openId = context.Request["openId"];
        //    string Name = context.Request["Name"];
        //    string Phone = context.Request["Phone"];
        //    string Email = context.Request["Email"];
        //    string Company = context.Request["Company"];
        //    string Postion = context.Request["Postion"];
        //    string ArticleSourceType = context.Request["ArticleSourceType"];
        //    string ArticleSourceWXHao = context.Request["ArticleSourceWXHao"];
        //    string ArticleSourceWebSite = context.Request["ArticleSourceWebSite"];
        //    string ArticleSourceName = context.Request["ArticleSourceName"];

        //    //格式判断
        //    if (!string.IsNullOrWhiteSpace(Phone) && !Common.ValidatorHelper.PhoneNumLogicJudge(Phone))
        //    {
        //        resp.Status = 0;
        //        resp.Msg = "手机号码格式错误!";
        //        return Common.JSONHelper.ObjectToJson(resp);
        //    }
        //    if (!string.IsNullOrWhiteSpace(Email) && !Common.ValidatorHelper.EmailLogicJudge(Email))
        //    {
        //        resp.Status = 0;
        //        resp.Msg = "邮箱地址错误!";
        //        return Common.JSONHelper.ObjectToJson(resp);
        //    }

        //    if (this.userInfo.UserType != 1)
        //    {
        //        if (openId != this.userInfo.WXOpenId)
        //        {
        //            resp.Status = 0;
        //            resp.Msg = "无权更改他人的信息!";
        //            return Common.JSONHelper.ObjectToJson(resp);
        //        }
        //    }

        //    BLLJIMP.Model.UserInfo editUser = this.userBll.GetUserInfoByOpenId(openId);

        //    if (editUser == null)
        //    {
        //        resp.Status = 0;
        //        resp.Msg = "用户不存在!";
        //        return Common.JSONHelper.ObjectToJson(resp);
        //    }

        //    editUser.TrueName = Name;

        //    //修改了手机号则验证失效,需要重新验证
        //    if (editUser.Phone != Phone)
        //    {
        //        editUser.Phone = Phone;
        //        editUser.IsPhoneVerify = 0;
        //    }

        //    editUser.Email = Email;
        //    editUser.Company = Company;
        //    editUser.Postion = Postion;
        //    editUser.ArticleSourceType = ArticleSourceType;
        //    editUser.ArticleSourceWebSite = ArticleSourceWebSite;
        //    editUser.ArticleSourceWXHao = ArticleSourceWXHao;
        //    editUser.ArticleSourceName = ArticleSourceName;

        //    if (this.userBll.Update(editUser))
        //    {
        //        resp.Status = 1;
        //        resp.Msg = "成功更新!";
        //        return Common.JSONHelper.ObjectToJson(resp);
        //    }
        //    else
        //    {
        //        resp.Status = 0;
        //        resp.Msg = "更新失败!";
        //        return Common.JSONHelper.ObjectToJson(resp);
        //    }

        //}

        ///// <summary>
        ///// 获取当前用户
        ///// </summary>
        ///// <param name="context"></param>
        ///// <returns></returns>
        //private string GetUserInfov(HttpContext context)
        //{
        //    //BLLJIMP.Model.UserInfo result = this.userBll.GetUserInfoByOpenId(context.Request[SessionKey.systemset.WXCurrOpenerOpenIDKey]);
        //    resp.Status = 1;
        //    resp.ExObj = currentUserInfo;
        //    return ZentCloud.Common.JSONHelper.ObjectToJson(resp);
        //}


        private string GetUserInfoByOpenId(HttpContext context)
        {
            BLLJIMP.Model.UserInfo userInfo = this.userBll.GetUserInfoByOpenId(context.Request[SessionKey.systemset.WXCurrOpenerOpenIDKey]);
            resp.Status = 1;
            resp.ExObj  = userInfo;
            return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                UserId = Request["UserId"];
                if (!string.IsNullOrEmpty(UserId))
                {
                    BLLJIMP.Model.UserInfo uinfo = bllUser.GetCurrentUserInfo();
                    bllUserScore = new BLLUserScore(uinfo.UserID);
                    //uInfo = DataLoadTool.GetCurrUserModel();
                    GetTutor(UserId);
                    GetTagStr();
                    // BLLJuActivity juActivityBll = new BLLJuActivity();

                    if (string.IsNullOrEmpty(uinfo.TrueName) || string.IsNullOrEmpty(uinfo.Phone))
                    {
                        isUserRegistered = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Response.End();
            }
            //if (!IsPostBack)
            //{

            // }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                BLLJIMP.Model.UserInfo uinfo = bll.GetCurrentUserInfo();
                if (string.IsNullOrEmpty(uinfo.TrueName) || string.IsNullOrEmpty(uinfo.Phone))
                {
                    isUserRegistered = false;
                }

                AutoId = Request["id"];
                if (!string.IsNullOrEmpty(AutoId))
                {
                    GetPosition();

                    var List = bll.GetList <ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType in ('trade','Professional')", bll.WebsiteOwner));
                    TradeList        = List.Where(p => p.CategoryType.Equals("trade")).ToList();
                    ProfessionalList = List.Where(p => p.CategoryType.Equals("Professional")).ToList();
                    IsApply          = bll.GetCount <ApplyPositionInfo>(string.Format("UserId='{0}' And PositionId={1}", DataLoadTool.GetCurrUserID(), AutoId)) > 0 ? true : false;
                }
            }
            catch (Exception)
            {
                Response.End();
            }
        }
Exemple #6
0
 protected override void OnInit(EventArgs e)
 {
     BLLJIMP.Model.UserInfo uinfo = DataLoadTool.GetCurrUserModel();
     if (string.IsNullOrEmpty(uinfo.TrueName) && string.IsNullOrEmpty(uinfo.Phone) && string.IsNullOrEmpty(uinfo.Email))
     {
         Response.Redirect("/WuBuHui/Member/Registration.aspx?from=" + Request.RawUrl);
     }
     base.OnInit(e);
 }
Exemple #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     currUserInfo          = DataLoadTool.GetCurrUserModel();
     currWebSiteModel      = DataLoadTool.GetWebsiteInfoModel();
     currWebSiteOwnerModel = new BLLJIMP.BLLUser("").GetUserInfo(currWebSiteModel.WebsiteOwner);
     signUpLoginName       = Common.Base64Change.EncodeBase64ByUTF8(currWebSiteOwnerModel.UserID);
     signUploginPwd        = Common.DEncrypt.ZCEncrypt(currWebSiteOwnerModel.Password);
     GetPageActionType();
 }
Exemple #8
0
        public void ProcessRequest(HttpContext context)
        {
            string phone        = context.Request["phone"];
            string vcode        = context.Request["vcode"];
            string websiteOwner = bllUser.WebsiteOwner;

            var lastSmsVerCode = bllSms.GetLastSmsVerificationCode(phone);

            if (lastSmsVerCode == null)
            {
                apiResp.code = (int)APIErrCode.CheckCodeErr;
                apiResp.msg  = "请先获取手机验证码";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (lastSmsVerCode.VerificationCode != vcode)
            {
                apiResp.code = (int)APIErrCode.CheckCodeErr;
                apiResp.msg  = "手机验证码错误";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if ((DateTime.Now - lastSmsVerCode.InsertDate).TotalMinutes >= 5)
            {
                apiResp.code = (int)APIErrCode.CheckCodeErr;
                apiResp.msg  = "手机验证码已过期,请重新获取";
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            BLLJIMP.Model.UserInfo ouser = bllUser.GetUserInfoByPhone(phone, websiteOwner);
            ouser.Password = ZentCloud.Common.Rand.Number(6);
            bool   smsBool = false;
            string smsMsg  = "";

            BLLJIMP.Model.WebsiteInfo website = bllUser.GetWebsiteInfoModelFromDataBase(websiteOwner);
            bllSms.SendSmsMisson(ouser.Phone, "您的密码是:" + ouser.Password, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), website.SmsSignature, out smsBool, out smsMsg);
            if (!smsBool)
            {
                apiResp.code = (int)APIErrCode.OperateFail;
                apiResp.msg  = "发送短信密码失败";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (bllUser.Update(ouser, string.Format("Password='******'", ouser.Password),
                               string.Format("AutoID={0}", ouser.AutoID)) <= 0)
            {
                apiResp.code = (int)APIErrCode.OperateFail;
                apiResp.msg  = "重置失败";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            apiResp.status = true;
            apiResp.code   = (int)APIErrCode.IsSuccess;
            apiResp.msg    = "重置完成,新密码将发送到您的手机";
            bllUser.ContextResponse(context, apiResp);
        }
Exemple #9
0
        public void ProcessRequest(HttpContext context)
        {
            int rows            = Convert.ToInt32(context.Request["rows"]),
                page            = Convert.ToInt32(context.Request["page"]);
            string for_id       = context.Request["for_id"],
                   ex_id        = context.Request["ex_id"],
                   keyword      = context.Request["keyword"],
                   type         = context.Request["type"],
                   status       = context.Request["status"];
            string websiteOwner = bllReview.WebsiteOwner;

            var total = 0;
            //评论
            List <BLLJIMP.Model.ReviewInfo> sourceData = bllReview.GetActReviewList(out total, page, rows, for_id, keyword, "", type, ex_id, status
                                                                                    , "AutoId,ReviewMainId,UserId,ReviewContent,InsertDate,ReviewScore,CommentImg,ForeignkeyId,Expand1,Ex2");

            List <dynamic> returnList           = new List <dynamic>();
            List <BLLJIMP.Model.UserInfo> users = new List <BLLJIMP.Model.UserInfo>();

            foreach (var item in sourceData)
            {
                BLLJIMP.Model.UserInfo pubUser = users.FirstOrDefault(p => p.UserID == item.UserId);
                if (pubUser == null)
                {
                    pubUser = bllUser.GetUserInfo(item.UserId, websiteOwner);
                    if (pubUser != null)
                    {
                        users.Add(pubUser);
                    }
                }
                WXMallOrderDetailsInfo orderDetails = bllReview.Get <WXMallOrderDetailsInfo>(string.Format(" AutoID={0} ", !string.IsNullOrEmpty(item.Ex2)?item.Ex2:"0"));

                returnList.Add(new
                {
                    id           = item.ReviewMainId,
                    content      = item.ReviewContent,
                    time         = ZentCloud.Common.DateTimeHelper.DateTimeToUnixTimestamp(item.InsertDate),
                    review_score = item.ReviewScore,
                    comment_img  = item.CommentImg,
                    showprops    = orderDetails == null?"":orderDetails.SkuShowProp,
                    pub_user     = pubUser == null? null: new {
                        id     = pubUser.AutoID,
                        avatar = bllUser.GetUserDispalyAvatar(pubUser),
                        name   = bllUser.GetUserDispalyName(pubUser)
                    }
                });
            }
            apiResp.status = true;
            apiResp.code   = (int)BLLJIMP.Enums.APIErrCode.IsSuccess;
            apiResp.result = new
            {
                totalcount = total,
                list       = returnList
            };
            bllReview.ContextResponse(context, apiResp);
        }
Exemple #10
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);
 }
Exemple #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Uid   = Request["UserId"];
         Url   = Request["from"];
         uinfo = DataLoadTool.GetCurrUserModel();
         if (!string.IsNullOrEmpty(uinfo.TrueName) && !string.IsNullOrEmpty(uinfo.Phone) && !string.IsNullOrEmpty(uinfo.Email) && !string.IsNullOrEmpty(uinfo.Company))
         {
             Response.Redirect("/WuBuHui/MyCenter/MyCenter.aspx");
         }
     }
 }
Exemple #12
0
        /// <summary>
        /// 检查登录凭据
        /// </summary>
        private void ChcekQRcodeLoginTiket()
        {
            string tiketKey = this.ViewState["tiket"].ToString();

            if (string.IsNullOrWhiteSpace(tiketKey))
            {
                resp.Status = -1;
                resp.Msg    = "登录凭据不能为空!";
                return;
            }


            if (Common.DataCache.GetCache(tiketKey) == null)
            {
                resp.Status = -1;
                resp.Msg    = "登录凭据不存在!";
                return;
            }


            string tiketValue = Common.DataCache.GetCache(tiketKey).ToString();

            resp.Msg = "tiketValue:" + tiketValue;

            if (string.IsNullOrWhiteSpace(tiketValue))
            {
                resp.Status = -1;
                resp.Msg    = "登录凭据不存在!";
                return;
            }

            if (tiketValue.EndsWith("-login"))
            {
                resp.Status = 1;
                resp.Msg    = "登录成功!";
                //获取登录用户,并设置登录状态
                string userIdCache = Common.DataCache.GetCache(tiketKey + "-user").ToString();
                BLLJIMP.Model.UserInfo loginUser = this.userBll.GetUserInfo(userIdCache);
                Session[ZentCloud.Common.SessionKey.LoginStatu] = 1;
                Session[ZentCloud.Common.SessionKey.UserID]     = loginUser.UserID;
                Session[ZentCloud.Common.SessionKey.UserType]   = loginUser.UserType;
                //this.userBll.AddLoginLogs(loginUser.UserID);
                //销毁登录凭据及相关数据
                //Common.DataCache.ClearCache(tiketKey);
                //Common.DataCache.ClearCache(tiketKey + "-user");
                return;
            }

            resp.Status = 0;
        }
Exemple #13
0
 public string GetImg(object openId)
 {
     BLLJIMP.Model.UserInfo userInfo = juActivityBll.Get <BLLJIMP.Model.UserInfo>(string.Format(" WXOpenId='{0}'", openId));
     if (userInfo != null)
     {
         if (string.IsNullOrEmpty(userInfo.WXHeadimgurl))
         {
             return("style/images/6.png");
         }
         else
         {
             return(userInfo.WXHeadimgurl);
         }
     }
     return("style/images/6.png");
 }
Exemple #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         uinfo        = DataLoadTool.GetCurrUserModel();
         bllUserScore = new BLLJIMP.BLLUserScore(uinfo.UserID);
         BLLJIMP.BLL bll = new BLLJIMP.BLL();
         txtCount.Text       = bll.GetCount <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' and TypeName = '分享'", uinfo.UserID)).ToString();
         IsShowRed           = bll.GetCount <BLLJIMP.Model.ReviewInfo>(string.Format("ForeignkeyId='{0}' and IsRead <> 1", uinfo.UserID)) > 0 ? true : false;
         UserLevel           = bllUserScore.GetUserLevelByTotalScore(uinfo.HistoryTotalScore);
         FlowerCount         = bllUser.GetUserFlowerCount(uinfo.UserID);
         AttentionCount      = bllUser.GetUserAttentionCount(uinfo.UserID);
         IsHaveUnReadMessage = bllNotice.IsHaveUnReadMessage(bll.GetCurrentUserInfo().UserID).ToString();
         IsTutor             = bllUser.IsTutor(uinfo);
     }
 }
Exemple #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             BLLJIMP.Model.UserInfo CurrentUserInfo = DataLoadTool.GetCurrUserModel();
             int id = Convert.ToInt32(Request["id"]);
             Convert.ToString(id, 16);
             Response.Redirect(string.Format("http://{0}/{1}/{2}/details.chtml", this.Request.Url.Host + ":" + this.Request.Url.Port, Convert.ToString(id, 16), Convert.ToString(CurrentUserInfo.AutoID, 16)));
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Exemple #16
0
        private void GetCType()
        {
            this.websiteOwner = DataLoadTool.GetWebsiteInfoModel().WebsiteOwner;
            this.uinfo        = DataLoadTool.GetCurrUserModel();
            List <BLLJIMP.Model.ArticleCategory> acategorys = bll.GetList <BLLJIMP.Model.ArticleCategory>(string.Format(" CategoryType='word'AND WebsiteOwner='{0}'", this.websiteOwner));

            if (acategorys != null)
            {
                foreach (BLLJIMP.Model.ArticleCategory item in acategorys)
                {
                    DisussStr += "<li class=\"catli\" v=\"" + item.AutoID + "\"><a >" + item.CategoryName + "</a></li>";
                }
            }

            //设置用户所有话题为已读
            BLLJIMP.BLL.ExecuteSql(string.Format("update ZCJ_ReviewInfo set IsRead = 1 where ForeignkeyId='{0}' and IsRead <> 1 and websiteowner='{1}'",
                                                 uinfo.UserID, websiteOwner));
        }
Exemple #17
0
        public void GetMsgCount()
        {
            try
            {
                BLLJIMP.BLLSystemNotice bll      = new BLLJIMP.BLLSystemNotice();
                BLLJIMP.Model.UserInfo  userInfo = bll.GetCurrentUserInfo();
                ReviewCount        = bll.GetUnReadMsgCount(userInfo.UserID, BLLJIMP.BLLSystemNotice.NoticeType.ReviewReminder);
                SystemMessageCount = bll.GetUnReadMsgCount(userInfo.UserID, BLLJIMP.BLLSystemNotice.NoticeType.SystemMessage);
                QuestionaryCount   = bll.GetUnReadMsgCount(userInfo.UserID, BLLJIMP.BLLSystemNotice.NoticeType.QuestionaryReminder);

                SysteMessageTime = bll.GetUnReadMsgTime(userInfo.UserID, BLLJIMP.BLLSystemNotice.NoticeType.SystemMessage).ToString();
                ReviewTime       = bll.GetUnReadMsgTime(userInfo.UserID, BLLJIMP.BLLSystemNotice.NoticeType.ReviewReminder).ToString();
                QuestionaryTime  = bll.GetUnReadMsgTime(userInfo.UserID, BLLJIMP.BLLSystemNotice.NoticeType.QuestionaryReminder).ToString();
            }
            catch
            {
            }
        }
Exemple #18
0
 /// <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);
     }
 }
Exemple #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     uinfo = bllUser.GetCurrentUserInfo();
 }
Exemple #20
0
        public void ProcessRequest(HttpContext context)
        {
            BLLJIMP.BLLDistributionOffLine bll = new BLLJIMP.BLLDistributionOffLine();
            BLLJIMP.BLLUser bllUser            = new BLLJIMP.BLLUser();

            int page = !string.IsNullOrEmpty(context.Request["page"]) ? int.Parse(context.Request["page"]) : 1;  //页码
            int rows = !string.IsNullOrEmpty(context.Request["rows"]) ? int.Parse(context.Request["rows"]) : 10; //页数

            string userId       = "";
            string keyword      = context.Request["keyword"];
            string websiteowner = bllUser.WebsiteOwner;

            if (!string.IsNullOrWhiteSpace(keyword))
            {
                BLLJIMP.Model.UserInfo u = bllUser.GetUserInfo(keyword, websiteowner);
                if (u != null)
                {
                    userId = u.UserID;
                }
                if (string.IsNullOrWhiteSpace(userId))
                {
                    u = bllUser.GetUserInfoByPhone(keyword, websiteowner);
                    if (u != null)
                    {
                        userId = u.UserID;
                    }
                }
                if (string.IsNullOrWhiteSpace(userId))
                {
                    List <BLLJIMP.Model.UserInfo> ul = bllUser.GetUsersByLikeName(keyword, websiteowner);
                    if (ul.Count > 1)
                    {
                        userId = ZentCloud.Common.MyStringHelper.ListToStr(ul.Select(p => p.UserID).ToList(), "'", ",");
                    }
                    else if (ul.Count == 1)
                    {
                        userId = ul[0].UserID;
                    }
                }

                if (string.IsNullOrWhiteSpace(userId))
                {
                    userId = "-999";
                }
            }
            int            total      = 0;
            var            sourceList = bll.QueryWithdrawCashList(page, rows, userId, out total, context.Request["status"], context.Request["type"]);
            List <dynamic> list       = new List <dynamic>();

            if (sourceList.Count > 0)
            {
                foreach (var p in sourceList)
                {
                    BLLJIMP.Model.UserInfo u = bllUser.GetUserInfo(p.UserId, websiteowner);
                    list.Add(new
                    {
                        id       = p.AutoID,
                        amount   = p.Amount,                       //金额
                        status   = ConvertStatus(p.Status),        //状态
                        time     = bll.GetTimeStamp(p.InsertDate), //时间
                        score    = p.Score,
                        username = u == null ? p.UserId : bllUser.GetUserDispalyName(u)
                    });
                }
            }
            apiResp.status = true;
            apiResp.code   = (int)APIErrCode.IsSuccess;
            apiResp.msg    = "ok";
            apiResp.result = new{
                totalcount = total,
                list       = list
            };

            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
Exemple #21
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            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.activity_id <= 0)
            {
                resp.errmsg  = "activity_id 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.activity_name))
            {
                resp.errmsg  = "activity_name 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.activity_address))
            {
                resp.errmsg  = "activity_address 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (requestModel.activity_start_time <= 0)
            {
                resp.errmsg  = "activity_start_time 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (requestModel.activity_stop_time <= 0)
            {
                resp.errmsg  = "activity_stop_time 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.activity_img_url))
            {
                resp.errmsg  = "activity_img_url 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.activity_content))
            {
                resp.errmsg  = "activity_content 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            BLLJIMP.Model.JuActivityInfo model = bllActivity.Get <BLLJIMP.Model.JuActivityInfo>(string.Format(" JuActivityID={0} ", requestModel.activity_id));
            if (model == null)
            {
                resp.errmsg  = "活动不存在";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            BLLJIMP.Model.UserInfo userInfo = bllUser.GetUserInfo(bllUser.GetCurrUserID());
            model.ActivityName      = requestModel.activity_name;
            model.ActivityStartDate = bllUser.GetTime(requestModel.activity_start_time);
            model.ActivityEndDate   = bllUser.GetTime(requestModel.activity_stop_time);
            //model.ActivityEndDate = new DateTime(1970, 1, 1);

            model.ActivityAddress     = requestModel.activity_address;
            model.ActivityWebsite     = bllUser.WebsiteOwner;
            model.ActivityDescription = requestModel.activity_content;
            model.ThumbnailsPath      = requestModel.activity_img_url;

            //model.RecommendCate = context.Request["RecommendCate"];
            model.IsHide = requestModel.activity_status;
            model.Sort   = requestModel.activity_sort;
            // model.IsFee = Convert.ToInt32(context.Request["IsFee"]);
            //model.ArticleTemplate = Convert.ToInt32(context.Request["ArticleTemplate"]);
            //model.ActivityLecturer = context.Request["ActivityLecturer"];
            // model.IsByWebsiteContent = Convert.ToInt32(context.Request["IsByWebsiteContent"]);

            // model.TopImgPath = context.Request["TopImgPath"];
            model.ActivityIntegral = requestModel.activity_score;
            //model.SignUpActivityID = context.Request["SignUpActivityID"];活动ID默认创建,不给编辑了
            // model.IsSpread = Convert.ToInt32(context.Request["IsSpread"]);

            bool isAddSignUpplan = false;

            // model.ArticleType = context.Request["ArticleType"];

            //model.ArticleTypeEx1 = context.Request["ArticleTypeEx1"];
            model.LastUpdateDate = DateTime.Now;
            model.Summary        = requestModel.activity_summary
            ;
            //string IsHideRecommend = context.Request["IsHideRecommend"];
            //if (!string.IsNullOrEmpty(IsHideRecommend))
            //{
            //    model.IsHideRecommend = IsHideRecommend;
            //}
            //model.ActivityNoticeKeFuId = context.Request["ActivityNoticeKeFuId"];
            model.CategoryId = requestModel.category_id.ToString();
            //model.IsShowPersonnelList = int.Parse(string.IsNullOrEmpty(context.Request["IsShowPersonnelList"]) ? "0" : context.Request["IsShowPersonnelList"]);
            //model.ShowPersonnelListType = int.Parse(string.IsNullOrEmpty(context.Request["ShowPersonnelListType"]) ? "0" : context.Request["ShowPersonnelListType"]);
            model.MaxSignUpTotalCount = requestModel.activity_max_signup_count;



            model.Tags         = requestModel.activity_tags;
            model.K1           = requestModel.activity_ex1;
            model.K2           = requestModel.activity_ex2;
            model.K3           = requestModel.activity_ex3;
            model.K4           = requestModel.activity_ex4;
            model.K5           = requestModel.activity_ex5;
            model.K6           = requestModel.activity_ex6;
            model.K7           = requestModel.activity_ex7;
            model.K8           = requestModel.activity_ex8;
            model.K9           = requestModel.activity_ex9;
            model.K10          = requestModel.activity_ex10;
            model.ProvinceCode = requestModel.province_code;
            model.CityCode     = requestModel.province_code;
            model.DistrictCode = requestModel.province_code;
            model.RootCateId   = requestModel.rootcate_id;

            model.AccessLevel = requestModel.activity_access_level;

            List <string> tagList = null;

            if (!string.IsNullOrWhiteSpace(model.Tags))
            {
                tagList = model.Tags.Split(',').ToList();
            }

            bllActivity.SetJuActivityContentTags(model.JuActivityID, tagList);

            model.PV = requestModel.activity_pv;

            if (model.ActivityEndDate <= model.ActivityStartDate)
            {
                resp.errcode = -1;
                resp.errmsg  = "结束时间要大于开始时间";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            //如果ArticleType类型是article,则IsSignUpJubit都为0;
            if (model.ArticleType == "article")
            {
                model.IsSignUpJubit = 0;
            }
            else
            {
                //如果由其他状态编辑更改为自动报名状态,则重新自动创建任务
                int isSignUpJubit = requestModel.activity_issignupjubit;
                if (model.IsSignUpJubit != 1 && isSignUpJubit == 1)
                {
                    isAddSignUpplan = true;
                }

                model.IsSignUpJubit = isSignUpJubit;
            }
            if (isAddSignUpplan)
            {
                ZCBLLEngine.BLLTransaction tran = new ZCBLLEngine.BLLTransaction();

                try
                {
                    ActivityInfo signUpActivityModel = bllActivity.CreateSignUpActivityModelByJuActivity(model, userInfo.UserID);
                    model.SignUpActivityID           = signUpActivityModel.ActivityID;
                    signUpActivityModel.WebsiteOwner = bllActivity.WebsiteOwner;

                    //添加默认字段
                    List <ActivityFieldMappingInfo> fieldData = new List <ActivityFieldMappingInfo>()
                    {
                        new ActivityFieldMappingInfo()
                        {
                            ActivityID     = model.SignUpActivityID,
                            ExFieldIndex   = 1,
                            FieldIsDefauld = 0,
                            FieldType      = 0,
                            FormatValiFunc = "email",
                            MappingName    = "邮箱"
                        },
                        new ActivityFieldMappingInfo()
                        {
                            ActivityID     = model.SignUpActivityID,
                            ExFieldIndex   = 2,
                            FieldIsDefauld = 0,
                            FieldType      = 0,
                            MappingName    = "公司"
                        },
                        new ActivityFieldMappingInfo()
                        {
                            ActivityID     = model.SignUpActivityID,
                            ExFieldIndex   = 3,
                            FieldIsDefauld = 0,
                            FieldType      = 0,
                            MappingName    = "职位"
                        }
                    };
                    if (!bllActivity.AddList(fieldData))
                    {
                        tran.Rollback();
                    }
                    else
                    {
                        if (bllActivity.Update(model, tran) && bllActivity.Add(signUpActivityModel, tran))
                        {
                            tran.Commit();
                            resp.errmsg    = "ok";
                            resp.errcode   = 0;
                            resp.isSuccess = true;
                        }
                        else
                        {
                            tran.Rollback();
                        }
                    }
                }
                catch (Exception ex)
                {
                    tran.Rollback();
                    resp.errmsg = ex.Message;
                }
            }
            else
            {
                if (this.bllActivity.Update(model))
                {
                    resp.errcode   = 0;
                    resp.errmsg    = "ok";
                    resp.isSuccess = true;
                }
            }



            if (bllActivity.Update(model))
            {
                resp.errmsg    = "ok";
                resp.errcode   = 0;
                resp.isSuccess = true;
            }
            else
            {
                resp.errmsg  = "修改活动信息出错";
                resp.errcode = -1;
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
Exemple #22
0
        /// <summary>
        /// 获取篇文章内容
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetSingleArticle(HttpContext context)
        {
            var          source = bllJuactivity.GetJuActivity(Convert.ToInt32(context.Request["articleid"], 16));
            string       host   = string.Format("http://{0}", context.Request.Url.Authority);
            ArticleModel model  = new ArticleModel();

            model.ArticleTitle   = source.ActivityName;
            model.ArticleContent = source.ActivityDescription;

            #region 报名表单
            try
            {
                //加载报名表单
                if ((!string.IsNullOrEmpty(source.SignUpActivityID)) && (int.Parse(source.SignUpActivityID) > 0))
                {
                    //当前登录信息
                    ZentCloud.BLLJIMP.Model.UserInfo currUserInfo = new BLLJIMP.Model.UserInfo();
                    if (bll.IsLogin)
                    {
                        currUserInfo = DataLoadTool.GetCurrUserModel();
                    }

                    System.Text.StringBuilder sbAppend = new System.Text.StringBuilder();
                    sbAppend.AppendLine("<link type=\"text/css\" rel=\"stylesheet\" href=\"/css/buttons.css\"/>");
                    sbAppend.AppendLine(" <style type=\"text/css\">input[type='text'],textarea{height:30px;width:100%;border-radius: 2px;margin-top:5px;}</style>");
                    sbAppend.AppendLine("<script src=\"/Scripts/jquery.form.js\" type=\"text/javascript\"></script>");
                    sbAppend.AppendLine("<form id=\"formsignin\">");

                    var mapList = bllActivity.GetActivityFieldMappingList(source.SignUpActivityID);
                    foreach (var item in mapList)
                    {
                        if (item.FieldName.Equals("Name"))
                        {
                            sbAppend.AppendLine(string.Format("<input  placeholder=\"姓名\" name=\"Name\"  id=\"txtName\" type=\"text\" value=\"{0}\">", currUserInfo.TrueName));
                        }
                        else if (item.FieldName.Equals("Phone"))
                        {
                            sbAppend.AppendLine(string.Format("<input  placeholder=\"手机\" name=\"Phone\"  id=\"txtPhone\" type=\"text\" value=\"{0}\">", currUserInfo.Phone));
                        }
                        else
                        {
                            if (item.IsMultiline.Equals(1))
                            {
                                sbAppend.AppendLine(string.Format("<textarea  placeholder=\"{0}\" name=\"{1}\" style=\"height:50px;\" ></textarea>", item.MappingName, "K" + item.ExFieldIndex.ToString()));
                            }
                            else
                            {
                                if (item.MappingName.Contains("公司"))
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Company));
                                }
                                else if (item.MappingName.Contains("职位") || item.MappingName.Contains("职务"))
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Postion));
                                }
                                else if (item.MappingName.Contains("邮箱") || item.MappingName.Contains("邮件") || item.MappingName.ToLower().Contains("email"))
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Email));
                                }
                                else
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\">", item.MappingName, "K" + item.ExFieldIndex.ToString()));
                                }
                            }
                        }
                    }

                    sbAppend.AppendLine("<span class=\"button button-rounded button-flat-action\" style=\"width:86%;margin-top:10px;\"  onclick=\"SumitData()\" >提交</span>");
                    sbAppend.AppendLine(string.Format("<input  type=\"hidden\" value=\"{0}\" name=\"ActivityID\">", source.SignUpActivityID));
                    BLLJIMP.Model.UserInfo userInfo = bll.Get <BLLJIMP.Model.UserInfo>(string.Format(" UserId='{0}'", source.UserID));
                    sbAppend.AppendLine(string.Format("<input id=\"loginName\" type=\"hidden\" value=\"{0}\" name=\"LoginName\" />", ZentCloud.Common.Base64Change.EncodeBase64ByUTF8(userInfo.UserID))); //外部登录名
                    sbAppend.AppendLine(string.Format("<input id=\"loginPwd\" type=\"hidden\" value=\"{0}\" name=\"LoginPwd\" />", ZentCloud.Common.DEncrypt.ZCEncrypt(userInfo.Password)));              //外部登录密码
                    sbAppend.AppendLine("</form>");
                    //
                    sbAppend.AppendLine("<script type=\"text/javascript\">");
                    sbAppend.AppendLine("function SumitData() {");
                    sbAppend.AppendLine("var Name = $(\"#txtName\").val();");
                    sbAppend.AppendLine("var Phone = $(\"#txtPhone\").val();");
                    sbAppend.AppendLine("if (Name == \"\" || (Phone == \"\")) {alert(\"请输入姓名、手机号码\");return false; }");

                    sbAppend.AppendLine("$(\"#formsignin\").ajaxSubmit({");
                    sbAppend.AppendLine("url: \"/serv/ActivityApiJson.ashx\",");
                    sbAppend.AppendLine("type: \"post\",");
                    sbAppend.AppendLine("dataType: \"json\",");
                    sbAppend.AppendLine("success: function (resp) {");
                    sbAppend.AppendLine("if (resp.Status == 0) {//清空");
                    sbAppend.AppendLine(" $('input:text').val(\"\");");
                    sbAppend.AppendLine("$('textarea').val(\"\");");
                    sbAppend.AppendLine("alert(\"提交成功!\");");
                    sbAppend.AppendLine("return;");
                    sbAppend.AppendLine("}");
                    sbAppend.AppendLine("else if (resp.Status == 1) {alert(\"重复提交!\");}");
                    sbAppend.AppendLine(" else {alert(resp.Msg);}");
                    sbAppend.AppendLine("}});return false;  };");
                    sbAppend.AppendLine("</script>");


                    model.ArticleContent += sbAppend.ToString();
                }
            }
            catch (Exception)
            {
            }
            //加载报名表单
            #endregion

            model.ArticleThumbnails = bll.GetImgUrl(source.ThumbnailsPath);
            //model.ArticleUrl = string.Format("{0}/{1}/details.chtml", host, source.JuActivityIDHex);
            return(Common.JSONHelper.ObjectToJson(model));
        }
Exemple #23
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            context.Response.Expires     = 0;
            string        result      = "false";
            string        phone       = context.Request["phone"];
            string        smsContent  = context.Request["smscontent"];
            string        is_register = context.Request["is_register"];
            string        is_reset    = context.Request["is_reset"];
            string        is_member   = context.Request["is_member"];
            string        content     = context.Request["content"];
            List <string> blackIpList = new List <string>();

            blackIpList.Add("139.196.16.189");
            if (blackIpList.Contains(context.Request.UserHostAddress))
            {
                resp.errcode = 1;
                resp.errmsg  = "Ip Invai";
                goto outoff;
            }
            if (string.IsNullOrEmpty(phone))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入手机号";
                goto outoff;
            }
            if ((!phone.StartsWith("1")) || (!phone.Length.Equals(11)))
            {
                resp.errcode = 2;
                resp.errmsg  = "手机号格式不正确";
                goto outoff;
            }
            if (!ZentCloud.Common.MyRegex.PhoneNumLogicJudge(phone))
            {
                resp.errcode = 2;
                resp.errmsg  = "手机格式不正确";
                goto outoff;
            }
            if (string.IsNullOrEmpty(smsContent))
            {
                resp.errcode = 1;
                resp.errmsg  = "短信内容不能为空";
                goto outoff;
            }
            if (!smsContent.Contains("{{SMSVERCODE}}"))//验证码标签
            {
                resp.errcode = 1;
                resp.errmsg  = "缺少标签{{SMSVERCODE}}";
                goto outoff;
            }
            if (is_register == "1")
            {
                BLLUser bllUser = new BLLUser();
                BLLJIMP.Model.UserInfo ouser = bllUser.GetUserInfoByPhone(phone, bllUser.WebsiteOwner);
                if (ouser != null)
                {
                    resp.errcode = 1;
                    resp.errmsg  = "手机号码已存在账号,请尝试找回密码";
                    goto outoff;
                }
            }
            if (is_reset == "1")
            {
                BLLUser bllUser = new BLLUser();
                BLLJIMP.Model.UserInfo ouser = bllUser.GetUserInfoByPhone(phone, bllUser.WebsiteOwner);
                if (ouser == null)
                {
                    resp.errcode = 1;
                    resp.errmsg  = "手机号未注册";
                    goto outoff;
                }
                if (ouser.IsDisable == 1)
                {
                    resp.errcode = 1;
                    resp.errmsg  = "账号已被禁用";
                    goto outoff;
                }
                if (is_member == "1" && ouser.MemberLevel == 0)
                {
                    resp.errcode = 1;
                    resp.errmsg  = "您不是会员";
                    goto outoff;
                }
            }
            var lastSmsVerificationCode = bllSms.GetLastSmsVerificationCode(phone);

            if (lastSmsVerificationCode != null)
            {
                if ((DateTime.Now - lastSmsVerificationCode.InsertDate).TotalSeconds < 60)
                {
                    resp.errcode = 3;
                    resp.errmsg  = "验证码限制每60秒发送一次";
                    goto outoff;
                }
            }
            bool   isSuccess = false;
            string verCode   = new Random().Next(111111, 999999).ToString();
            string msg       = "";

            smsContent = smsContent.Replace("{{SMSVERCODE}}", verCode);//替换验证码标签
            if (content == "1")
            {
                smsContent = "金融玩家欢迎你,验证码" + verCode;
            }
            string smsSignature = string.Format("{0}", bllSms.GetWebsiteInfoModelFromDataBase().SmsSignature);//短信签名

            bllSms.SendSmsVerificationCode(phone, smsContent, smsSignature, verCode, out isSuccess, out msg);
            if (isSuccess)
            {
                resp.errcode = 0;
                resp.errmsg  = "ok";
                //resp.sms_vercode = verCode;
            }
            else
            {
                resp.errcode = 4;
                resp.errmsg  = string.Format("发送验证码失败{0}", msg);
            }

outoff:
            result = ZentCloud.Common.JSONHelper.ObjectToJson(resp);
            if (!string.IsNullOrEmpty(context.Request["callback"]))
            {
                //返回 jsonp数据
                context.Response.Write(string.Format("{0}({1})", context.Request["callback"], result));
            }
            else
            {
                //返回json数据
                context.Response.Write(result);
            }
        }
Exemple #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //Tolog("Into WX OAuthPage");

                //if (!IsPostBack)
                //{
                #region 网站接入
                try
                {
                    if (bllWeixinOpen.IsAuthToOpen() && bllUser.WebsiteOwner != "study")
                    {
                        Response.Write("");
                        return;
                    }
                }
                catch (Exception)
                {
                }


                string signature    = Request["signature"];
                string timestamp    = Request["timestamp"];
                string nonce        = Request["nonce"];
                string echostr      = Request["echostr"];
                string userIdEncode = Request["u"];

                if (string.IsNullOrWhiteSpace(userIdEncode))
                {
                    return;
                }

                //判断接入
                string userID = Common.Base64Change.DecodeBase64ByUTF8(userIdEncode);
                BLLJIMP.Model.UserInfo user = bllUser.GetUserInfo(userID);

                if (user == null)
                {
                    Response.Write("用户不存在!");
                    return;
                }

                if (string.IsNullOrWhiteSpace(user.WeixinToken))
                {
                    Response.Write("平台未绑定成功!");
                    return;
                }

                bool checkResult = BLLJIMP.BLLWeixin.Check(signature, timestamp, nonce, user.WeixinToken);

                //Tolog(string.Format("echostr:{0},checkResult:{1},Token:{2}", echostr, checkResult.ToString(),user.WeixinToken));

                if (!string.IsNullOrWhiteSpace(echostr))
                {
                    if (checkResult)
                    {
                        Response.Write(echostr);
                        return;
                    }
                    else
                    {
                        Response.Write("接入失败!");
                        return;
                    }
                }

                #endregion

                #region 测试1
                //XmlNode xmlNode;
                //using (StreamReader sr = new StreamReader(Request.InputStream))
                //{
                //    XmlDocument xmlDoc = new XmlDocument();
                //    xmlDoc.Load(sr.BaseStream);
                //    xmlNode = xmlDoc.SelectSingleNode("xml");
                //}

                //string ToUserName = xmlNode.SelectSingleNode("ToUserName").InnerText;
                //string FromUserName = xmlNode.SelectSingleNode("FromUserName").InnerText;
                //string CreateTime = xmlNode.SelectSingleNode("CreateTime").InnerText;
                //string MsgType = xmlNode.SelectSingleNode("MsgType").InnerText;
                //string Content = xmlNode.SelectSingleNode("Content").InnerText;
                //string MsgId = xmlNode.SelectSingleNode("MsgId").InnerText;

                //using (StreamWriter sw = new StreamWriter("C:\\test\\test.txt", true, Encoding.UTF8))
                //{
                //    sw.WriteLine(string.Format("【接收】ToUserName:{0},FromUserName:{1},CreateTime:{2},MsgType:{3},Content:{4},MsgId:{5}",
                //            ToUserName,
                //            FromUserName,
                //            CreateTime,
                //            MsgType,
                //            Content,
                //            MsgId
                //        ));
                //}

                //StringBuilder strResp = new StringBuilder();

                //strResp.AppendLine("<xml>");

                //strResp.AppendFormat("<ToUserName>{0}</ToUserName>", FromUserName);
                //strResp.AppendFormat("<FromUserName>{0}</FromUserName>", ToUserName);
                //strResp.AppendFormat("<CreateTime>{0}</CreateTime>", CreateTime);
                //strResp.AppendFormat("<MsgType>{0}</MsgType>", "news");
                //strResp.AppendFormat("<ArticleCount>4</ArticleCount>");

                //strResp.AppendFormat("<Articles>");
                ////图片信息
                //strResp.AppendFormat("<item>");
                //strResp.AppendFormat("<Title>{0}</Title>", "小小青柠檬壁纸世界");
                //strResp.AppendFormat("<Description>{0}</Description>", "分享收集生活中的美好,找到与你气味...");
                //strResp.AppendFormat("<PicUrl>{0}</PicUrl>", "http://www.jubit.org/weixin/wellcome2.jpg");
                //strResp.AppendFormat("<Url>{0}</Url>", "http://www.jubit.org/weixin/wellcome2.jpg");
                //strResp.AppendFormat("</item>");

                //strResp.AppendFormat("<item>");
                //strResp.AppendFormat("<Title>{0}</Title>", "风儿吹来 是我和天空的对白 其实幸福 一直与我们同在");
                //strResp.AppendFormat("<Description>{0}</Description>", "风儿吹来 是我和天空的对白 其实幸福 一直与我们同在");
                //strResp.AppendFormat("<PicUrl>{0}</PicUrl>", "http://www.jubit.org/weixin/1.jpeg");
                //strResp.AppendFormat("<Url>{0}</Url>", "http://www.jubit.org/weixin/a1.jpeg");
                //strResp.AppendFormat("</item>");

                //strResp.AppendFormat("<item>");
                //strResp.AppendFormat("<Title>{0}</Title>", "爱情就像沙漠被一片绿色淹没 开出最绚烂的花朵");
                //strResp.AppendFormat("<Description>{0}</Description>", "爱情就像沙漠被一片绿色淹没 开出最绚烂的花朵");
                //strResp.AppendFormat("<PicUrl>{0}</PicUrl>", "http://www.jubit.org/weixin/2.jpeg");
                //strResp.AppendFormat("<Url>{0}</Url>", "http://www.jubit.org/weixin/a2.jpeg");
                //strResp.AppendFormat("</item>");

                //strResp.AppendFormat("<item>");
                //strResp.AppendFormat("<Title>{0}</Title>", "千杯不醉 怎么我看你会千遍不厌");
                //strResp.AppendFormat("<Description>{0}</Description>", "千杯不醉 怎么我看你会千遍不厌");
                //strResp.AppendFormat("<PicUrl>{0}</PicUrl>", "http://www.jubit.org/weixin/3.jpeg");
                //strResp.AppendFormat("<Url>{0}</Url>", "http://www.jubit.org/weixin/a3.jpeg");
                //strResp.AppendFormat("</item>");

                //strResp.AppendFormat("</Articles>");

                //strResp.AppendFormat("<FuncFlag>1</FuncFlag>");

                //strResp.AppendLine("</xml>");

                //using (StreamWriter sw = new StreamWriter("C:\\test\\test.txt", true, Encoding.UTF8))
                //{
                //    sw.WriteLine(string.Format("【回复】{0}", strResp.ToString()));
                //}

                //Response.Write(strResp.ToString());
                #endregion

                string result = string.Empty;

                //checkResult = true;

                if (checkResult)
                {
                    result = bllWeixin.ActionResult(Request.InputStream, user.UserID);

                    bllWeixin.ToBLLWeixinLog("空处理前 result:" + result);

                    if (result.Contains("<Content><![CDATA[]]></Content>") && result.ToLower().Contains("<msgtype>text</msgtype>"))
                    {
                        result = result.Replace("<Content><![CDATA[]]></Content>", "").Replace("<MsgType>Text</MsgType>", "<MsgType><![CDATA[transfer_customer_service]]></MsgType>");
                    }

                    bllWeixin.ToBLLWeixinLog("最终 result:" + result);

                    Response.Write(result);
                }
                else
                {
                    Response.Write("意外的推送信息!");
                    return;
                }

                //result = weixinBll.ActionResult(Request.InputStream, user.UserID);

                // Response.Write(result);

                //}
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);

                Tolog(string.Format("【{1}异常】{0}", ex.Message, DateTime.Now.ToString()));
            }
        }
Exemple #25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     userInfo    = bll.GetCurrentUserInfo();
     RecommCount = bll.GetCount <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' and TypeName = '分享'", userInfo.UserID));
 }
Exemple #26
0
 /// <summary>
 /// 保存积分
 /// </summary>
 /// <param name="p"></param>
 private bool SavaUserToTalScol(string userId, int score)
 {
     BLLJIMP.Model.UserInfo userInfo = bllJuactivity.Get <BLLJIMP.Model.UserInfo>(string.Format(" UserId='{0}'", userId));
     userInfo.TotalScore = userInfo.TotalScore + score;
     return(bllJuactivity.Update(userInfo, string.Format("TotalScore={0}", userInfo.TotalScore), string.Format("AutoID={0}", currentUserInfo.UserID)) > 0);
 }
Exemple #27
0
        public void ProcessRequest(HttpContext context)
        {
            string id    = context.Request["id"];
            double score = Convert.ToDouble(context.Request["score"]);

            if (!string.IsNullOrWhiteSpace(context.Request["score_name"]))
            {
                scoreName = context.Request["score_name"];
            }
            if (!string.IsNullOrWhiteSpace(context.Request["action_name"]))
            {
                actionName = context.Request["action_name"];
            }



            int score1 = 0;

            if (!int.TryParse(score.ToString(), out score1))
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = scoreName + "只能输入正整数";
                bll.ContextResponse(context, apiResp);
                return;
            }

            #region  能小于等于0
            if (score <= 0)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = actionName + scoreName + "不能小于等于0";
                bll.ContextResponse(context, apiResp);
                return;
            }
            #endregion
            double min = Convert.ToDouble(context.Request["min"]);
            #region 最小值限制
            if (score < min)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = actionName + scoreName + "不能少于" + min;
                bll.ContextResponse(context, apiResp);
                return;
            }
            #endregion
            int idInt = Convert.ToInt32(id);

            if (CurrentUserInfo.TotalScore < score)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = "账号" + scoreName + "不足";
                bll.ContextResponse(context, apiResp);
                return;
            }
            BLLJIMP.Model.JuActivityInfo activity = bllActivity.GetJuActivity(idInt, false, bllActivity.WebsiteOwner);
            if (activity == null)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                apiResp.msg  = "文章未找到";
                bll.ContextResponse(context, apiResp);
                return;
            }
            if (CurrentUserInfo.UserID == activity.UserID)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = "禁止" + actionName + "自己";
                bll.ContextResponse(context, apiResp);
                return;
            }
            BLLJIMP.Model.UserInfo author = bllUser.GetUserInfo(activity.UserID, bllUser.WebsiteOwner);

            string msg    = "";
            bool   result = bll.RewardJuActivity(CurrentUserInfo, author, activity, score, bll.WebsiteOwner, out msg, scoreName, actionName);

            apiResp.status = result;
            apiResp.code   = result ? (int)BLLJIMP.Enums.APIErrCode.IsSuccess :(int)BLLJIMP.Enums.APIErrCode.OperateFail;
            apiResp.msg    = msg;
            bll.ContextResponse(context, apiResp);
        }
Exemple #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     uinfo = DataLoadTool.GetCurrUserModel();
 }
Exemple #29
0
 /// <summary>
 /// 更新用户积分
 /// </summary>
 /// <param name="p"></param>
 private bool UpdateUserToTalScore(string userId, int score)
 {
     BLLJIMP.Model.UserInfo userInfo = bllUser.GetUserInfo(userId);
     userInfo.TotalScore += score;
     return(bllJuactivity.Update(userInfo, string.Format(" TotalScore={0}", userInfo.TotalScore), string.Format(" AutoID={0}", userInfo.AutoID)) > 0);
 }
Exemple #30
0
        public void ProcessRequest(HttpContext context)
        {
            string id = context.Request["id"];

            if (string.IsNullOrWhiteSpace(id))
            {
                resp.errcode = (int)APIErrCode.OperateFail;
                resp.errmsg  = "消息模板编号不能为空";
                bllWeixin.ContextResponse(context, resp);
                return;
            }

            string openId = context.Request["openid"];
            string userId = context.Request["userid"];

            if (string.IsNullOrWhiteSpace(openId) && string.IsNullOrWhiteSpace(userId))
            {
                BLLJIMP.Model.UserInfo toUser = bllWeixin.GetCurrentUserInfo();
                if (toUser != null && !string.IsNullOrWhiteSpace(toUser.WXOpenId))
                {
                    openId = toUser.WXOpenId;
                }
            }
            else if (string.IsNullOrWhiteSpace(openId) && !string.IsNullOrWhiteSpace(userId))
            {
                BLLJIMP.Model.UserInfo toUser = bllWeixin.GetByKey <BLLJIMP.Model.UserInfo>("UserID", userId);
                if (toUser != null && !string.IsNullOrWhiteSpace(toUser.WXOpenId))
                {
                    openId = toUser.WXOpenId;
                }
            }

            if (string.IsNullOrWhiteSpace(openId))
            {
                resp.errcode = (int)APIErrCode.OperateFail;
                resp.errmsg  = "接收者openId不能为空";
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            string k1       = context.Request["k1"];
            string k2       = context.Request["k2"];
            string k3       = context.Request["k3"];
            string k4       = context.Request["k4"];
            string k5       = context.Request["k5"];
            string k6       = context.Request["k6"];
            string k7       = context.Request["k7"];
            string k8       = context.Request["k8"];
            string k9       = context.Request["k9"];
            string k10      = context.Request["k10"];
            JToken sendData = JToken.Parse("{}");

            sendData["touser"] = openId;

            if (!string.IsNullOrWhiteSpace(k1))
            {
                sendData["K1"] = k1;
            }
            if (!string.IsNullOrWhiteSpace(k2))
            {
                sendData["K2"] = k2;
            }
            if (!string.IsNullOrWhiteSpace(k3))
            {
                sendData["K3"] = k3;
            }
            if (!string.IsNullOrWhiteSpace(k4))
            {
                sendData["K4"] = k4;
            }
            if (!string.IsNullOrWhiteSpace(k5))
            {
                sendData["K5"] = k5;
            }
            if (!string.IsNullOrWhiteSpace(k6))
            {
                sendData["K6"] = k6;
            }
            if (!string.IsNullOrWhiteSpace(k7))
            {
                sendData["K7"] = k7;
            }
            if (!string.IsNullOrWhiteSpace(k8))
            {
                sendData["K8"] = k8;
            }
            if (!string.IsNullOrWhiteSpace(k9))
            {
                sendData["K9"] = k9;
            }
            if (!string.IsNullOrWhiteSpace(k10))
            {
                sendData["K10"] = k10;
            }

            string url = context.Request.Form["toUrl"];

            if (!string.IsNullOrWhiteSpace(url))
            {
                sendData["url"] = url;
            }

            string accessToken = bllWeixin.GetAccessToken();

            resp.errmsg = bllWeixin.SendTemplateMessage(accessToken, id, sendData);
            if (!string.IsNullOrWhiteSpace(resp.errmsg))
            {
                resp.errcode = (int)APIErrCode.OperateFail;
                bllWeixin.ContextResponse(context, resp);
                return;
            }
            resp.isSuccess = true;
            bllWeixin.ContextResponse(context, resp);
        }