Beispiel #1
0
        /// <summary>
        /// 修改律师信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string UpdateLawyer(HttpContext context)
        {
            string   userId = context.Request["UserID"];
            UserInfo user   = bllUser.GetUserInfo(userId);

            user = bllUser.ConvertRequestToModel <UserInfo>(user);

            string companyAddress     = context.Request["CompanyAddress"];
            string lawyerLicenseNo    = context.Request["LawyerLicenseNo"];
            string lawyerLicensePhoto = context.Request["LawyerLicensePhoto"];

            if (bllUser.Update(user,
                               string.Format("TrueName='{0}',Postion='{1}',Company='{2}'", user.TrueName, user.Postion, user.Company),
                               string.Format("UserID='{0}'", user.UserID)) > 0)
            {
                bllUserExpand.UpdateUserExpand(BLLJIMP.Enums.UserExpandType.UserCompanyAddress, user.UserID, companyAddress);
                bllUserExpand.UpdateUserExpand(BLLJIMP.Enums.UserExpandType.LawyerLicensePhoto, user.UserID, lawyerLicensePhoto);
                bllUserExpand.UpdateUserExpand(BLLJIMP.Enums.UserExpandType.LawyerLicenseNo, user.UserID, lawyerLicenseNo);

                resp.Status = 1;
                resp.Msg    = "修改完成";
            }
            else
            {
                resp.Status = -1;
                resp.Msg    = "修改失败";
            }

            return(Common.JSONHelper.ObjectToJson(resp));
        }
Beispiel #2
0
        /// <summary>
        /// 课程基本设置
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string EditOpenConfig(HttpContext context)
        {
            string Creater = context.Request["Creater"];

            if (string.IsNullOrWhiteSpace(Creater))
            {
                resp.Status = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.Msg    = "创建人不能为空";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            if (bllUserExpand.ExistUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID))
            {
                bllUserExpand.UpdateUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID, Creater);
            }
            else
            {
                bllUserExpand.AddUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID, Creater);
            }
            resp.Status = 1;
            resp.Msg    = "修改完成";
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Beispiel #3
0
        /// <summary>
        /// 课程基本设置
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string EditOpenConfig(HttpContext context)
        {
            string Creater = context.Request["Creater"];

            if (string.IsNullOrWhiteSpace(Creater))
            {
                resp.Status = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.Msg    = "创建人不能为空";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            if (bllUserExpand.ExistUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID))
            {
                bllUserExpand.UpdateUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID, Creater);
            }
            else
            {
                bllUserExpand.AddUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID, Creater);
            }

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

            if (!string.IsNullOrWhiteSpace(OpenClassNotice))
            {
                BLLKeyValueData bllKeyValueData = new BLLKeyValueData();

                KeyVauleDataInfo value = new KeyVauleDataInfo();
                value.DataType     = "OpenClassNotice";
                value.DataKey      = "0";
                value.DataValue    = OpenClassNotice;
                value.Creater      = this.currentUserInfo.UserID;
                value.WebsiteOwner = bll.WebsiteOwner;
                value.CreateTime   = DateTime.Now;
                bllKeyValueData.PutDataValue(value);
            }

            resp.Status = 1;
            resp.Msg    = "修改完成";
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            string         type  = context.Request["type"];
            string         value = context.Request["value"];
            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"];
            UserExpandType nType = new UserExpandType();

            if (!Enum.TryParse(type, out nType))
            {
                apiResp.code = (int)APIErrCode.IsNotFound;
                apiResp.msg  = "类型格式不能识别";
                bllUserEx.ContextResponse(context, apiResp);
                return;
            }
            if (bllUserEx.UpdateUserExpand(nType, CurrentUserInfo.UserID, value, ex1, ex2, ex3, ex4, ex5, ex6, ex7, ex8, ex9, ex10))
            {
                apiResp.msg    = "修改完成";
                apiResp.status = true;
                apiResp.code   = (int)APIErrCode.IsSuccess;
            }
            else
            {
                apiResp.msg  = "修改失败";
                apiResp.code = (int)APIErrCode.OperateFail;
            }
            bllUserEx.ContextResponse(context, apiResp);
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(Request.InputStream);
                try
                {
                    xmlDoc.Save(string.Format("C:\\WXPay\\Notify{0}.xml", DateTime.Now.ToString("yyyyMMddHHmmssfff")));
                }
                catch (Exception)
                {
                }
                //全部参数
                Dictionary <string, string> parametersAll = new Dictionary <string, string>();
                foreach (XmlElement item in xmlDoc.DocumentElement.ChildNodes)
                {
                    string key   = item.Name;
                    string value = item.InnerText;
                    if ((!string.IsNullOrEmpty(key)) && (!string.IsNullOrEmpty(value)))
                    {
                        parametersAll.Add(key, value);
                    }
                }

                parametersAll = (from entry in parametersAll
                                 orderby entry.Key ascending
                                 select entry).ToDictionary(pair => pair.Key, pair => pair.Value);//全部参数排序

                BllOrder bllOrder = new BllOrder();
                BLLJIMP.Model.OrderPay orderPay = bllOrder.GetOrderPay(parametersAll["out_trade_no"], "", bllOrder.WebsiteOwner);

                BllPay    bllPay    = new BllPay();
                PayConfig payConfig = bllPay.GetPayConfig();
                if (bllPay.VerifySignatureWx(parametersAll, payConfig.WXPartnerKey))//验证签名
                {
                    if (orderPay == null)
                    {
                        Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
                        return;
                    }

                    if (orderPay.Status == 1)
                    {
                        Response.Write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
                        return;
                    }
                    orderPay.Status = 1;
                    if (bllOrder.Update(orderPay))
                    {
                        BLLUser bllUser = new BLLUser();
                        if (orderPay.Type == "1")
                        {
                            int score = 0;
                            int.TryParse(orderPay.Ex1, out score);
                            BLLKeyValueData bllKeyValueData  = new BLLKeyValueData();
                            string          ScoreDispalyName = bllKeyValueData.GetDataVaule("ScoreDispalyName", "1", bllKeyValueData.WebsiteOwner);

                            string msg = "消费" + orderPay.Total_Fee + "元,充值" + score + ScoreDispalyName;
                            if (bllUser.AddUserScoreDetail(orderPay.UserId, EnumStringHelper.ToString(ScoreDefineType.Recharge), bllUser.WebsiteOwner, score, msg))
                            {
                                Response.Write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
                            }
                            else
                            {
                                Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
                            }
                            //BLLSystemNotice bllSystemNotice = new BLLSystemNotice();
                            //bllSystemNotice.SendNotice(BLLSystemNotice.NoticeType.SystemMessage, null, null, orderPay.UserId, msg);
                        }
                        else if (orderPay.Type == "2")
                        {
                            string invoiceMsg;
                            if (orderPay.Ex1 == "1")
                            {
                                invoiceMsg = "带发票,";
                            }
                            else
                            {
                                invoiceMsg = "无发票,";
                            }

                            string msg = "充值VIP," + invoiceMsg + "消费" + orderPay.Total_Fee.ToString() + "元";


                            BLLKeyValueData bllKeyValueData = new BLLKeyValueData();
                            string          VIPDatelong     = bllKeyValueData.GetDataVaule("VIPDatelong", "1", bllKeyValueData.WebsiteOwner);
                            if (string.IsNullOrWhiteSpace(VIPDatelong))
                            {
                                VIPDatelong = "12";
                            }
                            int datelong = Convert.ToInt32(VIPDatelong);

                            BLLUserExpand bllUserExpand = new BLLUserExpand();
                            UserExpand    userVip       = bllUserExpand.GetUserExpand(BLLJIMP.Enums.UserExpandType.UserIsVip, orderPay.UserId);
                            string        userVipEndDate;
                            if (userVip == null || DateTime.Parse(userVip.DataValue) < DateTime.Now)
                            {
                                userVipEndDate = DateTime.Now.AddMonths(datelong).ToString("yyyy-MM-dd");
                            }
                            else
                            {
                                userVipEndDate = DateTime.Parse(userVip.DataValue).AddMonths(datelong).ToString("yyyy-MM-dd");
                            }
                            bllUserExpand.UpdateUserExpand(BLLJIMP.Enums.UserExpandType.UserIsVip, orderPay.UserId, userVipEndDate);

                            //更新用户字段
                            UserScoreDetailsInfo scoreModel = new UserScoreDetailsInfo();
                            scoreModel.AddNote   = msg;
                            scoreModel.AddTime   = DateTime.Now;
                            scoreModel.Score     = 0;
                            scoreModel.UserID    = orderPay.UserId;
                            scoreModel.ScoreType = "RechargeVIP";
                            UserInfo currUser = bllUser.GetUserInfo(orderPay.UserId);
                            scoreModel.TotalScore   = currUser.TotalScore;
                            scoreModel.WebSiteOwner = currUser.WebsiteOwner;
                            if (bllUser.Add(scoreModel))
                            {
                                BLLSystemNotice bllSystemNotice = new BLLSystemNotice();
                                bllSystemNotice.SendNotice(BLLSystemNotice.NoticeType.SystemMessage, null, null, orderPay.UserId, msg);

                                Response.Write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
                            }
                            else
                            {
                                Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
                            }
                        }

                        return;
                    }
                    else
                    {
                        Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
                        return;
                    }
                }
                Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
            }
            catch (Exception)
            {
                Response.Write("<xml><return_code><![CDATA[FAIL]]></return_code></xml>");
            }
        }