예제 #1
0
파일: List.ashx.cs 프로젝트: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex = !string.IsNullOrEmpty(context.Request["page"]) ? int.Parse(context.Request["page"]) : 1;
            int    pageSize  = !string.IsNullOrEmpty(context.Request["rows"]) ? int.Parse(context.Request["rows"]) : 10;
            string keyWord   = context.Request["keyWord"];

            StringBuilder sbWhere = new StringBuilder();

            sbWhere.AppendFormat(" WebsiteOwner='{0}' And DistributionOffLinePreUserId !=''", bllUser.WebsiteOwner);

            if (!string.IsNullOrEmpty(keyWord))
            {
                sbWhere.AppendFormat(" And (TrueName='{0}' Or convert(varchar,AutoId)='{0}')", keyWord);
            }
            int total = bllUser.GetCount <UserInfo>(sbWhere.ToString());
            var list  = bllUser.GetLit <UserInfo>(pageSize, pageIndex, sbWhere.ToString(), " AutoId Desc");

            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(
                                       new
            {
                total = total,
                rows  = list
            }
                                       ));
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            string trueName = context.Request["true_name"];
            string phone    = context.Request["phone"];

            UserInfo model = new UserInfo();

            model.UserID          = string.Format("PCUser{0}", Guid.NewGuid().ToString());//Guid
            model.Password        = ZentCloud.Common.Rand.Str_char(12);
            model.UserType        = 2;
            model.WebsiteOwner    = bllUser.WebsiteOwner;
            model.Regtime         = DateTime.Now;
            model.WXOpenId        = "";
            model.RegIP           = ZentCloud.Common.MySpider.GetClientIP();
            model.LastLoginIP     = ZentCloud.Common.MySpider.GetClientIP();
            model.LastLoginDate   = DateTime.Now;
            model.LoginTotalCount = 1;
            model.TrueName        = trueName;
            model.Phone           = phone;
            if (bllUser.GetCount <UserInfo>(string.Format("Websiteowner='{0}' And Phone='{1}'", bllUser.WebsiteOwner, phone)) > 0)
            {
                apiResp.msg = "手机号重复";
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (bllUser.Add(model))
            {
                apiResp.status = true;
                apiResp.msg    = "ok";
            }
            else
            {
            }
            bllUser.ContextResponse(context, apiResp);
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var currentUserInfo = bllUser.GetCurrentUserInfo();

            if (!bllUser.IsDistributionChannel(currentUserInfo))
            {
                var website = bllUser.GetWebsiteInfoModelFromDataBase();
                int count   = bllUser.GetCount <UserInfo>(string.Format("DistributionOwner='{0}'", bllUser.WebsiteOwner));
                RootNodes = "{ \"name\": \"" + website.WebsiteName + "\", \"id\": \"" + bllUser.WebsiteOwner + "\", \"count\": " + count + ", \"times\": " + count + ", \"isParent\": true,\"icon\":\"/Plugins/zTree/css/zTreeStyle/img/diy/user.png\", \"tip\":\"\"}";
            }
            else
            {
                //当前用户是渠道
                int count = bllUser.GetCount <UserInfo>(string.Format("DistributionOwner='{0}'", currentUserInfo.UserID));
                RootNodes = "{ \"name\": \"" + bllUser.GetUserDispalyName(currentUserInfo) + "\", \"id\": \"" + currentUserInfo.UserID + "\", \"count\": " + count + ", \"times\": " + count + ", \"isParent\": true,\"icon\":\"/Plugins/zTree/css/zTreeStyle/img/diy/user.png\", \"tip\":\"\"}";
            }
        }
예제 #4
0
        public string RootNodes = "";//根节点
        protected void Page_Load(object sender, EventArgs e)
        {
            var website = bllUser.GetWebsiteInfoModelFromDataBase();

            int count = bllUser.GetCount <UserInfo>(string.Format("DistributionOffLinePreUserId='{0}'", bllUser.WebsiteOwner));

            RootNodes = "{ name: \"" + website.WebsiteName + "\", id: \"" + bllUser.WebsiteOwner + "\", count: " + count + ", times: " + count + ", isParent: true,icon:\"/Plugins/zTree/css/zTreeStyle/img/diy/user.png\", tip:\"\"}";
        }
예제 #5
0
파일: Join.aspx.cs 프로젝트: uvbs/mmp
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request["lotteryId"]))
            {
                int lotteryId = Convert.ToInt32(Request["lotteryId"]);

                lottery = bllLotery.Get <WXLotteryV1>(string.Format(" WebsiteOwner='{0}' AND  LotteryID={1} ", bllLotery.WebsiteOwner, lotteryId));

                webSite = bllLotery.GetWebsiteInfoModel();

                var currentUserInfo = bllUser.GetCurrentUserInfo();


                if (string.IsNullOrEmpty(currentUserInfo.WXNickname))
                {
                    Session.Clear();
                    Response.Redirect(Request.Url.ToString());
                }


                lotteryUser = bllUser.Get <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryId={1} AND UserId='{2}' ", bllUser.WebsiteOwner, lotteryId, currentUserInfo.UserID));
                if (lotteryUser == null)
                {
                    lotteryUser = new BLLJIMP.Model.LotteryUserInfo();
                    lotteryUser.WebsiteOwner = bllUser.WebsiteOwner;
                    lotteryUser.CreateDate   = DateTime.Now;
                    lotteryUser.WinnerDate   = DateTime.Now;
                    lotteryUser.IsWinning    = 0;
                    lotteryUser.LotteryId    = Convert.ToInt32(lotteryId);
                    lotteryUser.UserId       = currentUserInfo.UserID;
                    lotteryUser.WXHeadimgurl = currentUserInfo.WXHeadimgurl;
                    lotteryUser.WXNickname   = bllUser.GetUserDispalyName(currentUserInfo);
                    if (bllUser.Add(lotteryUser))
                    {
                        msg       = "加入成功";
                        isSuccess = true;
                        int count = bllUser.GetCount <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryID={1}", bllUser.WebsiteOwner, lotteryId));
                        bllUser.UpdateByKey <WXLotteryV1>("LotteryID", Request["lotteryId"], "WinnerCount", count.ToString());
                    }
                    else
                    {
                        isSuccess = false;
                        msg       = "加入失败";
                    }
                }
                else
                {
                    msg       = "您已参加抽奖";
                    isSuccess = true;
                }
            }
        }
예제 #6
0
파일: QRCodeAdd.ashx.cs 프로젝트: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            string lotteryId = context.Request["lottery_id"];

            curUser = bllUser.GetCurrentUserInfo();

            if (string.IsNullOrEmpty(lotteryId))
            {
                apiResp.msg  = "抽奖活动id为空";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllUser.ContextResponse(context, apiResp);
                return;
            }

            BLLJIMP.Model.LotteryUserInfo model = bllUser.Get <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryId={1} AND UserId='{2}' ", bllUser.WebsiteOwner, lotteryId, curUser.UserID));
            if (model != null)
            {
                apiResp.msg  = "您已参加抽奖";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsRepeat;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            model = new BLLJIMP.Model.LotteryUserInfo();
            model.WebsiteOwner = bllUser.WebsiteOwner;
            model.CreateDate   = DateTime.Now;
            model.WinnerDate   = DateTime.Now;
            model.IsWinning    = 0;
            model.LotteryId    = Convert.ToInt32(lotteryId);
            model.UserId       = curUser.UserID;
            model.WXHeadimgurl = curUser.WXHeadimgurl;
            model.WXNickname   = bllUser.GetUserDispalyName(curUser);
            if (model.WXNickname.Trim() == string.Empty)
            {
                apiResp.msg  = "无昵称不能加入";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                bllUser.ContextResponse(context, apiResp);
                return;
            }
            if (bllUser.Add(model))
            {
                int count = bllUser.GetCount <BLLJIMP.Model.LotteryUserInfo>(string.Format(" WebsiteOwner='{0}' AND LotteryID={1}", bllUser.WebsiteOwner, lotteryId));
                bllUser.UpdateByKey <WXLotteryV1>("LotteryID", lotteryId, "WinnerCount", count.ToString());
                apiResp.msg    = "加入成功";
                apiResp.status = true;
            }
            else
            {
                apiResp.msg  = "加入失败";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            bllUser.ContextResponse(context, apiResp);
        }
예제 #7
0
파일: Index.aspx.cs 프로젝트: uvbs/mmp
        protected void Page_Load(object sender, EventArgs e)
        {
            bllPms = new BLLPermission.BLLMenuPermission(bllUser.WebsiteOwner);


            if (bllDis.WebsiteOwner == "songhe")
            {
                this.Title = "我要推广";
            }
            else
            {
                this.Title = "我是代言人";
            }

            if (!bllDis.IsLogin)
            {
                this.Response.Write("<span style=\"font-size:40px;\">您还没有登录!</span>");
                this.Response.End();
                return;
            }

            isDistributionMember = bllUser.IsDistributionMember(CurrentUserInfo)? 1:0;
            websiteOwner         = bllUser.WebsiteOwner;

            //if (isDistributionMember == 0 && websiteOwner == "songhe" && CurrentUserInfo.MemberLevel == 0)
            //{
            //    //如果是非月供宝会员,则直接跳到会员注册页面
            //    //http://www.songhebao.com/app/wap/ApplyMember.aspx

            //    this.Response.Redirect("/app/wap/ApplyMember.aspx");
            //    this.Response.End();
            //    return;
            //}

            DownUserCountHaveOrder   = bllUser.GetCount <UserInfo>(string.Format(" WebsiteOwner='{0}' And DistributionOwner='{1}' And DistributionSaleAmountLevel0>0", CurrentUserInfo.WebsiteOwner, CurrentUserInfo.UserID));
            DownUserCountUnHaveOrder = bllUser.GetCount <UserInfo>(string.Format(" WebsiteOwner='{0}' And DistributionOwner='{1}' And (DistributionSaleAmountLevel0=0 Or DistributionSaleAmountLevel0 Is NULL)", CurrentUserInfo.WebsiteOwner, CurrentUserInfo.UserID));

            //头部图标引用
            string iconfontPath = Common.ConfigHelper.GetConfigString("iconfont_comeoncloud");

            if (!string.IsNullOrWhiteSpace(iconfontPath))
            {
                string iconJson = File.ReadAllText(this.Server.MapPath(iconfontPath));
                JToken jToken   = JToken.Parse(iconJson);

                StringBuilder icoSbu = new StringBuilder();
                icoSbu.AppendLine("@charset \"utf-8\";");
                if (jToken["css_file"] != null)
                {
                    icoSbu.AppendLine(string.Format("@import url(\"{0}\");", jToken["css_file"].ToString()));
                }
                icoSbu.AppendLine(string.Format("@font-face {0}", "{"));
                icoSbu.AppendLine("font-family: \"iconfont\";");
                if (jToken["svg_file"] != null)
                {
                    icoSbu.AppendLine(string.Format("src:url(\"{0}#iconfont\") format('svg');", jToken["svg_file"].ToString()));
                }
                icoSbu.AppendLine(string.Format("{0}", "}"));
                icoimport = icoSbu.ToString();
            }
            websiteInfo = bllUser.GetWebsiteInfoModelFromDataBase();
        }
예제 #8
0
파일: Comment.ashx.cs 프로젝트: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            var articleId = context.Request["articleid"];
            var content   = context.Request["content"];
            var replyId   = Convert.ToInt32(context.Request["replyid"]);//评论了文章里的哪个评论

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

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

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

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

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

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

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

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

                    List <UserInfo> users = bllUser.GetRelationUserList(BLLJIMP.Enums.CommRelationType.JuActivityFollow, articleId);
                    bllSystemNotice.SendNotice(BLLJIMP.BLLSystemNotice.NoticeType.FollowQuestionIsAnswered, this.currentUserInfo, article, users, content);
                }
                apiResp.status = true;
                apiResp.msg    = "评论完成";
                apiResp.result = reviewId.ToString();
                apiResp.code   = (int)BLLJIMP.Enums.APIErrCode.IsSuccess;
            }
            else
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = "评论出错";
            }
            bllReview.ContextResponse(context, apiResp);
        }
예제 #9
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;
        }