Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //WebsiteOwner = DataLoadTool.GetWebsiteInfoModel().WebsiteOwner;
            //foreach (var item in juActivityBll.GetList<ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='activity'", WebsiteOwner)))
            //{
            //    sbCategory.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoID, item.CategoryName);

            //}


            //DoMain = Request.Url.Host;
            //if (!bllUser.GetUserInfo(bllUser.WebsiteOwner).WeixinIsAdvancedAuthenticate.Equals(1))
            //{
            //    DoMain = "xixinxian.comeoncloud.net";
            //}
            WebsiteInfo model = bllWeisite.GetWebsiteInfo();

            if (model != null && !string.IsNullOrEmpty(model.WeiXinBindDomain))
            {
                strDomain = model.WeiXinBindDomain;
            }

            sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(juActivityBll.GetList <ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='{1}'", juActivityBll.WebsiteOwner, "activity")), "AutoID", "PreID", "CategoryName", 0, "ddlcategory", "width:200px", "全部"));


            sbCategory1.Append(new MySpider.MyCategories().GetSelectOptionHtml(juActivityBll.GetList <ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='{1}'", juActivityBll.WebsiteOwner, "activity")), "AutoID", "PreID", "CategoryName", 0, "ddlsetcategory", "width:200px", ""));



            isHide           = bllMenupermission.CheckPerRelationByaccount(bllUser.GetCurrUserID(), -1);
            IsShowActivityPv = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.IsShowActivityPv);
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cateRootId            = Convert.ToInt32(Request["cateRootId"]);
            isHideTag             = Convert.ToInt32(Request["isHideTag"]);
            isHideCate            = Convert.ToInt32(Request["isHideCate"]);
            isHideLevel           = Convert.ToInt32(Request["isHideLevel"]);
            isHideWeixin          = Convert.ToInt32(Request["isHideWeixin"]);
            isHideArea            = Convert.ToInt32(Request["isHideArea"]);
            isHideTemplate        = Convert.ToInt32(Request["isHideTemplate"]);
            isHideRelationArticle = Convert.ToInt32(Request["isHideRelationArticle"]);
            isHideUpSort          = Convert.ToInt32(Request["isHideUpSort"]);
            nickReplaceId         = Convert.ToInt32(Request["nickReplaceId"]);
            summaryReplaceTitle   = Convert.ToInt32(Request["summaryReplaceTitle"]);
            isHideSummary         = Convert.ToInt32(Request["isHideSummary"]);
            isHideImg             = Convert.ToInt32(Request["isHideImg"]);
            isHideFile            = Convert.ToInt32(Request["isHideFile"]);
            isHideUrl             = Convert.ToInt32(Request["isHideUrl"]);
            isShowPraise          = Convert.ToInt32(Request["isShowPraise"]);
            isShowFavorite        = Convert.ToInt32(Request["isShowFavorite"]);
            isShowReward          = Convert.ToInt32(Request["isShowReward"]);
            isHideDelete          = Convert.ToInt32(Request["isHideDelete"]);
            isHideAdd             = Convert.ToInt32(Request["isHideAdd"]);
            isHideShareMonitorId  = Convert.ToInt32(Request["isHideShareMonitorId"]);
            isHideCommentCount    = Convert.ToInt32(Request["isHideCommentCount"]);
            var moduleNameReq = Request["moduleName"];
            var typeReq       = Request["type"];

            WebsiteInfo model = bllWeisite.GetWebsiteInfo();

            if (model != null && !string.IsNullOrEmpty(model.WeiXinBindDomain))
            {
                strDomain = model.WeiXinBindDomain;
            }
            if (!string.IsNullOrWhiteSpace(moduleNameReq))
            {
                moduleName = moduleNameReq;
            }
            if (!string.IsNullOrWhiteSpace(typeReq))
            {
                type = typeReq;
            }
            tableFieldList = bllTableFieldMap.GetTableFieldMap(bllTableFieldMap.WebsiteOwner, "JuActivityInfo", cateRootId.ToString(), null, false, "0", null, type);
            //foreach (var item in juActivityBll.GetList<ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='article'", WebsiteOwner)))
            //{
            //    sbCategory.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoID, item.CategoryName);

            //}
            //GetTutor();
            sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(juActivityBll.GetList <ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='{1}'", juActivityBll.WebsiteOwner, type)), "AutoID", "PreID", "CategoryName", cateRootId, "ddlcategory", "width:200px", "全部"));
            sbCategory1.Append(new MySpider.MyCategories().GetSelectOptionHtml(juActivityBll.GetList <ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='{1}'", juActivityBll.WebsiteOwner, type)), "AutoID", "PreID", "CategoryName", cateRootId, "ddlsetcategory", "width:200px", ""));

            isHide = bllMenupermission.CheckPerRelationByaccount(bllUser.GetCurrUserID(), -1);

            isArticlePv  = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.IsShowArticlePv);
            WebsiteOwner = bllMenupermission.WebsiteOwner;
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PmsAdd = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.PMS_MFTRAIN_ADD);

            PmsUpdate = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.PMS_MFTRAIN_UPDATE);

            PmsDelete = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.PMS_MFTRAIN_DELETE);

            PmsEnable = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.PMS_MFTRAIN_ENABLE);
        }
Exemple #4
0
        ///// <summary>
        /////发送短信
        ///// </summary>
        //private string SendSMS(HttpContext context)
        //{


        //    string PhoneList = context.Request["PhoneList"];
        //    //var SMSContent = context.Request["SMSContent"];
        //    //if (string.IsNullOrWhiteSpace(SMSContent))
        //    //{
        //    //    return "请输入短信内容";
        //    //}

        //    //var userInfo= DataLoadTool.GetCurrUserModel();
        //    //int count = 0;
        //    //foreach (var item in PhoneList.Split(','))
        //    //{
        //    //    string Parm = string.Format("userName={0}&userPwd={1}&mobile={2}&content={3}&pipeID=membertrigger", userInfo.UserID, userInfo.Password, item, SMSContent);
        //    //    Common.HttpInterFace obj = new Common.HttpInterFace();
        //    //    string result = obj.PostWebRequest(Parm, "http://www.jubit.org/Serv/SubmitSMSAPI.aspx", System.Text.Encoding.GetEncoding("gb2312"));
        //    //    if (result=="0")
        //    //    {
        //    //        count++;
        //    //    }
        //    //    else
        //    //    {

        //    //    }

        //    //}
        //    //if (PhoneList.Split(',').Length==count)
        //    //{
        //    //    return "true";
        //    //}
        //    //else
        //    //{
        //    //    return "短信未全部发送成功,请检查余额或联系管理员";
        //    //}

        //    //BLLMember bllMember = new BLLMember("");
        //    //context.Session[SessionKey.PageRedirect] = "/Activity/ActivityData.aspx";
        //    //context.Session[SessionKey.PageCacheName] = "cache" + bllMember.GetGUID(TransacType.CacheGet);
        //    //Comm.DataCache.SetCache(context.Session[SessionKey.PageCacheName].ToString(), PhoneList);

        //    return "true";

        //}

        /// <summary>
        /// 下载报名数据
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private void DownLoadActivityData(HttpContext context)
        {
            BLLPermission.BLLMenuPermission bllMenupermission = new BLLPermission.BLLMenuPermission("");
            bool isData = bllMenupermission.CheckPerRelationByaccount(bllUser.GetCurrUserID(), -1);

            if (isData)
            {
                return;
            }
            string activityId = context.Request["ActivityID"];
            string exportType = context.Request["type"];

            if (!bllActivity.IsExistActivity(activityId))
            {
                return;
            }
            ////判断普通用户是否有相应权限
            //if (!bll.CheckActivityIDAndUser(ActivityID, cu.UserID) && userInfo.UserType != 1)
            //    return;
            #region 日志模块

            if (exportType == "DistributionOffLine")
            {
                bllLog.Add(BLLJIMP.Enums.EnumLogType.DistributionOffLine, BLLJIMP.Enums.EnumLogTypeAction.Export, bllUser.GetCurrUserID(), "导出分销员审核数据");
            }
            else
            {
                bllLog.Add(BLLJIMP.Enums.EnumLogType.DistributionOffLine, BLLJIMP.Enums.EnumLogTypeAction.Export, bllUser.GetCurrUserID(), "导出活动报名数据");
            }
            #endregion
            DataTable dataTable = bllActivity.QueryActivityData(activityId);
            string    fileName  = bllActivity.GetActivityInfoByActivityID(activityId).ActivityName;
            DataLoadTool.ExportDataTable(dataTable, string.Format("{0}_{1}_data.xls", fileName, DateTime.Now.ToString()));
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PmsAdd = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.PMS_MFCARD_ADDMYCARD);
            int totalCount;

            cardList = bll.CardList(1, int.MaxValue, "", "", out totalCount);
        }
Exemple #6
0
        public void ProcessRequest(HttpContext context)
        {
            string result = "";

            if (bllUser.IsLogin)
            {
                result = ZentCloud.Common.JSONHelper.ObjectToJson(new
                {
                    is_login  = true,
                    user_name = bllUser.GetCurrUserID()
                });
            }
            else
            {
                result = ZentCloud.Common.JSONHelper.ObjectToJson(new
                {
                    is_login  = false,
                    user_name = ""
                });
            }
            if (!string.IsNullOrEmpty(context.Request["callback"]))
            {
                //返回 jsonp数据
                result = string.Format("{0}({1})", context.Request["callback"], result);
            }
            else
            {
                //返回json数据
            }
            context.Response.Write(result);
        }
Exemple #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLLJIMP.BLLUser bllUser = new BLLJIMP.BLLUser("");
     BLLPermission.BLLMenuPermission bll = new BLLPermission.BLLMenuPermission("");
     string curUserID = bllUser.GetCurrUserID();
     canTeamExport = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.TeamExport);
 }
        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 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string curUserID = bllUser.GetCurrUserID();

            canTotalAmountExport = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.TotalAmountExport);
            canTotalAmountPrint  = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.TotalAmountPrint);
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string curUserID = bllUser.GetCurrUserID();

            canPerformanceExport        = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.PerformanceExport);
            canComputeReward            = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.ComputeReward);
            canPerformanceConfrimExport = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.PerformanceConfrimExport);
        }
Exemple #11
0
        public void ProcessRequest(HttpContext context)
        {
            var websiteInfo = bllUser.GetWebsiteInfoModelFromDataBase();

            string ids = context.Request["ids"];

            if (string.IsNullOrEmpty(ids))
            {
                apiResp.msg  = "ids为必填参数,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            string[] strIds = ids.Split(',');
            for (int i = 0; i < strIds.Length; i++)
            {
                UserInfo userModel = bllUser.GetUserInfoByAutoID(int.Parse(strIds[i]));
                if (websiteInfo.IsUnionHongware == 1)
                {
                    Open.HongWareSDK.Client hongWareClient = new Open.HongWareSDK.Client(websiteInfo.WebsiteOwner);
                    var memberInfo = hongWareClient.GetMemberInfo(userModel.WXOpenId);
                    if (memberInfo.member == null)
                    {
                        apiResp.msg = "宏巍会员不存在";
                        context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                        return;
                    }
                    if (!hongWareClient.UpdateMemberScore(memberInfo.member.mobile, userModel.WXOpenId, -memberInfo.member.point))
                    {
                        apiResp.msg = "清空宏巍会员积分失败";
                        context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                        return;
                    }
                }

                if (userModel.TotalScore == 0)
                {
                    continue;
                }
                double score = userModel.TotalScore;
                bllUser.Update(new UserInfo(), string.Format(" TotalScore=0"), string.Format("  AutoId={0} ", userModel.AutoID));

                UserScoreDetailsInfo scoreRecord = new UserScoreDetailsInfo();
                scoreRecord.UserID       = userModel.UserID;
                scoreRecord.AddTime      = DateTime.Now;
                scoreRecord.TotalScore   = 0;
                scoreRecord.Score        = -score;
                scoreRecord.ScoreType    = "AdminSubmit";
                scoreRecord.AddNote      = "积分清零";
                scoreRecord.RelationID   = bllUser.GetCurrUserID();
                scoreRecord.WebSiteOwner = bllUser.WebsiteOwner;
                bllUser.Add(scoreRecord);
            }
            apiResp.msg    = "操作完成";
            apiResp.status = true;
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string curUserID = bllUser.GetCurrUserID();

            canLockMember              = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.LockMember);
            canResetMemberPwd          = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.ResetMemberPwd);
            canCancelMemberRegister    = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.CancelMemberRegister);
            canUpdateDistributionOwner = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.UpdateDistributionOwner);
            canUpdateMemberInfo        = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.UpdateMemberInfo);
            canUpdateLoginPhone        = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.UpdateLoginPhone);
            canMemberExport            = bll.CheckUserAndPmsKey(curUserID, BLLPermission.Enums.PermissionSysKey.MemberExport);
        }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int totalCount = 0;

            ActivityList = bllMeifan.ActivityList(1, int.MaxValue, "match", "", "", out totalCount);

            GroupList = bllTag.GetTags(bllMeifan.WebsiteOwner, "", 1, int.MaxValue, out totalCount, "match");

            if (GroupList.Count > 0)
            {
                GroupListJson = ZentCloud.Common.JSONHelper.ObjectToJson(GroupList.Select(p => p.TagName));
            }
            PmsAdd = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.PMS_MFMATCH_ADDSIGNUP);
        }
Exemple #14
0
        public void ProcessRequest(HttpContext context)
        {
            string projectId    = context.Request["projectId"];
            string userId       = context.Request["userId"];
            string projectName  = context.Request["projectName"];
            string projectIntro = context.Request["projectIntro"];
            string amount       = context.Request["amount"];
            string status       = context.Request["status"];
            string remark       = context.Request["remark"];

            string type    = context.Request["type"];
            string contack = context.Request["contack"];
            string phone   = context.Request["phone"];
            string ex1     = context.Request["ex1"];
            string ex2     = context.Request["ex2"];
            string ex3     = context.Request["ex3"];
            string ex4     = context.Request["ex4"];
            string ex5     = context.Request["ex5"];
            string ex6     = context.Request["ex6"];
            string ex7     = context.Request["ex7"];
            string ex8     = context.Request["ex8"];
            string ex9     = context.Request["ex9"];
            string ex10    = context.Request["ex10"];
            string ex11    = context.Request["ex11"];
            string ex12    = context.Request["ex12"];
            string ex13    = context.Request["ex13"];
            string ex14    = context.Request["ex14"];
            string msg     = "";

            if (string.IsNullOrEmpty(userId))
            {
                userId = bllUser.GetCurrUserID();
            }
            apiResp.status = bll.UpdateProject(int.Parse(projectId), userId, projectName, projectIntro, amount, status, out msg, remark, ex1, ex2, ex3, ex4, ex5, ex6, ex7, ex8, ex9, ex10, ex11, ex12, ex13, ex14, type, contack, phone);
            if (apiResp.status)
            {
                apiResp.msg = "修改成功";
            }
            else
            {
                apiResp.msg = msg;
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
Exemple #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            currWebSiteInfo = bll.Get <ZentCloud.BLLJIMP.Model.WebsiteInfo>(string.Format(" WebsiteOwner='{0}'", bll.WebsiteOwner));
            AMapKey         = ZentCloud.Common.ConfigHelper.GetConfigString("AMapKey");

            if (bll.IsLogin)
            {
                var currentUserInfo = bllUser.GetUserInfo(bllUser.GetCurrUserID(), bllUser.WebsiteOwner);
                if (!string.IsNullOrEmpty(currentUserInfo.BindId) && (string.IsNullOrEmpty(Request["redict"])))
                {
                    if (bll.WebsiteOwner == "hailandev")
                    {
                        Response.Redirect("/customize/comeoncloud/Index.aspx?cgid=1618");
                    }
                    else
                    {
                        Response.Redirect("/customize/comeoncloud/Index.aspx?cgid=1595");
                    }
                }
            }
        }
Exemple #16
0
        public void ProcessRequest(HttpContext context)
        {
            //try
            //{
            BLLJIMP.BLLJuActivity   bllJuactivity   = new BLLJIMP.BLLJuActivity("");
            BLLJIMP.BLLUser         bllUser         = new BLLJIMP.BLLUser("");
            BLLJIMP.BLLMonitor      bllMonitor      = new BLLJIMP.BLLMonitor();
            BLLJIMP.BLLWebSite      bllwebSite      = new BLLJIMP.BLLWebSite();
            BLLJIMP.BLLShareMonitor bllShareMonitor = new BLLJIMP.BLLShareMonitor();

            ///推广用户信息
            UserInfo spreadUser = null;

            //分享用户
            UserInfo shareUser = null;

            CompanyWebsite_Config companyConfig = bllwebSite.GetCompanyWebsiteConfig();

            currentUrl = context.Request.Url.ToString(); //当前绝对地址
            string filePath = context.Request.FilePath;  //当前相对路径

            #region 微信推广(展示文章页面)
            if (filePath.Contains(".chtml"))
            {
                ToLog(context, " monitorhandler filePath:" + filePath);
                string[] parameters = filePath.Split('/');
                if (parameters.Length > 2)
                {
                    int activityId = Convert.ToInt32(parameters[1], 16);//ZCJ_JuActivityInfo 文章ID;
                    ToLog(context, " monitorhandler 文章ID:" + activityId);
                    long memberID = 0;

                    if (parameters.Length > 3)
                    {
                        //memberID = parameters[2] == "XXX" ? 0 : Convert.ToInt32(parameters[2], 16);//ZCJ_WXMemberInfo 会员注册ID;
                        spreadUser = bllUser.GetUserInfoByAutoID(Convert.ToInt32(parameters[2], 16));
                    }


                    string currOpenerOpenID = parameters.Length > 5 ? parameters[3] : string.Empty;//当前打开者的OpenID

                    string spreadUserID = context.Request["spreadU"] == null ? "" : context.Request["spreadU"].ToString();

                    string shareTimestamp = context.Request["shareTimestamp"];

                    if (!string.IsNullOrWhiteSpace(spreadUserID))
                    {
                        spreadUserID = Common.Base64Change.DecodeBase64ByUTF8(spreadUserID);
                    }

                    string spreadUserAutoIDStr = context.Request["ua"] == null ? "" : context.Request["ua"].ToString();//推广ID,原始id*1000,16进制后进行base64,然后“=”变成“_”
                    int    spreadUserAutoID    = 0;
                    if (!string.IsNullOrWhiteSpace(spreadUserAutoIDStr))
                    {
                        spreadUserAutoID = bllJuactivity.TransmitIntDeCode(spreadUserAutoIDStr);//Convert.ToInt32(Common.Base64Change.DecodeBase64ByUTF8(spreadUserAutoIDStr.Replace("_", "=")), 16) / 1000;
                    }

                    string shareId = context.Request["comeonshareid"] == null ? "" : context.Request["comeonshareid"].ToString();

                    if (!string.IsNullOrWhiteSpace(shareId))
                    {
                        ToLog(context, " monitorhandler 执行shareId查找分享任务: " + shareId);
                        try
                        {
                            var shareInfo = bllShareMonitor.GetShareInfo(shareId);

                            if (!string.IsNullOrWhiteSpace(shareInfo.UserId))
                            {
                                shareUser = bllUser.GetUserInfo(shareInfo.UserId);
                            }
                        }
                        catch (Exception ex)
                        {
                            ToLog(context, " monitorhandler 获取shareUser异常: " + ex.Message);
                        }
                    }



                    JuActivityInfo activityInfo = bllJuactivity.Get <JuActivityInfo>(string.Format("JuActivityID={0} AND IsDelete=0 ", activityId));//文章信息

                    if (activityInfo == null)
                    {
                        context.Response.WriteFile("/Error/NotExist.html");
                        return;
                    }

                    ToLog(context, " monitorhandler 找到文章,开始构造内容: " + activityInfo.JuActivityID);

                    //if (activityInfo.ArticleType == "activity")
                    //{
                    //    if (activityInfo.ActivityStatus == 1)
                    //    {
                    //        context.Response.Redirect("/Error/CommonMsg.aspx?msg=报名已结束,有疑问请联系我们&&icon=icon iconfont icon-kulian kulian");
                    //        return;
                    //    }
                    //}

                    #region 检查是否付费活动

                    if (activityInfo.IsFee == 1 && !bllJuactivity.IsLogin)
                    {
                        context.Response.Redirect("/App/Cation/Wap/FreeActivityPage.aspx?aid=" + activityInfo.JuActivityID);
                        return;
                    }
                    #endregion

                    #region 检查访问级别
                    if (activityInfo.AccessLevel > 0)
                    {
                        if (!bllUser.IsLogin)
                        {
                            appLoginUrl = Common.ConfigHelper.GetConfigString("appLoginUrl").ToLower();
                            context.Response.Redirect(appLoginUrl + string.Format("?redirect=" + HttpUtility.UrlEncode(currentUrl)), true);
                            return;
                        }
                        //else if (!bllUser.IsMember() && activityInfo.AccessLevel == 1)
                        //{

                        //}
                        else if (bllUser.GetCurrentUserInfo().AccessLevel < activityInfo.AccessLevel)
                        {
                            //if (companyConfig.NoPermissionsPage == 0)
                            //{
                            //    context.Response.WriteFile("/Error/NoPmsMobile.htm");
                            //    return;
                            //}
                            //else if (companyConfig.NoPermissionsPage == 1)
                            //{
                            //    context.Response.Redirect("/App/Cation/Wap/UserEdit.aspx",true);
                            //    context.Response.End();
                            //    return;
                            //}
                            context.Response.WriteFile("/Error/NoPmsMobile.htm");
                            return;
                        }
                    }
                    #endregion

                    #region 检查访问级别

                    //WXMemberInfo regInfo = juactivityBll.Get<WXMemberInfo>(string.Format("MemberID={0}", memberID));//会员注册信息
                    // UserInfo userInfo = juactivityBll.Get<UserInfo>(string.Format("UserID='{0}'", activityInfo.UserID));//文章发布者信息
                    SystemSet systemset  = bllJuactivity.Get <SystemSet>(""); //系统配置信息
                    string    pageSource = "";                                //待输出的html源代码

                    if (systemset != null)
                    {
                        if (string.IsNullOrWhiteSpace(currOpenerOpenID))
                        {
                            //取得Session里的当前OpenID
                            currOpenerOpenID = context.Session[systemset.WXCurrOpenerOpenIDKey] != null ? context.Session[systemset.WXCurrOpenerOpenIDKey].ToString() : "";
                        }

                        if (string.IsNullOrWhiteSpace(currOpenerOpenID))
                        {
                            //如果再为空,由链接上面get参数获取
                            currOpenerOpenID = context.Request[systemset.WXCurrOpenerOpenIDKey] != null ? context.Request[systemset.WXCurrOpenerOpenIDKey].ToString() : "";
                        }
                    }
                    #endregion



                    //if (regInfo == null)
                    //{
                    //    regInfo = new WXMemberInfo() { Name = "none", WeixinOpenID = "" };
                    //}

                    if ((activityInfo != null))//
                    {
                        //var planInfo = bllJuactivity.Get<MonitorPlan>(string.Format("MonitorPlanID={0}", activityInfo.MonitorPlanID));
                        //if (planInfo == null)
                        //{
                        //    return;
                        //}
                        //else
                        //{
                        //    if (planInfo.PlanStatus == "0")//任务已停止
                        //    {
                        //        return;
                        //    }

                        //}

                        ToLog(context, " monitorhandler 开始执行GetJuactivityHtml: " + activityInfo.JuActivityID);
                        pageSource = bllJuactivity.GetJuactivityHtml(activityInfo, currOpenerOpenID, context.Request.Url.ToString(), spreadUser, shareUser);
                        ToLog(context, " monitorhandler 执行GetJuactivityHtml完毕: " + activityInfo.JuActivityID);

                        #region 事件记录
                        //事件
                        //int OpenCount = 0;//打开人数
                        //int DistinctOpenCount = 0;//独立IP数量
                        MonitorEventDetailsInfo detailInfo = new MonitorEventDetailsInfo();
                        detailInfo.MonitorPlanID  = activityInfo.MonitorPlanID;
                        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() : "";

                        if (spreadUser != null)
                        {
                            detailInfo.SpreadUserID = spreadUser.UserID;
                        }
                        detailInfo.SpreadUserAutoID = spreadUserAutoID;
                        detailInfo.ShareTimestamp   = shareTimestamp;
                        detailInfo.WebsiteOwner     = bllJuactivity.WebsiteOwner;
                        detailInfo.ModuleType       = activityInfo.ArticleType;
                        if (bllUser.IsLogin)
                        {
                            detailInfo.EventUserID = bllUser.GetCurrUserID();
                        }


                        if (spreadUser != null)//带推广信息
                        {
                            //try
                            //{
                            //    if (!string.IsNullOrWhiteSpace(currOpenerOpenID))
                            //    {
                            //        //记录触发人
                            //        UserInfo eventUser = new BLLJIMP.BLLUser("").GetUserInfoByOpenId(currOpenerOpenID);
                            //        detailInfo.EventUserID = eventUser.UserID;
                            //    }
                            //}
                            //catch { }
                            string          url = string.Format("http://{0}{1}", context.Request.Url.Host, filePath);
                            MonitorLinkInfo linkInfo;
                            try
                            {
                                linkInfo = bllJuactivity.Get <MonitorLinkInfo>(string.Format(" LinkName='{0}' And MonitorPlanID={1}", spreadUser.UserID, activityInfo.MonitorPlanID));
                            }
                            catch (Exception ex)
                            {
                                context.Response.Write("ex" + ex.ToString());
                                return;
                            }



                            if (linkInfo != null)
                            {
                                linkInfo.ActivityName   = activityInfo.ActivityName;
                                linkInfo.ThumbnailsPath = activityInfo.ThumbnailsPath;
                                //已经为该用户建立推广链接
                                detailInfo.LinkID = linkInfo.LinkID;
                                //if (linkInfo.OpenCount != null)//增加打开人数
                                //{
                                linkInfo.OpenCount++;
                                //}
                                //else
                                //{
                                //    linkInfo.OpenCount = 1;
                                //}
                                int shareCount = bllJuactivity.GetCount <MonitorEventDetailsInfo>("ShareTimestamp", string.Format(" LinkID ={0} and ShareTimestamp is not null and ShareTimestamp <> '' and ShareTimestamp <> '0' ", linkInfo.LinkID));
                                linkInfo.ShareCount = shareCount;
                                int ipCount = bllJuactivity.GetCount <MonitorEventDetailsInfo>(" SourceIP ", string.Format(" LinkID = {0} ", linkInfo.LinkID));
                                linkInfo.DistinctOpenCount = ipCount;
                                bllJuactivity.Update(linkInfo, string.Format(" OpenCount={0},DistinctOpenCount={1},ShareCount={2}", linkInfo.OpenCount, ipCount, shareCount), string.Format("LinkID={0}", linkInfo.LinkID));
                            }
                            else
                            {
                                //还没有为该用户建立推广链接
                                MonitorLinkInfo newLinkinfo = new MonitorLinkInfo();
                                newLinkinfo.LinkID            = int.Parse(bllJuactivity.GetGUID(ZentCloud.BLLJIMP.TransacType.MonitorLinkID));
                                newLinkinfo.MonitorPlanID     = activityInfo.MonitorPlanID;
                                newLinkinfo.WXMemberID        = memberID;
                                newLinkinfo.LinkName          = spreadUser.UserID;
                                newLinkinfo.RealLink          = url;
                                newLinkinfo.InsertDate        = DateTime.Now;
                                newLinkinfo.OpenCount         = 1;
                                newLinkinfo.ActivityName      = activityInfo.ActivityName;
                                newLinkinfo.ThumbnailsPath    = activityInfo.ThumbnailsPath;
                                newLinkinfo.WebsiteOwner      = bllJuactivity.WebsiteOwner;
                                newLinkinfo.DistinctOpenCount = 1; // ip
                                newLinkinfo.ShareCount        = 0; //分享数
                                if (activityInfo.ArticleType == "article")
                                {
                                    newLinkinfo.ForwardType = "fans";
                                    newLinkinfo.ActivityId  = activityInfo.JuActivityID;
                                }
                                if (!string.IsNullOrEmpty(activityInfo.SignUpActivityID) && activityInfo.ArticleType == "activity")
                                {
                                    newLinkinfo.ActivityId = int.Parse(activityInfo.SignUpActivityID);
                                }

                                StringBuilder sqlWhere = new StringBuilder();
                                sqlWhere.AppendFormat(@"
                                if not exists(select 1 from ZCJ_MonitorLinkInfo where LinkName='{14}' and MonitorPlanID={15} ) 
                                begin
                                    insert into ZCJ_MonitorLinkInfo (LinkID,MonitorPlanID,WXMemberID,LinkName,RealLink,InsertDate,OpenCount,ActivityName,ThumbnailsPath,WebsiteOwner,DistinctOpenCount,ShareCount,ForwardType,ActivityId)
                                                values({0},{1},{2},'{3}','{4}','{5}',{6},'{7}','{8}','{9}',{10},{11},'{12}',{13})
                                end 
                                ", newLinkinfo.LinkID, newLinkinfo.MonitorPlanID, newLinkinfo.WXMemberID, newLinkinfo.LinkName, newLinkinfo.RealLink, newLinkinfo.InsertDate, newLinkinfo.OpenCount, newLinkinfo.ActivityName, newLinkinfo.ThumbnailsPath, newLinkinfo.WebsiteOwner, newLinkinfo.DistinctOpenCount, newLinkinfo.ShareCount, newLinkinfo.ForwardType, newLinkinfo.ActivityId, spreadUser.UserID, activityInfo.MonitorPlanID);


                                if (ZentCloud.ZCDALEngine.DALEngine.ExecuteSql(sqlWhere.ToString()) > 0)
                                {
                                    detailInfo.LinkID = newLinkinfo.LinkID;
                                }
                            }
                        }


                        //添加事件详细
                        //if (!filePath.Contains("?"))
                        //{
                        bllJuactivity.Add(detailInfo);
                        //DistinctOpenCount = juactivityBll.GetCount<ZentCloud.BLLJIMP.Model.MonitorEventDetailsInfo>("SourceIP", string.Format("LinkID={0} and EventType=0", detailInfo.LinkID));
                        //juactivityBll.Update(new MonitorLinkInfo(), string.Format(" OpenCount={0},DistinctOpenCount={1}", OpenCount, DistinctOpenCount), string.Format("LinkID={0}", detailInfo.LinkID));
                        #region 微转发活动加积分
                        if (bllUser.IsLogin && spreadUser != null)
                        {
                            if (activityInfo.ArticleType == "activity")
                            {
                                if (bllJuactivity.GetCount <MonitorEventDetailsInfo>(string.Format(" MonitorPlanID='{0}' And EventUserID='{1}' And SpreadUserID='{2}' And EventUserID!='{2}'", detailInfo.MonitorPlanID, bllUser.GetCurrUserID(), spreadUser.UserID)) == 1)
                                {
                                    string remark = string.Format("转发活动《{0}》", activityInfo.ActivityName);
                                    //微转发加积分
                                    bllUser.AddUserScoreDetail(spreadUser.UserID, CommonPlatform.Helper.EnumStringHelper.ToString(ZentCloud.BLLJIMP.Enums.ScoreDefineType.ForwardArticle), spreadUser.WebsiteOwner, null, remark);
                                }
                            }
                        }
                        #endregion


                        //}
                        context.Response.ClearContent();
                        //处理完成
                        context.Response.Write(pageSource);
                        //更新微信阅读人数
                        //bllJuactivity.UpdateUVCount(activityInfo.JuActivityID);
                        bllJuactivity.UpDateIPPVShareCount(activityInfo);
                        bllJuactivity.UpdateActivityForwardPVUV(activityInfo);
                        if (spreadUser != null)
                        {
                            bllMonitor.UpdateUV(activityInfo.MonitorPlanID, spreadUser.UserID);
                            //bllMonitor.UpdateSignUpCount(activityInfo.MonitorPlanID, spreadUser.UserID);
                        }
                        if (!string.IsNullOrWhiteSpace(activityInfo.RedirectUrl))
                        {
                            context.Response.Redirect(activityInfo.RedirectUrl);
                        }
                        return;

                        #endregion

                        ToLog(context, " monitorhandler 事件记录完毕: " + activityInfo.JuActivityID);
                    }
                    else
                    {
                        context.Response.Write("<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\" /></head><body>链接无效。</body></html>");
                        return;
                    }
                }
            }
            #endregion
            #region 注释
            //#region 微信会员注册
            //else if (filePath.StartsWith("/weixin"))
            //{

            //    //微信会员注册
            //    if (filePath.Contains("wx_reg.chtml") && (!filePath.Contains("/weixin/wx_reg.chtml")))
            //    {
            //        string[] parameters = filePath.Split('/');

            //        string weixinMemberId = Convert.ToInt32(parameters[2], 16).ToString();// ZCJ_WeixinMemberInfo WeixinMemberID
            //        var weixinmemberinfo = juactivityBll.Get<WeixinMemberInfo>(string.Format("WeixinMemberID={0}", weixinMemberId));
            //        string RegCode = Common.IOHelper.GetFileStr(context.Server.MapPath("/weixin/wx_reg.htm"), Encoding.UTF8);//注册代码

            //        if (RegCode.Contains("$CCWXOPENID$"))
            //        {
            //            RegCode = RegCode.Replace("$CCWXOPENID$", weixinmemberinfo.WeixinOpenID);
            //        }
            //        if (RegCode.Contains("$CCWXAID$"))//注册到哪个账户下
            //        {

            //            RegCode = RegCode.Replace("$CCWXAID$", Convert.ToString(juactivityBll.Get<UserInfo>(string.Format("UserID='{0}'", weixinmemberinfo.UserID)).AutoID, 16));

            //        }

            //        context.Response.Write(RegCode);//输出注册代码


            //        //微信会员注册

            //    }

            //}

            //#endregion
            #endregion

            //}
            //catch (Exception ex)
            //{
            //    using (StreamWriter sw = new StreamWriter(@"C:\MonitorHandlerException.txt", true, Encoding.UTF8))
            //    {
            //        sw.WriteLine(string.Format("{0} MonitorHandler拦截处理异常:{1}", DateTime.Now.ToString(), ex.ToString()));

            //    }
            //    context.Response.Write("exception");
            //}
        }
Exemple #17
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            if (bllUser.IsLogin == false)
            {
                resp.errcode = -1;
                resp.errmsg  = "你还没有登录,请先登录";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            string       data = context.Request["data"];
            RequestModel requestModel;

            try
            {
                requestModel = ZentCloud.Common.JSONHelper.JsonToModel <RequestModel>(context.Request["data"]);
            }
            catch (Exception)
            {
                resp.errcode = -1;
                resp.errmsg  = "json格式错误,请检查";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            //检查必填项
            if (requestModel.order_id <= 0)
            {
                resp.errcode = 1;
                resp.errmsg  = "订单号出错";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_name))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人姓名";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_phone))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人电话";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_province))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人省份名称";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_province_code))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人省份代码";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_city))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人城市名称";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_city_code))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人城市代码";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_dist))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人区域名称";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_dist_code))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人区域代码";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_address))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人街道地址";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(requestModel.receiver_zip))
            {
                resp.errcode = 1;
                resp.errmsg  = "请输入收货人邮政编码";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            WXMallGiftOrderInfo giftorder = bllUser.Get <WXMallGiftOrderInfo>(string.Format(" OrderId={0} AND UserId='{1}' AND WebsiteOwner='{2}'", requestModel.order_id, bllUser.GetCurrUserID(), bllUser.WebsiteOwner));

            //检查是否已经领取
            if (giftorder != null)
            {
                resp.errcode = -1;
                resp.errmsg  = "你已经领取过了";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            //查看订单详情
            WXMallOrderDetailsInfo orderdetail = bllUser.Get <WXMallOrderDetailsInfo>(string.Format(" OrderID={0} ", requestModel.order_id));
            int OrderCount = bllUser.GetCount <WXMallGiftOrderInfo>(string.Format(" OrderId={0} ", requestModel.order_id));

            if (OrderCount >= orderdetail.TotalCount)
            {
                resp.errcode = -1;
                resp.errmsg  = "已经领完";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            WXMallGiftOrderInfo mallGiftOrderInfo = new WXMallGiftOrderInfo();

            mallGiftOrderInfo.GiftOrderId          = int.Parse(bllUser.GetGUID(BLLJIMP.TransacType.CommAdd));
            mallGiftOrderInfo.OrderId              = requestModel.order_id;
            mallGiftOrderInfo.ReceiveName          = requestModel.receiver_name;
            mallGiftOrderInfo.ReceivePhone         = requestModel.receiver_phone;
            mallGiftOrderInfo.InsertDate           = DateTime.Now;
            mallGiftOrderInfo.WebsiteOwner         = bllUser.WebsiteOwner;
            mallGiftOrderInfo.UserId               = bllUser.GetCurrUserID();
            mallGiftOrderInfo.ReceiverProvince     = requestModel.receiver_province;
            mallGiftOrderInfo.ReceiverProvinceCode = requestModel.receiver_province_code;
            mallGiftOrderInfo.ReceiverCity         = requestModel.receiver_city;
            mallGiftOrderInfo.ReceiverCityCode     = requestModel.receiver_city_code;
            mallGiftOrderInfo.ReceiverDist         = requestModel.receiver_dist;
            mallGiftOrderInfo.ReceiverDistCode     = requestModel.receiver_dist_code;
            mallGiftOrderInfo.Address              = requestModel.receiver_address;
            mallGiftOrderInfo.ZipCode              = requestModel.receiver_zip;
            if (bllUser.Add(mallGiftOrderInfo))
            {
                resp.errcode = 0;
                resp.errmsg  = "领取成功";
            }
            else
            {
                resp.errcode = -1;
                resp.errmsg  = "领取出错";
            }

            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
            return;
        }
Exemple #18
0
        /// <summary>
        /// 添加预约
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AddOrder(HttpContext context)
        {
            try
            {
                string   id  = context.Request["id"]; //多个医生id
                string[] ids = new string[] { };      //多个医生id
                if (!string.IsNullOrEmpty(id))
                {
                    id  = id.TrimStart(',').TrimEnd(',');
                    ids = id.Split(',');
                }
                if (ids.Length >= 1)//检查是否可以预约
                {
                    foreach (var item in ids)
                    {
                        WXMallProductInfo productInfoCheck = bllMall.GetProduct(item);
                        if (productInfoCheck != null)
                        {
                            if (productInfoCheck.Stock <= 0)
                            {
                                apiResp.msg = string.Format("专家{0}的预约已满", productInfoCheck.PName);
                                return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                            }
                        }
                    }
                }

                WXMallProductInfo productInfo = new WXMallProductInfo();
                WXMallOrderInfo   orderInfo   = bllMall.ConvertRequestToModel <WXMallOrderInfo>(new WXMallOrderInfo());
                if (string.IsNullOrEmpty(orderInfo.Consignee))
                {
                    apiResp.msg = "请填写姓名";
                    return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                }
                if (string.IsNullOrEmpty(orderInfo.Ex1))
                {
                    apiResp.msg = "请填写年龄";
                    return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                }
                if (string.IsNullOrEmpty(orderInfo.Ex2))
                {
                    apiResp.msg = "请选择性别";
                    return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                }
                if (string.IsNullOrEmpty(orderInfo.Phone))
                {
                    apiResp.msg = "请填写手机号";
                    return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                }
                if (!Common.MyRegex.PhoneNumLogicJudge(orderInfo.Phone))
                {
                    apiResp.msg = "请输入正确手机号";
                    return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                }

                StringBuilder sbWhere = new StringBuilder();
                sbWhere.AppendFormat("  WebsiteOwner='{0}' And TableName ='ZCJ_WXMallOrderInfo' Order by Sort DESC", bllMall.WebsiteOwner);
                var fieldList = bllMall.GetList <TableFieldMapping>(sbWhere.ToString());
                if (fieldList != null && fieldList.Count > 0)
                {
                    Type type = orderInfo.GetType();
                    fieldList = fieldList.Where(p => p.FieldIsNull == 0).ToList();
                    foreach (var field in fieldList)
                    {
                        System.Reflection.PropertyInfo propertyInfo = type.GetProperty(field.Field); //获取指定名称的属性
                        var value = propertyInfo.GetValue(orderInfo, null);                          //获取属性值
                        if (value == null || string.IsNullOrEmpty(value.ToString()))
                        {
                            switch (field.FieldType)
                            {
                            case "text":
                                apiResp.msg = "请填写 " + field.MappingName;
                                break;

                            case "combox":    //下拉框
                                apiResp.msg = "请选择 " + field.MappingName;
                                break;

                            case "checkbox":    //下拉框
                                apiResp.msg = "请选择 " + field.MappingName;
                                break;

                            default:
                                break;
                            }

                            return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                        }
                    }
                }



                orderInfo.OrderID      = bllMall.GetGUID(BLLJIMP.TransacType.AddMallOrder);
                orderInfo.WebsiteOwner = bllMall.WebsiteOwner;
                orderInfo.InsertDate   = DateTime.Now;
                orderInfo.OrderUserID  = "defualt";
                orderInfo.Status       = "未确认";
                if (bllMall.IsLogin)
                {
                    orderInfo.OrderUserID = bllUser.GetCurrUserID();
                }
                if (!string.IsNullOrEmpty(orderInfo.Ex6))//科系
                {
                    //推荐
                    int categoryId;
                    if (int.TryParse(orderInfo.Ex6, out categoryId))
                    {
                        WXMallCategory category = bllMall.Get <WXMallCategory>(string.Format(" AutoId={0}", categoryId));
                        if (category != null)
                        {
                            orderInfo.Ex6 = category.CategoryName;
                        }
                    }
                }
                else
                {
                    //正常预约
                    if (ids.Length == 1)
                    {
                        productInfo = bllMall.GetProduct(ids[0]);
                        if (productInfo != null)
                        {
                            if (!string.IsNullOrEmpty(productInfo.CategoryId))
                            {
                                WXMallCategory category = bllMall.Get <WXMallCategory>(string.Format(" AutoId={0}", productInfo.CategoryId));
                                if (category != null)
                                {
                                    orderInfo.Ex6 = category.CategoryName;
                                }
                            }
                        }
                    }
                }
                if (!string.IsNullOrEmpty(orderInfo.Ex5))//医生 名字或多个Id
                {
                    orderInfo.Ex5 = orderInfo.Ex5.TrimStart(',').TrimEnd(',');
                    string names = "";
                    foreach (var item in orderInfo.Ex5.Split(','))
                    {
                        int pId;
                        if (int.TryParse(item, out pId))
                        {
                            productInfo = bllMall.GetProduct(pId.ToString());
                            if (productInfo != null)
                            {
                                names += productInfo.PName + ",";
                                if (productInfo.Stock <= 0)
                                {
                                    apiResp.msg = string.Format("专家{0}的预约已满", productInfo.PName);
                                    return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                                }
                            }
                        }
                    }
                    if (orderInfo.Ex5.Split(',').Length >= 1 && (!string.IsNullOrEmpty(names)))
                    {
                        orderInfo.Ex5 = names.TrimEnd(',');
                    }
                }

                ZentCloud.ZCBLLEngine.BLLTransaction tran = new ZCBLLEngine.BLLTransaction();
                if (!bllMall.Add(orderInfo, tran))
                {
                    apiResp.msg = "操作失败";
                    return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                }
                if (ids.Length > 0)
                {
                    if (bllMall.Update(productInfo, string.Format("Stock-=1,SaleCount+=1"), string.Format("PID in({0})", id)) < ids.Length)
                    {
                        tran.Rollback();
                        apiResp.msg = "操作失败";
                        return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                    }
                }

                tran.Commit();
                apiResp.status = true;
                bllWeixin.SendTemplateMessageToKefu("有新的预约", string.Format("姓名:{0}\\n手机:{1}", orderInfo.Consignee, orderInfo.Phone));
            }
            catch (Exception ex)
            {
                apiResp.msg = ex.Message;
            }

            return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
Exemple #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     isHide = bllMenupermission.CheckPerRelationByaccount(bllUser.GetCurrUserID(), -1);
 }
Exemple #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            websiteInfo = bllUser.GetWebsiteInfoModelFromDataBase(bllUser.WebsiteOwner);
            if (websiteInfo.MemberMgrBtn == null)
            {
                websiteInfo.MemberMgrBtn = "updateinfo,updatetag,sendweixinmsg,sendweixinmsgbytag";
            }
            websiteOwner = bllUser.WebsiteOwner;

            isHideAddBtn         = Convert.ToInt32(Request["isHideAddBtn"]);
            isHideEditBtn        = Convert.ToInt32(Request["isHideEditBtn"]);
            isHideTagBtn         = Convert.ToInt32(Request["isHideTagBtn"]);
            isHideScoreClearBtn  = Convert.ToInt32(Request["isHideScoreClearBtn"]);
            isHideMemberLevelBtn = Convert.ToInt32(Request["isHideMemberLevelBtn"]);
            isHideOrderInfoBtn   = Convert.ToInt32(Request["isHideOrderInfoBtn"]);
            isHideChannelBtn     = Convert.ToInt32(Request["isHideChannelBtn"]);
            isHideWxNewsBtn      = Convert.ToInt32(Request["isHideWxNewsBtn"]);
            isHideDataClrar      = Convert.ToInt32(Request["isHideDataClrar"]);
            isHideDisableBtn     = Convert.ToInt32(Request["isHideDisableBtn"]);
            isHideEditPwdBtn     = Convert.ToInt32(Request["isHideEditPwdBtn"]);
            isHidefilterBtn      = Convert.ToInt32(Request["isHidefilterBtn"]);
            isHideRecommended    = Convert.ToInt32(Request["isHideRecommended"]);
            isHideAccountAmount  = Convert.ToInt32(Request["isHideAccountAmount"]);
            if (!string.IsNullOrEmpty(Request["moduleName"]))
            {
                moduleName = Request["moduleName"];
            }
            if (!string.IsNullOrEmpty(Request["user_type"]))
            {
                userType = Request["user_type"];
            }
            List <string> domainList = new List <string>();

            domainList.Add("www.aussieorigin.cn");
            domainList.Add("www.aussieorigin.com.cn");
            if (domainList.Contains(Request.Url.Host))
            {
                IsShowUserType = true;
            }
            page_type             = Request["page"];
            IsShowScore           = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.UpdateMemberScore);
            IsShowAccountAmount   = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.UpdateMemberBalance);
            IsShowSendTempMessage = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.SendTtemplatMessage);

            formField = bllTableFieldMap.GetTableFieldMapByWebsite(bllTableFieldMap.WebsiteOwner, "ZCJ_UserInfo", null, null, this.Request["mapping_type"]);
            if (formField.Count > 0)
            {
                mapping_type = formField[0].MappingType.ToString();
            }

            if (formField.FirstOrDefault(p => p.Field == "AutoID") != null)
            {
                idFieldName = formField.FirstOrDefault(p => p.Field == "AutoID").MappingName;
            }
            if (formField.FirstOrDefault(p => p.Field == "WXHeadimgurl") != null)
            {
                wxHeadimgurlFieldName = formField.FirstOrDefault(p => p.Field == "WXHeadimgurl").MappingName;
            }
            if (formField.FirstOrDefault(p => p.Field == "TotalScore") != null)
            {
                totalScoreFieldName = formField.FirstOrDefault(p => p.Field == "TotalScore").MappingName;
            }
            if (formField.FirstOrDefault(p => p.Field == "UserType") != null)
            {
                userTypeFieldName = formField.FirstOrDefault(p => p.Field == "UserType").MappingName;
            }
            if (formField.FirstOrDefault(p => p.Field == "AccessLevel") != null)
            {
                accessLevelFieldName = formField.FirstOrDefault(p => p.Field == "AccessLevel").MappingName;
            }
            if (formField.FirstOrDefault(p => p.Field == "AccountAmount") != null)
            {
                accountAmountLevelFieldName = formField.FirstOrDefault(p => p.Field == "AccountAmount").MappingName;
            }
        }
Exemple #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     isAutoKey = this.Request["isAutoKey"];
     redirect  = this.Request["redirect"];
     isHide    = bllMenupermission.CheckPerRelationByaccount(bllUser.GetCurrUserID(), -1);
 }
Exemple #22
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1;
            int    pageSize  = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 5;
            string date      = context.Request["time"];

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

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

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

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

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

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

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

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

                default:
                    break;
                }
            }
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = returnList
            };
            bllUser.ContextResponse(context, apiResp);
        }
Exemple #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            model = bllTask.GetLastTinmingTask(BLLJIMP.BLLTimingTask.TaskType.SynFans);

            IsShowSendTempMessage = bllMenupermission.CheckUserAndPmsKey(bllUser.GetCurrUserID(), BLLPermission.Enums.PermissionSysKey.SendTtemplatMessage);
        }