コード例 #1
0
        /// <summary>
        /// 编辑基地信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public string EditBaseInfo(HttpContext context)
        {
            int    autoId       = int.Parse(context.Request["AutoID"]);
            string baseName     = context.Request["BaseName"];
            string thumbnails   = context.Request["Thumbnails"];
            string address      = context.Request["Address"];
            string area         = context.Request["Area"];
            string tel          = context.Request["Tel"];
            string phone        = context.Request["Phone"];
            string qq           = context.Request["QQ"];
            string contacts     = context.Request["Contacts"];
            string acreage      = context.Request["Acreage"];
            string helpCount    = context.Request["HelpCount"];
            string userId       = context.Request["UserId"];
            string password     = context.Request["Password"];
            string isDisable    = context.Request["IsDisable"];
            string introduction = context.Request["Introduction"];

            if (bll.GetCount <WBBaseInfo>(string.Format("UserId='{0}' And AutoID!={1}", userId, autoId)) > 0)
            {
                resp.Status = 0;
                resp.Msg    = "用户名已经存在";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            if (bll.GetCount <WBCompanyInfo>(string.Format("UserId='{0}'", userId)) > 0)
            {
                resp.Status = 0;
                resp.Msg    = "此用户名在企业列表中已经存在";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            WBBaseInfo model = bll.Get <WBBaseInfo>(string.Format("AutoID={0}", autoId));

            model.BaseName     = baseName;
            model.Thumbnails   = thumbnails;
            model.Address      = address;
            model.Area         = area;
            model.Tel          = tel;
            model.Phone        = phone;
            model.QQ           = qq;
            model.Contacts     = contacts;
            model.Acreage      = acreage;
            model.HelpCount    = string.IsNullOrEmpty(helpCount) ? 0 : int.Parse(helpCount);
            model.UserId       = userId;
            model.Password     = password;
            model.IsDisable    = int.Parse(isDisable);
            model.Introduction = introduction;
            if (bll.Update(model))
            {
                resp.Status = 1;
                resp.Msg    = "更新基地信息成功";
            }
            else
            {
                resp.Msg = "更新基地信息失败";
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #2
0
 /// <summary>
 /// 修改
 /// </summary>
 public static string Edit(HttpContext context)
 {
     try
     {
         var pagePath          = context.Request["PagePath"];
         var filterDescription = context.Request["FilterDescription"];
         var filterType        = context.Request["FilterType"];
         var oldPagePath       = context.Request["OldPagePath"];
         var oldFilterType     = context.Request["OldFilterType"];
         var matchType         = context.Request["MatchType"];
         var ex1   = context.Request["Ex1"];
         var model = new ModuleFilterInfo();
         model.PagePath          = pagePath;
         model.FilterDescription = filterDescription;
         model.FilterType        = filterType;
         if (bll.Update(model, string.Format("PagePath='{0}',FilterType='{1}',FilterDescription='{2}',MatchType='{3}',Ex1='{4}'", pagePath, filterType, filterDescription, matchType, ex1), string.Format(" PagePath='{0}' and FilterType='{1}'", oldPagePath, oldFilterType)) > 0)
         {
             UpdateRedis();
             return("true");
         }
         else
         {
             return("false");
         }
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
コード例 #3
0
        /// <summary>
        /// 获取OrgCode
        /// </summary>
        /// <param name="websiteInfo"></param>
        /// <returns></returns>
        private string GetOrgCode(WebsiteInfo websiteInfo)
        {
            if (websiteInfo.IsUnionHongware == 1)
            {
                if (!string.IsNullOrEmpty(websiteInfo.OrgCode))
                {
                    return(websiteInfo.OrgCode);
                }
                else
                {
                    try
                    {
                        Open.HongWareSDK.Client client = new Open.HongWareSDK.Client(websiteInfo.WebsiteOwner);
                        var result = client.GetOrgCode();
                        if (result.isSuccess)
                        {
                            websiteInfo.OrgCode = result.orgCode.orgCode;
                            if (bll.Update(websiteInfo))
                            {
                                return(websiteInfo.OrgCode);
                            }
                        }
                    }
                    catch (Exception)
                    {
                    }

                    return("");
                }
            }
            return("");
        }
コード例 #4
0
        /// <summary>
        /// 修改
        /// </summary>
        public static string Edit(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}
            //验证网址
            var linkUrl = context.Request["LinkUrl"];

            if (!string.IsNullOrEmpty(linkUrl))
            {
                string match = @"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
                Regex  reg   = new Regex(match);
                if (!reg.IsMatch(linkUrl))
                {
                    return("请输入正确的网址,格式如 http://www.baidu.com");
                }
            }
            WeixinMsgSourceInfo model = new WeixinMsgSourceInfo();

            model.UserID      = websiteOwner; //Comm.DataLoadTool.GetCurrUserID();
            model.Title       = context.Request["SourceName"];
            model.PicUrl      = context.Request["PicUrl"];
            model.Url         = context.Request["LinkUrl"];
            model.SourceID    = context.Request["SourceId"];
            model.Description = context.Request["Description"];
            return(bll.Update(model).ToString().ToLower());
        }
コード例 #5
0
        /// <summary>
        /// 是否显示转发排行榜
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string UpdateWebsiteForwardRank(HttpContext context)
        {
            string      isShowForwardRank = context.Request["IsShowForwardRank"];
            string      sortType          = context.Request["sort_type"];
            WebsiteInfo webSiteModel      = bllWebsite.GetWebsiteInfo(bll.WebsiteOwner);

            if (!string.IsNullOrEmpty(isShowForwardRank))
            {
                webSiteModel.IsShowForwardRank = Convert.ToInt32(isShowForwardRank);
            }

            if (!string.IsNullOrEmpty(sortType))
            {
                webSiteModel.SortType = Convert.ToInt32(sortType);
            }

            if (bll.Update(webSiteModel))
            {
                resp.Status = 0;
                resp.Msg    = "设置完成";
            }
            else
            {
                resp.Status = -1;
                resp.Msg    = "设置出错";
            }
            return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                autoId = Request["AutoId"];
                if (!string.IsNullOrEmpty(autoId))
                {
                    reviewInfo = bll.Get <BLLJIMP.Model.ReviewInfo>(string.Format(" AutoId={0}", autoId));
                    if (reviewInfo != null)
                    {
                        reviewInfo.Pv++;
                        bll.Update(reviewInfo);
                    }
                }

                ForwardingRecord record = bll.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND WebsiteOwner='{2}' AND TypeName='话题赞'", bll.GetCurrentUserInfo().UserID, autoId, bll.WebsiteOwner));
                if (record != null)
                {
                    isPraise = true;
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
                Response.End();
            }
        }
コード例 #7
0
        /// <summary>
        /// 微信分享完成触发
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string WXShareComlete(HttpContext context)
        {
            int id    = int.Parse(context.Request["id"]);
            var model = bllBase.Get <CrowdFundInfo>(string.Format(" AutoID={0}", id));

            model.ShareCount++;
            bllBase.Update(model);
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #8
0
 /// <summary>
 /// 获取五伴会详情
 /// </summary>
 /// <param name="AutoId"></param>
 private void GetPartnerInfo(string AutoId)
 {
     PInfo = bll.Get <BLLJIMP.Model.WBHPartnerInfo>(string.Format(" WebsiteOwner='{0}' AND AutoId='{1}'", bll.WebsiteOwner, AutoId));
     if (PInfo != null)
     {
         GetPartnerStr(PInfo);
         PInfo.PartnerPv++;
         bll.Update(PInfo);
     }
 }
コード例 #9
0
ファイル: AdminHandler.ashx.cs プロジェクト: uvbs/mmp
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string EditCrowdFundInfo(HttpContext context)
        {
            CrowdFundInfo requestModel = bllBase.ConvertRequestToModel <CrowdFundInfo>(new CrowdFundInfo());

            if (bllBase.Update(requestModel))
            {
                resp.Status = 1;
                resp.Msg    = "修改成功";
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //读取有ip的数据

            try
            {
                var dataList = bll.GetList <BLLJIMP.Model.VoteLogInfo>(" IP IS NOT NULL AND IPLocation IS NULL ");
                int i        = 0;
                foreach (var item in dataList)
                {
                    var location = Common.MySpider.GetIPLocation(item.IP);

                    i += bll.Update(new BLLJIMP.Model.VoteLogInfo(), string.Format(" IPLocation = '{0}' ", location), string.Format(" AutoID = {0} ", item.AutoID));
                }
                Response.Write(i.ToString());
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
コード例 #11
0
        /// <summary>
        /// 修改
        /// </summary>
        public static string Edit(HttpContext context)
        {
            var model = GetModel(context);

            if (model.IsEnable == 1)
            {
                if (model.RemindTime <= DateTime.Now)
                {
                    return("提醒时间须晚于当前时间");
                }
            }
            model.RemindID = Convert.ToInt32(context.Request["RemindID"]);
            model.IsRemind = 0;
            var remindinfo = bll.Get <UserRemind>(string.Format("RemindID='{0}' And UserID='{1}'", model.RemindID, Comm.DataLoadTool.GetCurrUserID()));

            if (remindinfo == null)
            {
                return("false");
            }
            return(bll.Update(model).ToString().ToLower());
        }
コード例 #12
0
ファイル: CrowdFundInfoShow.aspx.cs プロジェクト: uvbs/mmp
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Request["id"]))
     {
         Response.End();
     }
     model = bllBase.Get <CrowdFundInfo>(string.Format(" AutoID={0}", Request["id"]));
     if (model == null)
     {
         Response.End();
     }
     model.PV++;
     bllBase.Update(model);
 }
コード例 #13
0
 private BLLJIMP.Model.JuActivityInfo GetActivity(string id)
 {
     model = bll.Get <BLLJIMP.Model.JuActivityInfo>(string.Format(" JuActivityID='{0}'", id));
     if (model != null)
     {
         if (model.ActivityEndDate != null)
         {
             if (DateTime.Now >= (DateTime)model.ActivityEndDate)
             {
                 model.IsHide = 1;
             }
         }
         model.PV = model.PV + 1;
         bll.Update(model);
         txtTitle.Text = model.ActivityName;
         txtStart.Text = model.IsHide == 0 ? "进行中" : "已结束";
         if (model.IsHide == -1)
         {
             txtStart.Text = "待开始";
         }
         if ((model.MaxSignUpTotalCount > 0) && (model.SignUpTotalCount >= model.MaxSignUpTotalCount) && (model.IsHide == 0))
         {
             txtStart.Text = "已满员";
         }
         classStr = model.IsHide == 0 ? "listbox" : "listbox partyover";
         if (model.IsHide == -1)
         {
             classStr = "listbox";
         }
         if (model.MaxSignUpTotalCount > 0 && (model.SignUpTotalCount >= model.MaxSignUpTotalCount))
         {
             classStr = "listbox partyfull";
         }
         txtTime.Text    = model.ActivityStartDate.ToString();
         txtAddress.Text = model.ActivityAddress;
         if ((!string.IsNullOrEmpty(model.CategoryId)) && (!model.CategoryId.Equals("0")))
         {
             txtType.Text = bll.Get <BLLJIMP.Model.ArticleCategory>(string.Format(" AutoID={0}", model.CategoryId)).CategoryName;
         }
         txtContent.Text          = model.ActivityDescription;
         txtNum.Text              = model.SignUpTotalCount.ToString();
         txtActivityIntegral.Text = model.ActivityIntegral.ToString();
         if (bll.GetCount <ActivityDataInfo>(string.Format("ActivityID={0} And WeixinOpenID='{1}' And IsDelete=0 ", model.SignUpActivityID, UserInfo.WXOpenId)) > 0)
         {
             IsSubmit = true;
         }
     }
     return(model);
 }
コード例 #14
0
ファイル: WXPositionInfo.aspx.cs プロジェクト: uvbs/mmp
 private void GetPosition()
 {
     pInfo = bll.Get <BLLJIMP.Model.PositionInfo>(string.Format(" WebsiteOwner='{0}' AND AutoId='{1}'", bll.WebsiteOwner, AutoId));
     if (pInfo != null)
     {
         pInfo.Pv = pInfo.Pv + 1;
         bll.Update(pInfo);
         txtTitle.Text           = pInfo.Title;
         txtPersonal.Text        = pInfo.Personal;
         txtTime.Text            = pInfo.InsertDate.ToString();
         txtAddress.Text         = pInfo.Address;
         txtEnterpriseScale.Text = pInfo.EnterpriseScale;
         txtContent.Text         = pInfo.Context;
     }
 }
コード例 #15
0
        /// <summary>
        /// 领取奖品
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetPrize(HttpContext context)
        {
            string          id        = context.Request["LotteryId"];
            WXLotteryRecord wxlRecord = bll.Get <WXLotteryRecord>(" UserId='" + currentUserInfo.UserID + "' And LotteryId=" + id);

            if (wxlRecord != null)
            {
                wxlRecord.IsGetPrize = "1";
                if (bll.Update(wxlRecord))
                {
                    resp.Status = 1;
                    resp.Msg    = "领奖成功!!!";
                }
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #16
0
        /// <summary>
        /// 修改
        /// </summary>
        public static string Edit(HttpContext context)
        {
            var userid = Comm.DataLoadTool.GetCurrUserID();

            if (string.IsNullOrEmpty(userid))
            {
                return("请重新登录");
            }
            WXFlowStepInfo model = new WXFlowStepInfo();

            model.FlowID           = int.Parse(context.Request["FlowID"]);
            model.StepID           = int.Parse(context.Request["StepID"]);
            model.FlowField        = context.Request["FlowField"];
            model.FieldDescription = context.Request["FieldDescription"];
            model.SendMsg          = context.Request["SendMsg"];
            model.ErrorMsg         = context.Request["ErrorMsg"];
            model.AuthFunc         = context.Request["AuthFunc"];
            if (model.AuthFunc.Equals("phone"))
            {
                model.IsVerifyCode = int.Parse(context.Request["IsVerifyCode"]);
            }

            return(bll.Update(model).ToString().ToLower());
        }
コード例 #17
0
ファイル: WXDiscussInfo.aspx.cs プロジェクト: uvbs/mmp
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                autoId = Request["AutoId"];
                if (!string.IsNullOrEmpty(autoId))
                {
                    reviewInfo = bll.Get <BLLJIMP.Model.ReviewInfo>(string.Format(" AutoId={0}", autoId));
                    if (reviewInfo != null)
                    {
                        reviewInfo.Pv++;
                        bll.Update(reviewInfo);
                        //txtStepNum.Text = rInfo.StepNum.ToString();
                        //txtPraiseNum.Text = reviewInfo.PraiseNum.ToString();
                        //TiWenUserInfo=bllUser.GetUserInfo(rInfo.UserId);
                        //var tutorInfo=bll.Get<BLLJIMP.Model.TutorInfo>(string.Format(" UserId='{0}'", TiWenUserInfo.UserID));
                        //if (tutorInfo != null)
                        //{
                        //    TiWenUserInfo.TrueName = tutorInfo.TutorName;
                        //    TiWenUserInfo.WXHeadimgurl = tutorInfo.TutorImg;
                        //}
                        //else
                        //{
                        //    TiWenUserInfo.WXHeadimgurl = TiWenUserInfo.WXHeadimgurlLocal;
                        //}
                    }
                }

                ForwardingRecord record = bll.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND WebsiteOwner='{2}' AND TypeName='话题赞'", bll.GetCurrentUserInfo().UserID, autoId, bll.WebsiteOwner));
                if (record != null)
                {
                    isPraise = true;
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
                Response.End();
            }
        }
コード例 #18
0
ファイル: Index.aspx.cs プロジェクト: uvbs/mmp
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetBanner();
            }

            isWeixinFollower = IsWeixinFollower();
            if (isWeixinFollower)
            {
                ZentCloud.BLLJIMP.Model.UserInfo userInfo = bllweixin.GetCurrentUserInfo();
                if (userInfo.ISWXmpScoreAdded != 1)
                {
                    ZentCloud.BLLJIMP.BLLUserScore bllUserScore = new BLLJIMP.BLLUserScore(userInfo.UserID);
                    userInfo.TotalScore += bllUserScore.UpdateUserScoreWithWXTMNotify(bllUserScore.GetDefinedUserScore(ZentCloud.BLLJIMP.BLLUserScore.UserScoreType.SubscriteWXMP),
                                                                                      bllweixin.GetAccessToken());
                    userInfo.ISWXmpScoreAdded = 1;
                    bll.Update(userInfo);
                }
            }
            IsHaveUnReadMessage = bllNotice.IsHaveUnReadMessage(bll.GetCurrentUserInfo().UserID).ToString();
        }
コード例 #19
0
ファイル: Update.ashx.cs プロジェクト: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            var    requestModel = ZentCloud.Common.JSONHelper.JsonToModel <ZentCloud.BLLJIMP.ModelGen.PcPage.PcPage>(context.Request["jsonData"]);
            PcPage model        = bll.Get <PcPage>(string.Format("PageId={0}", requestModel.PageId));

            model.PageName      = requestModel.PageName;                                           //页面名称
            model.TopContent    = requestModel.TopContent;                                         //顶部内容
            model.Logo          = requestModel.Logo;                                               //Logo
            model.BottomContent = requestModel.BottomContent;                                      //底部内容
            model.TopMenu       = requestModel.TopMenu;                                            //顶部菜单
            model.MiddContent   = ZentCloud.Common.JSONHelper.ObjectToJson(requestModel.MiddList); //中部列表
            model.WebsiteOwner  = bll.WebsiteOwner;                                                //所有者
            if (bll.Update(model))
            {
                apiResp.status = true;
            }
            else
            {
                apiResp.msg = "添加失败";
            }
            bll.ContextResponse(context, apiResp);
        }
コード例 #20
0
        /// <summary>
        /// 修改
        /// </summary>
        public string Edit(HttpContext context)
        {
            var groupid   = context.Request["GroupID"];
            var userid    = Comm.DataLoadTool.GetCurrUserID();
            var groupinfo = bll.Get <MemberGroupInfo>(string.Format("GroupID='{0}'", groupid));

            if (groupinfo == null)
            {
                return("分组编号不存在");
            }
            if (!groupinfo.UserID.Equals(userid))
            {
                return("无权修改");
            }
            var model = new MemberGroupInfo();

            model.UserID    = userid;
            model.GroupID   = groupid;
            model.GroupName = context.Request["GroupName"];
            model.GroupType = 1;
            model.AddDate   = DateTime.Now;
            return(bll.Update(model).ToString().ToLower());
        }
コード例 #21
0
        /// <summary>
        ///编辑
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string Update(HttpContext context)
        {
            var requestModel = bll.ConvertRequestToModel <BarCodeInfo>(new BarCodeInfo());
            var model        = bll.Get <BarCodeInfo>(string.Format("AutoId={0}", requestModel.AutoId));

            model.BarCode = requestModel.BarCode;
            if (string.IsNullOrEmpty(model.BarCode))
            {
                model.BarCode = GetCodeByFileName(model.ImageUrl);
            }
            model.ImageUrl  = requestModel.ImageUrl;
            model.CodeName  = requestModel.CodeName;
            model.ModelCode = requestModel.ModelCode;
            if (bll.Update(model))
            {
                apiResp.status = true;
            }
            else
            {
                apiResp.msg = "编辑失败";
            }
            return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
コード例 #22
0
ファイル: DisableAccount.ashx.cs プロジェクト: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            string autoIds = context.Request["autoids"];

            if (string.IsNullOrEmpty(autoIds))
            {
                resp.errmsg  = "autoid 为必填项,请检查";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (bll.Update(new UserInfo(), string.Format(" IsDisable=1 "), string.Format(" WebsiteOwner='{0}' And IsSubAccount='1' And AutoID in ({1})", bll.WebsiteOwner, autoIds)) == autoIds.Split(',').Length)
            {
                resp.errmsg    = "ok";
                resp.isSuccess = true;
            }
            else
            {
                resp.errmsg  = "禁用子账户出错";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #23
0
ファイル: WXWAPShowInfo.aspx.cs プロジェクト: uvbs/mmp
        protected void Page_Load(object sender, EventArgs e)
        {
            Id        = Convert.ToInt32(Request["AutoId"]);
            shareLink = string.Format("http://{0}{1}?AutoId={2}", Request.Url.Host, Request.FilePath, Id);
            wxsInfo   = bll.Get <BLLJIMP.Model.WXShowInfo>(" AutoId=" + Id);
            if (wxsInfo != null)
            {
                string sourceimg = wxsInfo.ShowImg;
                wxsInfo.ShowImg = "http://" + Request.Url.Host + wxsInfo.ShowImg;
                List <BLLJIMP.Model.WXShowImgInfo> wxsInfos = bll.GetList <BLLJIMP.Model.WXShowImgInfo>(" ShowId=" + wxsInfo.AutoId);
                if (wxsInfos != null)
                {
                    for (int i = 0; i < wxsInfos.Count; i++)
                    {
                        strInit.AppendFormat("<div class=\"listli\"><img src=\"{0}\" class=\"img\" data-original=\"background-image:url({0}); \"></span>", wxsInfos[i].ImgStr);
                        strInit.AppendFormat("<span class=\"text\" style=\"color:{3};\"><h2 style=\"color:{2};\">{0}</h2>{1}</span>", wxsInfos[i].ShowTitle, wxsInfos[i].ShowContext, wxsInfos[i].ShowTitleColor, wxsInfos[i].ShowContextColor);
                        strInit.AppendFormat("<span class=\"nextbtn\"><span class=\"smallicon\"></span></span></div>");

                        if (string.IsNullOrEmpty(wxsInfos[i].ShowTitle) && string.IsNullOrEmpty(wxsInfos[i].ShowContext))
                        {
                            stranimation.Append("case " + i + ":_this.animation(current.find(\".img\"), " + wxsInfos[i].ShowAnimation.ToString() + ", function () {");
                            stranimation.Append(" _this.animation(current.find(\".nextbtn\"), 99);");
                            stranimation.Append("});break;");

                            stranimation.Append("\n");
                        }
                        else
                        {
                            //stranimation.AppendFormat("case " + i + ":_this.animation(current.find(\".img\"), " + wxsInfos[i].ShowAnimation + ", function () {");
                            string str = "case " + i + ":";
                            stranimation.Append(str + "_this.animation(current.find(\".img\")," + wxsInfos[i].ShowAnimation + ", function () {");
                            stranimation.Append("_this.animation(current.find(\".text\"), 2,");
                            string s = "function () { ";
                            stranimation.Append(s + "_this.animation(current.find(\".nextbtn\"), 99)});");
                            stranimation.Append("})");
                            stranimation.Append(";break;");

                            stranimation.Append("\n");
                        }
                    }
                }
                if (!string.IsNullOrEmpty(wxsInfo.ShowUrl))
                {
                    stranimation.Append("case " + wxsInfos.Count + ":_this.animation(current.find(\".blackpage\"), 15, function (){ ");
                    stranimation.Append("_this.maininitstate++;if(_this.maininitstate");
                    stranimation.Append(" == 2) { _this.container.css({ \"-webkit-transition\"");
                    stranimation.Append(": \"opacity 1s ease-out\", \"opacity\": \"0\" });");

                    stranimation.AppendFormat("window.location.href = '{0}';", wxsInfo.ShowUrl);

                    stranimation.Append(" var picanimate1end = function () { _this.container[0].removeEventListener(\"webkitTransitionEnd\", picanimate1end, false);");
                    stranimation.Append("_this.container.remove();}; _this.container[0].addEventListener(\"webkitTransitionEnd\", picanimate1end, false);");
                    stranimation.Append(" }}); break;");

                    stranimation.Append("\n");
                }
                stranimation.Append("default ");
                stranimation.Append(": _this.animation(current.find(\".img\")");
                stranimation.Append(", 1, function () {");
                stranimation.Append("_this.animation(current.find(\".text\"), 2,");
                stranimation.Append("function () { _this.animation(current.find(\".nextbtn\"), 99)});");
                stranimation.Append("});");


                MonitorEventDetailsInfo detailInfo = new MonitorEventDetailsInfo();
                detailInfo.MonitorPlanID  = Id;
                detailInfo.EventType      = 0;
                detailInfo.EventBrowser   = HttpContext.Current.Request.Browser == null ? "" : HttpContext.Current.Request.Browser.ToString();
                detailInfo.EventBrowserID = HttpContext.Current.Request.Browser.Id;;
                if (HttpContext.Current.Request.Browser.Beta)
                {
                    detailInfo.EventBrowserIsBata = "测试版";
                }
                else
                {
                    detailInfo.EventBrowserIsBata = "正式版";
                }

                detailInfo.EventBrowserVersion = HttpContext.Current.Request.Browser.Version;
                detailInfo.EventDate           = DateTime.Now;
                if (HttpContext.Current.Request.Browser.Win16)
                {
                    detailInfo.EventSysByte = "16位系统";
                }
                else
                if (HttpContext.Current.Request.Browser.Win32)
                {
                    detailInfo.EventSysByte = "32位系统";
                }
                else
                {
                    detailInfo.EventSysByte = "64位系统";
                }
                detailInfo.EventSysPlatform = HttpContext.Current.Request.Browser.Platform;
                detailInfo.SourceIP         = Common.MySpider.GetClientIP();
                detailInfo.IPLocation       = Common.MySpider.GetIPLocation(detailInfo.SourceIP);
                detailInfo.SourceUrl        = HttpContext.Current.Request.Url.ToString();
                detailInfo.RequesSourcetUrl = HttpContext.Current.Request.UrlReferrer != null?HttpContext.Current.Request.UrlReferrer.ToString() : "";

                detailInfo.WebsiteOwner = bll.WebsiteOwner;
                detailInfo.ModuleType   = "wshow";
                if (bll.IsLogin)
                {
                    detailInfo.EventUserID = bll.GetCurrUserID();
                }
                bll.Add(detailInfo);

                int ipCount = bll.GetCount <MonitorEventDetailsInfo>(" SourceIP ", string.Format(" WebsiteOwner='{0}' AND MonitorPlanID={1} ", bll.WebsiteOwner, Id));
                int uvCount = bll.GetCount <MonitorEventDetailsInfo>(" EventUserID ", string.Format(" EventUserID is not null AND WebsiteOwner='{0}' AND MonitorPlanID={1} ", bll.WebsiteOwner, Id));
                int pvCount = bll.GetCount <MonitorEventDetailsInfo>(string.Format(" WebsiteOwner='{0}' AND MonitorPlanID={1} ", bll.WebsiteOwner, Id));

                wxsInfo.PV      = pvCount;
                wxsInfo.IP      = ipCount;
                wxsInfo.UV      = uvCount;
                wxsInfo.ShowImg = sourceimg;
                bll.Update(wxsInfo);


                if (!string.IsNullOrEmpty(Request["sid"])) //有推广人
                {
                    if (!string.IsNullOrEmpty(wxsInfo.ShowUrl))
                    {
                        if (wxsInfo.ShowUrl.EndsWith(".chtml"))
                        {
                            //替换链接
                            var par = wxsInfo.ShowUrl.Split('/');
                            wxsInfo.ShowUrl = wxsInfo.ShowUrl.Replace(par[3], string.Format("{0}/{1}", par[3], Request["sid"]));
                            shareLink       = string.Format("{0}&sid={1}", shareLink, Request["sid"]);
                        }
                    }
                }
                else
                {
                    if (bll.IsLogin)
                    {
                        if (!string.IsNullOrEmpty(wxsInfo.ShowUrl))
                        {
                            if (wxsInfo.ShowUrl.EndsWith(".chtml"))
                            {
                                UserInfo CurrentUserInfo  = bll.GetCurrentUserInfo();
                                string   CurrentUserIDHex = Convert.ToString(CurrentUserInfo.AutoID, 16);
                                //替换链接
                                var par = wxsInfo.ShowUrl.Split('/');
                                wxsInfo.ShowUrl = wxsInfo.ShowUrl.Replace(par[3], string.Format("{0}/{1}", par[3], CurrentUserIDHex));
                                shareLink       = string.Format("{0}&sid={1}", shareLink, CurrentUserIDHex);
                            }
                        }
                    }
                }
            }
        }
コード例 #24
0
        public void ProcessRequest(HttpContext context)
        {
            string      lotteryId = context.Request["lottery_id"];
            WXLotteryV1 model     = bllLottery.GetLottery(int.Parse(lotteryId));

            if (model == null)
            {
                apiResp.msg  = "摇一摇不存在";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            MonitorEventDetailsInfo detailInfo = new MonitorEventDetailsInfo();

            detailInfo.MonitorPlanID  = int.Parse(lotteryId);
            detailInfo.EventType      = 0;
            detailInfo.EventBrowser   = HttpContext.Current.Request.Browser == null ? "" : HttpContext.Current.Request.Browser.ToString();
            detailInfo.EventBrowserID = HttpContext.Current.Request.Browser.Id;;
            if (HttpContext.Current.Request.Browser.Beta)
            {
                detailInfo.EventBrowserIsBata = "测试版";
            }
            else
            {
                detailInfo.EventBrowserIsBata = "正式版";
            }

            detailInfo.EventBrowserVersion = HttpContext.Current.Request.Browser.Version;
            detailInfo.EventDate           = DateTime.Now;
            if (HttpContext.Current.Request.Browser.Win16)
            {
                detailInfo.EventSysByte = "16位系统";
            }
            else
            if (HttpContext.Current.Request.Browser.Win32)
            {
                detailInfo.EventSysByte = "32位系统";
            }
            else
            {
                detailInfo.EventSysByte = "64位系统";
            }
            detailInfo.EventSysPlatform = HttpContext.Current.Request.Browser.Platform;
            detailInfo.SourceIP         = ZentCloud.Common.MySpider.GetClientIP();
            detailInfo.IPLocation       = ZentCloud.Common.MySpider.GetIPLocation(detailInfo.SourceIP);
            detailInfo.SourceUrl        = HttpContext.Current.Request.Url.ToString();
            detailInfo.WebsiteOwner     = bll.WebsiteOwner;
            if (bll.IsLogin)
            {
                detailInfo.EventUserID = bll.GetCurrUserID();
            }
            bool eventDetail = bll.Add(detailInfo);

            int ipCount = bll.GetCount <MonitorEventDetailsInfo>(" SourceIP ", string.Format(" WebsiteOwner='{0}' AND MonitorPlanID={1} ", bll.WebsiteOwner, int.Parse(lotteryId)));
            int uvCount = bll.GetCount <MonitorEventDetailsInfo>(" EventUserID ", string.Format(" EventUserID is not null AND WebsiteOwner='{0}' AND MonitorPlanID={1} ", bll.WebsiteOwner, int.Parse(lotteryId)));
            int pvCount = bll.GetCount <MonitorEventDetailsInfo>(string.Format(" WebsiteOwner='{0}' AND MonitorPlanID={1} ", bll.WebsiteOwner, int.Parse(lotteryId)));

            bll.Update(new WXLotteryV1(), string.Format(" IP={0},PV={1},UV={2} ", ipCount, pvCount, uvCount), string.Format(" LotteryID={0} ", int.Parse(lotteryId)));
            apiResp.msg    = "操作完成";
            apiResp.status = true;
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
コード例 #25
0
        ZentCloud.BLLJIMP.Model.UserInfo userInfo; //当前登陆的用户
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                AutoId = Request["AutoId"];
                if (!string.IsNullOrEmpty(AutoId))
                {
                    GetTheVoteInfo(AutoId);

                    MonitorEventDetailsInfo detailInfo = new MonitorEventDetailsInfo();
                    detailInfo.MonitorPlanID  = int.Parse(AutoId);
                    detailInfo.EventType      = 0;
                    detailInfo.EventBrowser   = HttpContext.Current.Request.Browser == null ? "" : HttpContext.Current.Request.Browser.ToString();
                    detailInfo.EventBrowserID = HttpContext.Current.Request.Browser.Id;;
                    if (HttpContext.Current.Request.Browser.Beta)
                    {
                        detailInfo.EventBrowserIsBata = "测试版";
                    }
                    else
                    {
                        detailInfo.EventBrowserIsBata = "正式版";
                    }

                    detailInfo.EventBrowserVersion = HttpContext.Current.Request.Browser.Version;
                    detailInfo.EventDate           = DateTime.Now;
                    if (HttpContext.Current.Request.Browser.Win16)
                    {
                        detailInfo.EventSysByte = "16位系统";
                    }
                    else
                    if (HttpContext.Current.Request.Browser.Win32)
                    {
                        detailInfo.EventSysByte = "32位系统";
                    }
                    else
                    {
                        detailInfo.EventSysByte = "64位系统";
                    }
                    detailInfo.EventSysPlatform = HttpContext.Current.Request.Browser.Platform;
                    detailInfo.SourceIP         = Common.MySpider.GetClientIP();
                    detailInfo.IPLocation       = Common.MySpider.GetIPLocation(detailInfo.SourceIP);
                    detailInfo.SourceUrl        = HttpContext.Current.Request.Url.ToString();
                    detailInfo.WebsiteOwner     = bll.WebsiteOwner;
                    detailInfo.ModuleType       = "thevote";
                    if (bll.IsLogin)
                    {
                        detailInfo.EventUserID = bll.GetCurrUserID();
                    }
                    detailInfo.ShareTimestamp = "3";
                    bll.Add(detailInfo);

                    int ipCount = bll.GetCount <MonitorEventDetailsInfo>(" SourceIP ", string.Format(" WebsiteOwner='{0}' AND MonitorPlanID={1} AND ShareTimestamp='3'  ", bll.WebsiteOwner, int.Parse(AutoId)));
                    int uvCount = bll.GetCount <MonitorEventDetailsInfo>(" EventUserID ", string.Format(" EventUserID is not null AND WebsiteOwner='{0}' AND MonitorPlanID={1} AND ShareTimestamp='3' ", bll.WebsiteOwner, int.Parse(AutoId)));
                    int pvCount = bll.GetCount <MonitorEventDetailsInfo>(string.Format(" WebsiteOwner='{0}' AND MonitorPlanID={1} AND ShareTimestamp='3' ", bll.WebsiteOwner, int.Parse(AutoId)));

                    bll.Update(new TheVoteInfo(), string.Format(" IP={0},PV={1},UV={2} ", ipCount, pvCount, uvCount), string.Format(" AutoId={0} ", AutoId));
                }
                else
                {
                    StringBuilder str = new StringBuilder();
                    str.AppendFormat("<li>");
                    str.AppendFormat("<div>{0}</div>", "没有数据");
                    str.AppendFormat("</li>");
                    needList.InnerHtml = str.ToString();
                }
            }
        }
コード例 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(Request.InputStream);
                xmlDoc.Save(string.Format("C:\\WXPay\\Notify{0}.xml", DateTime.Now.ToString("yyyyMMddHHmmssfff")));//写入日志
                //全部参数
                Dictionary <string, string> parametersAll = new Dictionary <string, string>();
                foreach (XmlElement item in xmlDoc.DocumentElement.ChildNodes)
                {
                    string key   = item.Name;
                    string value = item.InnerText;
                    if ((!string.IsNullOrEmpty(key)) && (!string.IsNullOrEmpty(value)))
                    {
                        parametersAll.Add(key, value);
                    }
                }
                parametersAll = (from entry in parametersAll
                                 orderby entry.Key ascending
                                 select entry).ToDictionary(pair => pair.Key, pair => pair.Value);//全部参数排序

                var       orderInfo = bll.Get <CrowdFundRecord>(string.Format(" RecordID={0}", parametersAll["out_trade_no"]));
                PayConfig payConfig = bllPay.GetPayConfig();
                if (!bllPay.VerifySignatureWx(parametersAll, payConfig.WXPartnerKey))//验证签名
                {
                    Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
                    return;
                }
                if (orderInfo == null)
                {
                    Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");

                    return;
                }
                if (orderInfo.Status.Equals(1))
                {
                    Response.Write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
                    return;
                }
                //更新订单状态
                if (parametersAll["return_code"].Equals("SUCCESS") && parametersAll["result_code"].Equals("SUCCESS"))//交易成功
                {
                    orderInfo.Status      = 1;
                    orderInfo.OrderStatus = "待发货";
                    orderInfo.PayTime     = DateTime.Now;
                    if (bll.Update(orderInfo))
                    {
                        Response.Write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
                        return;
                    }
                    else
                    {
                        Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
                        return;
                    }
                }
                Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
            }
            catch (Exception)
            {
                Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
            }
        }
コード例 #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Dictionary <string, string> parametersAll = bll.GetRequestParameter();
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(parametersAll["notify_data"]);
                xmlDoc.Save(string.Format("C:\\Alipay\\mallnotify{0}.xml", DateTime.Now.ToString("yyyyMMddHHmmssfff")));
                //商户订单号
                string outTradeNo = xmlDoc.SelectSingleNode("/notify/out_trade_no").InnerText;
                //支付宝交易号
                string tradeNo = xmlDoc.SelectSingleNode("/notify/trade_no").InnerText;
                //交易状态
                string tradeStatus = xmlDoc.SelectSingleNode("/notify/trade_status").InnerText;
                var    orderInfo   = bll.Get <CrowdFundRecord>(string.Format(" RecordID={0}", outTradeNo));
                if (parametersAll.Count > 0)//判断是否有带返回参数
                {
                    Notify    aliNotify    = new Notify();
                    PayConfig payConfig    = bllPay.GetPayConfig();
                    bool      verifyResult = aliNotify.VerifyNotifyMall(parametersAll, Request.Form["sign"], payConfig.Partner, payConfig.PartnerKey);
                    if (verifyResult)//验证成功
                    {
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                        //请在这里加上商户的业务逻辑程序代码

                        //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                        //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                        //解密(如果是RSA签名需要解密,如果是MD5签名则下面一行清注释掉)
                        //sPara = aliNotify.Decrypt(sPara);

                        //XML解析notify_data数据
                        if (tradeStatus == "TRADE_FINISHED")


                        {
                            //判断该笔订单是否在商户网站中已经做过处理
                            //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                            //如果有做过处理,不执行商户的业务程序

                            //注意:
                            //该种交易状态只在两种情况下出现
                            //1、开通了普通即时到账,买家付款成功后。
                            //2、开通了高级即时到账,从该笔交易成功时间算起,过了签约时的可退款时限(如:三个月以内可退款、一年以内可退款等)后。

                            if (orderInfo.Status.Equals(0))//只有未付款状态
                            {
                                orderInfo.Status      = 1;
                                orderInfo.OrderStatus = "待发货";
                                orderInfo.PayTime     = DateTime.Now;
                                if (bll.Update(orderInfo))
                                {
                                    Response.Write("success");
                                }
                                else
                                {
                                    Response.Write("fail");
                                }
                            }
                            else
                            {
                                Response.Write("success");  //请不要修改或删除
                            }
                        }
                        else if (tradeStatus == "TRADE_SUCCESS")
                        {
                            //判断该笔订单是否在商户网站中已经做过处理
                            //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                            //如果有做过处理,不执行商户的业务程序

                            //注意:
                            //该种交易状态只在一种情况下出现——开通了高级即时到账,买家付款成功后。


                            if (orderInfo.Status.Equals(0))//只有未付款状态
                            {
                                orderInfo.Status      = 1;
                                orderInfo.OrderStatus = "待发货";
                                if (bll.Update(orderInfo))
                                {
                                    Response.Write("success");
                                }
                                else
                                {
                                    Response.Write("fail");
                                }
                            }
                            else
                            {
                                Response.Write("success");  //请不要修改或删除
                            }
                        }
                        else
                        {
                            Response.Write(tradeStatus);
                        }



                        //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    }
                    else//验证失败
                    {
                        Response.Write("fail");
                    }
                }
                else
                {
                    Response.Write("无通知参数");
                }
            }
            catch (Exception)
            {
                Response.Write("fail");
            }
        }