コード例 #1
0
        /// <summary>
        /// 添加基地
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public string AddBaseInfo(HttpContext context)
        {
            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}'", userId)) > 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 = new WBBaseInfo();

            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;
            model.InsertDate   = DateTime.Now;
            model.WebsiteOwner = bll.WebsiteOwner;
            if (bll.Add(model))
            {
                resp.Status = 1;
                resp.Msg    = "添加基地成功";
            }
            else
            {
                resp.Msg = "添加基地失败";
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #2
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            try
            {
                var pagePath          = context.Request["PagePath"];
                var filterDescription = context.Request["FilterDescription"];
                var filterType        = context.Request["FilterType"];
                var matchType         = context.Request["MatchType"];
                var ex1   = context.Request["Ex1"];
                var model = new ModuleFilterInfo();
                model.PagePath          = pagePath;
                model.FilterDescription = filterDescription;
                model.FilterType        = filterType;
                model.MatchType         = matchType;
                model.Ex1 = ex1;

                if (bll.Add(model))
                {
                    UpdateRedis();
                    return("true");
                }
                return("false");

                //return bll.Add(model).ToString().ToLower();
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }

            //return "false";
        }
コード例 #3
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}
            //验证网址

            var    linkUrl = context.Request["LinkUrl"];
            var    picUrl  = context.Request["PicUrl"];
            string match   = @"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
            Regex  reg     = new Regex(match);

            if (!string.IsNullOrEmpty(linkUrl))
            {
                if (!reg.IsMatch(linkUrl))
                {
                    return("请输入正确的网址,格式如 http://www.baidu.com");
                }
            }
            //if (!reg.IsMatch(picurl))
            //{
            //     return "请输入正确的图片地址,格式如 http://www.baidu.com/icon/demo.png";
            //}

            WeixinMsgSourceInfo model = new WeixinMsgSourceInfo();

            model.UserID      = websiteOwner;//Comm.DataLoadTool.GetCurrUserID();
            model.Title       = context.Request["SourceName"];
            model.PicUrl      = picUrl;
            model.Url         = linkUrl;
            model.SourceID    = bll.GetGUID(ZentCloud.BLLJIMP.TransacType.WeixinSourceAdd);
            model.Description = context.Request["Description"];
            return(bll.Add(model).ToString().ToLower());
        }
コード例 #4
0
        /// <summary>
        /// 添加付款记录
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AddCrowdFundRecord(HttpContext context)
        {
            CrowdFundRecord model = bllBase.ConvertRequestToModel <CrowdFundRecord>(new CrowdFundRecord());

            model.UserID     = bllBase.GetCurrUserID();
            model.RecordID   = int.Parse(bllBase.GetGUID(ZentCloud.BLLJIMP.TransacType.CommAdd));
            model.InsertDate = DateTime.Now;
            if (model.Amount <= 0)
            {
                resp.Msg = "金额需大于0";
                goto outoff;
            }
            if (bllBase.Add(model))
            {
                resp.Status = 1;
                resp.ExInt  = model.RecordID;
            }
            else
            {
                resp.Status = 0;
                resp.Msg    = "付款失败";
            }
outoff:
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #5
0
        /// <summary>
        /// 添加
        /// </summary>
        private string Add(HttpContext context)
        {
            var model = new MemberGroupInfo();

            model.UserID    = Comm.DataLoadTool.GetCurrUserID();
            model.GroupName = context.Request["GroupName"];
            model.AddDate   = DateTime.Now;
            model.GroupType = 1;
            model.GroupID   = bll.GetGUID(BLLJIMP.TransacType.MemberGroupAdd);
            return(bll.Add(model).ToString().ToLower());
        }
コード例 #6
0
        /// <summary>
        /// 保存评论信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string SaveReviewInfo(HttpContext context)
        {
            string voteId     = context.Request["voteid"];
            string content    = context.Request["Content"];
            string reviewType = context.Request["ReviewType"];
            string fName      = context.Request["FName"];

            if (string.IsNullOrEmpty(content))
            {
                resp.Status = -1;
                resp.Msg    = "输入评论内容";
                goto OutF;
            }
            bool isSuccess = bll.Add(new BLLJIMP.Model.ReviewInfo()
            {
                ReviewContent  = content,
                UserId         = currentUserInfo.UserID,
                InsertDate     = DateTime.Now,
                ForeignkeyId   = voteId,
                UserName       = currentUserInfo.TrueName ?? currentUserInfo.UserID,
                ReviewType     = reviewType,
                ForeignkeyName = fName,
            });

            if (isSuccess)
            {
                resp.Status = 0;
                resp.Msg    = "评论成功";
                goto OutF;
            }
            else
            {
                resp.Status = -1;
                resp.Msg    = "评论失败";
            }

OutF:
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #7
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            var model = GetModel(context);

            if (model.RemindTime <= DateTime.Now)
            {
                return("提醒时间须晚于当前时间");
            }
            model.RemindID = Convert.ToInt32(bll.GetGUID(BLLJIMP.TransacType.RemindAdd));
            model.UserID   = Comm.DataLoadTool.GetCurrUserID();
            model.AddDate  = DateTime.Now;
            model.IsEnable = 1;
            model.IsRemind = 0;
            return(bll.Add(model).ToString().ToLower());
        }
コード例 #8
0
ファイル: AdminHandler.ashx.cs プロジェクト: uvbs/mmp
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AddCrowdFundInfo(HttpContext context)
        {
            CrowdFundInfo model = bllBase.ConvertRequestToModel <CrowdFundInfo>(new CrowdFundInfo());

            model.WebSiteOwner = bllBase.WebsiteOwner;
            if (bllBase.Add(model))
            {
                resp.Status = 1;
                resp.Msg    = "添加成功";
            }
            else
            {
                resp.Status = 0;
                resp.Msg    = "添加失败";
            }
outoff:
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #9
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}

            var userid = Comm.DataLoadTool.GetCurrUserID();

            if (string.IsNullOrEmpty(userid))
            {
                return("请重新登录");
            }
            var            flowid = int.Parse(context.Request["FlowID"]);
            WXFlowStepInfo model  = new WXFlowStepInfo();

            model.FlowID = flowid;
            var stepinfo = bll.Get <WXFlowStepInfo>(string.Format("FlowID='{0}' order by StepID DESC", flowid));//取最后一条记录

            if (stepinfo != null)
            {
                model.StepID = stepinfo.StepID + 1;
            }
            else
            {
                model.StepID = 1;
            }

            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.Add(model).ToString().ToLower());
        }
コード例 #10
0
ファイル: Add.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        = new PcPage();

            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;                                                //所有者
            model.PageId        = int.Parse(bll.GetGUID(BLLJIMP.TransacType.CommAdd));
            if (bll.Add(model))
            {
                apiResp.status = true;
            }
            else
            {
                apiResp.msg = "添加失败";
            }
            bll.ContextResponse(context, apiResp);
        }
コード例 #11
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();
                }
            }
        }
コード例 #12
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);
                            }
                        }
                    }
                }
            }
        }
コード例 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string request   = Request["s"]; //接收的参数
                int    eventType = 0;            //默认打开
                //数据验证
                if (!string.IsNullOrEmpty(request))
                {
                    if (request.EndsWith("teq1"))
                    {
                        eventType = 1;//点击khlf
                        //request = request.TrimEnd('teq1');
                        request = request.Substring(0, request.IndexOf("teq1"));
                    }

                    MonitorLinkInfo linkInfo = bll.Get <MonitorLinkInfo>(string.Format("EncryptParameter='{0}'", request));
                    if (linkInfo != null)
                    {
                        MonitorPlan planInfo = bll.Get <MonitorPlan>(string.Format("MonitorPlanID={0}", linkInfo.MonitorPlanID));
                        if (planInfo.PlanStatus.Equals("1"))
                        {
                            MonitorEventDetailsInfo model = new MonitorEventDetailsInfo();
                            //model.DetailID = int.Parse(bll.GetGUID(ZentCloud.BLLJIMP.TransacType.MonitorDetailID));
                            model.MonitorPlanID       = planInfo.MonitorPlanID;
                            model.EventType           = eventType;
                            model.LinkID              = linkInfo.LinkID;
                            model.EventBrowser        = HttpContext.Current.Request.Browser.ToString();
                            model.EventBrowserID      = HttpContext.Current.Request.Browser.Id;
                            model.EventBrowserIsBata  = HttpContext.Current.Request.Browser.Beta.ToString();
                            model.EventBrowserVersion = HttpContext.Current.Request.Browser.Version;
                            model.EventDate           = DateTime.Now;

                            if (HttpContext.Current.Request.Browser.Win32)
                            {
                                model.EventSysByte = "32位系统";
                            }
                            else
                            {
                                model.EventSysByte = "64位系统";
                            }


                            model.EventSysPlatform = HttpContext.Current.Request.Browser.Platform;
                            model.SourceIP         = Common.MySpider.GetClientIP();
                            model.IPLocation       = Common.MySpider.GetIPLocation(model.SourceIP);
                            if (Request.UrlReferrer != null)
                            {
                                model.SourceUrl = Request.UrlReferrer.ToString();
                            }
                            bll.Add(model);
                            if (eventType.Equals(1))
                            {
                                if (linkInfo != null)
                                {
                                    Response.Redirect(linkInfo.RealLink, false);
                                }
                            }
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        Response.End();
                    }
                }
            }
            catch (Exception ex)
            {
                Response.End();
            }
        }
コード例 #14
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));
        }