Example #1
0
        public int BackgroundRefreshTime = int.Parse(LinkFun.ConfigString("BackgroundRefreshTime", "7200000")); //背景刷新时间


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ProductIndexRefreshTime = LinkFun.ConfigString("ProductIndexRefreshTime", "7200000"); //LinkFun.getProductIndexRefreshTime();
                ProductsBLL        adHelper            = new ProductsBLL();
                ProductCategoryBLL oProductCategoryBLL = new ProductCategoryBLL();
                oCategoryList = oProductCategoryBLL.GetCardTypeList();
                LoginUserCookie cookie = MerchantFrontCookieBLL.GetMerchantFrontUserCookie();
                magName = cookie.LoginName;
                CompanyBLL opCompanyBLL = new CompanyBLL();

                StringBuilder where = new StringBuilder();
                //where.AppendFormat("IsDeleted=0 and CompanyCategoryId=2 order by OrderId asc");
                //litCompanyNetLoan = opCompanyBLL.GetModelList(where.ToString());

                where = new StringBuilder();
                where.AppendFormat("IsDeleted=0 and CompanyCategoryId=4 order by OrderId asc");
                litCompanyBank = opCompanyBLL.GetModelList(where.ToString());

                where = new StringBuilder();
                where.AppendFormat("IsDeleted=0 and CompanyCategoryId=5 order by OrderId asc");
                litCompanyOther = opCompanyBLL.GetModelList(where.ToString());
            }
        }
Example #2
0
        /// <summary>
        /// 操作日志
        /// </summary>
        /// <param name="logContent">日志内容</param>
        /// <param name="companyId">渠道编号</param>
        /// <param name="businessType">业务类型1网贷2保险3信用卡</param>
        /// <param name="relationId">关联编号</param>
        /// <returns>操作日志添加结果</returns>
        static public int OperationLogAdd(int relationId, string logContent, int companyId = 1, int businessType = 1)
        {
            int result = -1;

            try
            {
                int    userId         = -1;
                string realName       = string.Empty;
                int    departmentId   = -1;
                string departmentName = string.Empty;

                LoginUserCookie currentUser = MerchantFrontCookieBLL.GetMerchantFrontUserCookie();
                if (currentUser != null)
                {
                    UsersBLL op    = new UsersBLL();
                    Users    model = new Users();
                    model        = op.GetModel(currentUser.LoginUserID);
                    userId       = currentUser.LoginUserID;
                    departmentId = model.DepartmentID;
                    if (model != null)
                    {
                        realName = model.UserName;

                        DepartmentInfoBLL opDepartment        = new DepartmentInfoBLL();
                        DepartmentInfo    modelDepartmentInfo = new DepartmentInfo();
                        modelDepartmentInfo = opDepartment.GetModel(departmentId);
                        if (modelDepartmentInfo != null)
                        {
                            departmentName = modelDepartmentInfo.DepartmentName;
                        }
                    }
                }

                StackTrace st        = new StackTrace(true);
                MethodBase mb        = st.GetFrame(1).GetMethod();
                string     clsString = mb.DeclaringType.FullName;
                string     mName     = mb.Name;

                OperationLogBLL opOperationLog    = new OperationLogBLL();
                OperationLog    modelOperationLog = new OperationLog();

                modelOperationLog.BusinessType   = businessType;
                modelOperationLog.RelationId     = relationId;
                modelOperationLog.LogContent     = logContent;
                modelOperationLog.Ip             = System.Web.HttpContext.Current.Request.UserHostAddress;
                modelOperationLog.UserId         = userId;
                modelOperationLog.RealName       = realName;
                modelOperationLog.CreateDate     = DateTime.Now;
                modelOperationLog.DepartmentId   = departmentId;
                modelOperationLog.DepartmentName = departmentName;
                modelOperationLog.CreateDate     = DateTime.Now;
                result = opOperationLog.Add(modelOperationLog);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
Example #3
0
        private void GetLoginOn(HttpContext context)
        {
            UsersBLL    bll         = new UsersBLL();
            ReturnModel ReturnModel = new ReturnModel();
            //int IsManager = 0;

            int result = 0;

            try
            {
                string LoginName = context.Request.Params["LoginName"];
                string Password  = context.Request.Params["Password"];
                string CardID    = context.Request.Params["CardID"];
                //string IsRemember = context.Request.Params["IsRemember"];

                if (!string.IsNullOrEmpty(LoginName) && !string.IsNullOrEmpty(Password) && !string.IsNullOrEmpty(CardID))
                {
                    Users  users  = new Users();
                    string PwdKey = LinkFun.getPwdKey();
                    Password    = DESEncrypt.Encrypt(PwdKey, Password);//旧密码加密
                    ReturnModel = bll.VerificationPassword(LoginName, Password, CardID);
                    if (ReturnModel.IsSuccess)
                    {
                        int UserID = (int)ReturnModel.Data;
                        result = UserID;

                        MerchantFrontCookieBLL.SetMerchantFrontCookie(UserID, LoginName);

                        #region 改造前端登录方法存储到缓存
                        UsersBLL bllUsers = new UsersBLL();
                        Users    model    = bllUsers.GetModel(UserID);
                        if (model != null)
                        {
                            string key = ComPage.memberModelCacheDependency + model.UserID;
                            ComPage.SetBWJSCache(key, Guid.NewGuid(), null, DateTime.Now.AddMinutes(ComPage.SafeToDouble(LinkFun.ConfigString("FrontEndCookieExpires", "120"))), TimeSpan.Zero);

                            HttpCookie cookie = new HttpCookie(LinkFun.ConfigString("FrontEndCookieName", "BWJSFrontEnd20180108"));
                            cookie.Expires = DateTime.Now.AddMinutes(ComPage.SafeToDouble(LinkFun.ConfigString("FrontEndCookieExpires", "120")));
                            cookie.Values.Add("Id", HttpContext.Current.Server.UrlEncode(model.UserID.ToString()));

                            System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
                            System.Web.HttpContext.Current.Response.AppendCookie(cookie);

                            model.LastAccessIP     = HttpContext.Current.Request.UserHostAddress;
                            model.LoginTimes       = ComPage.SafeToInt(model.LoginTimes) + 1;
                            model.RecordUpdateTime = DateTime.Now;
                            model.IsLogined        = 1;
                            bllUsers.Update(model);
                        }
                        #endregion
                    }
                }
                context.Response.Write(ObjectToJson(ReturnModel));
            }
            catch (Exception ex)
            {
                context.Response.Write(ex);
            }
        }
Example #4
0
        /// <summary>
        /// 更新设备信息
        /// </summary>
        static void UpdateMachineSettings()
        {
            try
            {
                string description = string.Empty;
                string ip          = string.Empty;
                string mac         = string.Empty;
                try
                {
                    ip  = HttpContext.Current.Request.UserHostAddress;//IpHelper.GetClientIP2();
                    mac = IpHelper.GetClientMacAddress();
                    if (mac == "00-00-00-00-00-00")
                    {
                        mac = IpHelper.GetLocalMacAddress();
                    }
                }
                catch { }

                int currentUserId = MerchantFrontCookieBLL.GetMerchantFrontUserId();

                MachineBLL opMachineBLL = new MachineBLL();
                Machine    modelMachine = new Machine();
                if (currentUserId != 0)
                {
                    modelMachine = opMachineBLL.GetModelByUserId(currentUserId);
                }

                int machineId = 0;
                if (modelMachine != null)
                {
                    machineId = modelMachine.MachineID;
                }

                #region 设置位置信息
                string longitude    = string.Empty;
                string latitude     = string.Empty;
                string locationData = string.Empty;

                #region 获取当前位置信息
                string jsonText = MachineLocationLogBLL.GetLocationInfo();
                if (!string.IsNullOrEmpty(jsonText))
                {
                    JObject o = JObject.Parse(jsonText);
                    longitude = o["content"]["point"]["x"].ToString();
                    latitude  = o["content"]["point"]["y"].ToString();
                }
                #endregion

                #region 逆地理位置解析
                string locationAddress = string.Empty;
                string locationXml     = string.Empty;
                if (!string.IsNullOrEmpty(longitude) && !string.IsNullOrEmpty(latitude))
                {
                    locationData = MachineLocationLogBLL.GetAddressByLocation(longitude, latitude, "xml", 0);
                    if (!string.IsNullOrEmpty(locationData))
                    {
                        XmlDocument doc = new XmlDocument();
                        doc.LoadXml(locationData);
                        //locationXml = doc.DocumentElement.InnerXml;
                        //settings.OmitXmlDeclaration = true;//这一句表示忽略xml声明
                        XmlNodeList locationNodeList = doc.SelectNodes("GeocoderSearchResponse/result");
                        if (locationNodeList != null)
                        {
                            foreach (XmlNode locationNode in locationNodeList)
                            {
                                XmlNode formatted_address = locationNode.SelectSingleNode("formatted_address");
                                if (formatted_address != null)
                                {
                                    locationAddress += formatted_address.InnerText;
                                }
                                XmlNode sematic_description = locationNode.SelectSingleNode("sematic_description");
                                if (sematic_description != null)
                                {
                                    locationAddress += sematic_description.InnerText;
                                }
                            }
                        }
                    }
                }
                #endregion

                #region 更新设备信息
                opMachineBLL = new MachineBLL();
                modelMachine = new Machine();
                modelMachine = opMachineBLL.GetModel(machineId);
                if (modelMachine != null)
                {
                    modelMachine.MAC             = mac;
                    modelMachine.Longitude       = longitude;
                    modelMachine.Latitude        = latitude;
                    modelMachine.LocationAddress = locationAddress;
                    opMachineBLL.Update(modelMachine);
                }
                #endregion

                #region 记录位置信息日志
                if (!string.IsNullOrEmpty(locationData))
                {
                    string xmlheader = "<xml version=\"1.0\" encoding=\"utf-8\">";
                    locationXml = locationData.Replace("?", "");
                    locationXml = locationXml.Replace(xmlheader, string.Empty);
                }

                MachineLocationLogBLL opMachineLocationLogBLL = new MachineLocationLogBLL();
                MachineLocationLog    modelMachineLocationLog = new MachineLocationLog();
                modelMachineLocationLog.UserId          = currentUserId;
                modelMachineLocationLog.MachineId       = machineId;
                modelMachineLocationLog.IP              = ip;
                modelMachineLocationLog.MAC             = mac;
                modelMachineLocationLog.Longitude       = longitude;
                modelMachineLocationLog.Latitude        = latitude;
                modelMachineLocationLog.LocationAddress = locationAddress;
                modelMachineLocationLog.LocationData    = locationXml;
                modelMachineLocationLog.CreateDate      = DateTime.Now;
                modelMachineLocationLog.IsDeleted       = 0;
                modelMachineLocationLog.Remark          = description;
                int res = opMachineLocationLogBLL.Add(modelMachineLocationLog);

                #endregion

                #endregion
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB("心跳检查异常," + ex.ToString());
            }
        }
Example #5
0
        public bool OrderApplyAdd(OrderApplyViewModel viewModel, out string msg)
        {
            msg = "ok";
            using (SqlConnection conn = new SqlConnection(DbHelperSQL.connectionString))
            {
                conn.Open();
                using (SqlTransaction trans = conn.BeginTransaction())
                {
                    try
                    {
                        int ApplyId = dalOrderApply.Add(viewModel.orderApply, trans, conn);//
                        if (ApplyId < 0)
                        {
                            return(false);
                        }
                        else
                        {
                            viewModel.insurantInfo.OrderApplyID    = ApplyId;
                            viewModel.applicantInfo.OrderApplyID   = ApplyId;
                            viewModel.applicationData.OrderApplyID = ApplyId;
                            viewModel.otherInfo.OrderApplyID       = ApplyId;
                            #region 创建人赋值

                            //LoginUserCookie cookie = MerchantFrontCookieBLL.GetMerchantFrontUserCookie();
                            int createUserId = MerchantFrontCookieBLL.GetMerchantFrontUserId();
                            //int createUserId= cookie.LoginUserID;
                            try
                            {
                                UsersBLL opUsersBLL = new UsersBLL();
                                Users    modelUsers = opUsersBLL.GetModel(createUserId);
                                if (modelUsers != null)
                                {
                                    departmentId = modelUsers.DepartmentID;
                                }
                            }
                            catch { }
                            viewModel.insurantInfo.CreatUserID    = createUserId;
                            viewModel.applicantInfo.CreatUserID   = createUserId;
                            viewModel.applicationData.CreatUserID = createUserId;
                            viewModel.otherInfo.CreatUserID       = createUserId;
                            viewModel.orderApply.CreatUserID      = createUserId;
                            viewModel.orderApply.DepartmentId     = departmentId;
                            #endregion
                        }
                        int retCatId      = dalApplicationData.Add(viewModel.applicationData, trans, conn); //
                        int retInfoId     = dalApplicantInfo.Add(viewModel.applicantInfo, trans, conn);     //
                        int retInsurantId = dalInsurantInfo.Add(viewModel.insurantInfo, trans, conn);       //
                        int retotherId    = otherInfoDAL.Add(viewModel.otherInfo, trans, conn);
                        //调用Mofang业务BaoxianDataBLL

                        BaoxianDataBLL       baoxianBLL = new BaoxianDataBLL();
                        OrderApplyInputModel orderModel = new OrderApplyInputModel();
                        orderModel.applicantinfo            = new ApplicantInfo();
                        orderModel.applicantinfo.cName      = viewModel.applicantInfo.CName;
                        orderModel.applicantinfo.eName      = viewModel.applicantInfo.EName;
                        orderModel.applicantinfo.cardType   = viewModel.applicantInfo.CardType;
                        orderModel.applicantinfo.cardCode   = viewModel.applicantInfo.CardCode;
                        orderModel.applicantinfo.sex        = viewModel.applicantInfo.Sex;
                        orderModel.applicantinfo.birthday   = viewModel.applicantInfo.BirthDay;
                        orderModel.applicantinfo.mobile     = viewModel.applicantInfo.Mobile;
                        orderModel.applicantinfo.email      = viewModel.applicantInfo.Email;
                        orderModel.applicantinfo.cardPeriod = viewModel.applicantInfo.CardPeriod;
                        orderModel.applicantinfo.job        = viewModel.applicantInfo.Job;

                        orderModel.applicationdata = new ApplicationData();
                        orderModel.applicationdata.applicationDate = viewModel.applicationData.ApplicationDate;
                        orderModel.applicationdata.startDate       = viewModel.applicationData.StartDate;
                        orderModel.applicationdata.endDate         = viewModel.applicationData.EndDate;

                        orderModel.insurantInfo             = new InsurantInfo();
                        orderModel.insurantInfo.birthday    = viewModel.insurantInfo.Birthday;
                        orderModel.insurantInfo.cardCode    = viewModel.insurantInfo.CardCode;
                        orderModel.insurantInfo.cardPeriod  = viewModel.insurantInfo.CardPeriod;
                        orderModel.insurantInfo.cardType    = viewModel.insurantInfo.CardType;
                        orderModel.insurantInfo.cName       = viewModel.insurantInfo.CName;
                        orderModel.insurantInfo.count       = viewModel.insurantInfo.Count;
                        orderModel.insurantInfo.eName       = viewModel.insurantInfo.EName;
                        orderModel.insurantInfo.mobile      = viewModel.insurantInfo.Mobile;
                        orderModel.insurantInfo.relationId  = viewModel.insurantInfo.RelationID;
                        orderModel.insurantInfo.sex         = viewModel.insurantInfo.Sex;
                        orderModel.insurantInfo.singlePrice = viewModel.insurantInfo.SinglePrice;
                        orderModel.insurantInfo.email       = viewModel.insurantInfo.Email;
                        orderModel.insurantInfo.job         = viewModel.insurantInfo.Job;
                        orderModel.caseCode = viewModel.caseCode;
                        orderModel.transNo  = viewModel.transNo;
                        int Days = 0;
                        try
                        {
                            TimeSpan ts = Convert.ToDateTime(viewModel.applicationData.EndDate) - Convert.ToDateTime(viewModel.applicationData.StartDate);
                            Days = ts.Days;
                            if (Days == 0)
                            {
                                msg = "投保时间差有误!";
                            }
                        }
                        catch (Exception ex)
                        {
                            ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
                        }
                        orderModel.insurantDateLimit = Days.ToString();

                        orderModel.otherInfo                = new OtherInfo();
                        orderModel.otherInfo.provCityId     = viewModel.otherInfo.ProvCityID;
                        orderModel.otherInfo.cardPeriod     = viewModel.otherInfo.CardPeriod.ToString("yyyy-MM-dd");
                        orderModel.otherInfo.notifyAnswerId = viewModel.otherInfo.NotifyAnswerID.ToString();
                        orderModel.otherInfo.priceArgsId    = viewModel.otherInfo.PriceArgsID;

                        orderModel.otherInfo.visaCity           = viewModel.otherInfo.VisaCity;
                        orderModel.otherInfo.destination        = viewModel.otherInfo.Destination;
                        orderModel.otherInfo.tripPurposeId      = viewModel.otherInfo.TripPurposeId;
                        orderModel.otherInfo.propertyAddress    = viewModel.otherInfo.PropertyAddress;
                        orderModel.otherInfo.relatedPersonHouse = viewModel.otherInfo.RelatedPersonHouse;

                        OrderApplyOutputModel outPutModel       = baoxianBLL.OrderApply(orderModel);
                        OrderPayViewModel     orderPayViewModel = new OrderPayViewModel();
                        orderPayViewModel.transNo   = outPutModel.transNo;
                        orderPayViewModel.insureNum = outPutModel.insureNum;
                        orderPayViewModel.price     = outPutModel.price;
                        orderPayViewModel.caseCode  = orderModel.insurantInfo.cardCode;
                        orderPayViewModel.customkey = orderModel.customkey;
                        msg = SerializerHelper.SerializeObject(outPutModel);
                        if (outPutModel.respstat == "0000")
                        {
                            trans.Commit();//提交事务
                            Model.OrderApply oOrderApply = new Model.OrderApply();
                            OrderApplyBLL    orderbll    = new OrderApplyBLL();
                            oOrderApply              = orderbll.GetModel(ApplyId);
                            oOrderApply.InsureNum    = orderPayViewModel.insureNum;
                            oOrderApply.Price        = orderPayViewModel.price;
                            oOrderApply.Respmsg      = outPutModel.respmsg;
                            oOrderApply.Respstat     = outPutModel.respstat;
                            oOrderApply.DepartmentId = departmentId;
                            bool flag = dalOrderApply.Update(oOrderApply);
                            if (!flag)
                            {
                                ExceptionLogBLL.WriteExceptionLogToDB("更新OrderApply表失败");
                            }
                            else //没问题后提交返利设置
                            {
                                #region 获取渠道返利设置
                                if (ApplyId > 0)
                                {
                                    CompanyRebate    modelSys_CompanyRebate = new CompanyRebate();
                                    CompanyRebateBLL opSys_CompanyRebateBLL = new CompanyRebateBLL();
                                    StringBuilder where = new StringBuilder();
                                    where.AppendFormat("IsDeleted=0 and casecode='{0}'", viewModel.caseCode);
                                    DataSet   ds = opSys_CompanyRebateBLL.GetList(where.ToString());
                                    DataTable dt = null;
                                    if (ds != null && ds.Tables.Count > 0)
                                    {
                                        dt = ds.Tables[0];
                                    }
                                    if (dt != null && dt.Rows.Count > 0)
                                    {
                                        DataRow dr = dt.Rows[0];
                                        modelSys_CompanyRebate = opSys_CompanyRebateBLL.DataRowToModel(dr);
                                        if (modelSys_CompanyRebate != null)
                                        {
                                            /*
                                             * 总价=订单金额
                                             * 总部毛利=总价*产品分成百分比(魔方提供 我方后台管理设置渠道各产品返回分成百分比)
                                             * 商家利润=总部毛利*商家返利百分比(我方后台管理设置渠各产品商家分成百分比)
                                             * 代理商利润=总部毛利*代理商返利百分比(我方后台管理设置渠各产品商家分成百分比)
                                             * 总部净利润=总部毛利-商家利润-代理商利润
                                             */
                                            decimal orderMoney     = viewModel.TotalPrice;
                                            decimal hqRebate       = modelSys_CompanyRebate.CompanyRebatePer;
                                            decimal hqMoney        = orderMoney * (hqRebate / 100);
                                            decimal agentRebate    = modelSys_CompanyRebate.AgentRebate;
                                            decimal agentMoney     = hqMoney * (agentRebate / 100);
                                            decimal merchantRebate = modelSys_CompanyRebate.MerchantRebate;
                                            decimal merchantMoney  = hqMoney * (merchantRebate / 100);
                                            decimal netProfit      = hqMoney - agentMoney - merchantMoney;

                                            #region 订单返利信息入库
                                            OrderRebateBLL opSys_OrderRebate    = new OrderRebateBLL();
                                            OrderRebate    modelSys_OrderRebate = new OrderRebate();
                                            modelSys_OrderRebate.TransNo         = viewModel.transNo;
                                            modelSys_OrderRebate.CompanyId       = 1;
                                            modelSys_OrderRebate.UserId          = viewModel.orderApply.UserID;
                                            modelSys_OrderRebate.OrderApplyId    = ApplyId;
                                            modelSys_OrderRebate.CompanyRebateId = modelSys_CompanyRebate.CompanyRebateId;
                                            modelSys_OrderRebate.OrderMoney      = orderMoney;
                                            modelSys_OrderRebate.HQRebate        = hqRebate;
                                            modelSys_OrderRebate.HQMoney         = hqMoney;
                                            modelSys_OrderRebate.MerchantRebate  = merchantRebate;
                                            modelSys_OrderRebate.MerchantMoney   = merchantMoney;
                                            modelSys_OrderRebate.AgentRebate     = agentRebate;
                                            modelSys_OrderRebate.AgentMoney      = agentMoney;
                                            modelSys_OrderRebate.NetProfit       = netProfit;
                                            modelSys_OrderRebate.PayStatus       = 0;
                                            modelSys_OrderRebate.IsSettled       = 0;
                                            modelSys_OrderRebate.IsCancel        = 0;
                                            modelSys_OrderRebate.SettlementDate  = null;
                                            modelSys_OrderRebate.CreateDate      = DateTime.Now;
                                            modelSys_OrderRebate.Remark          = modelSys_CompanyRebate.RebateName;
                                            modelSys_OrderRebate.IsDeleted       = 0;
                                            int orderRebateId = opSys_OrderRebate.Add(modelSys_OrderRebate);
                                            if (orderRebateId < 0)
                                            {
                                                ExceptionLogBLL.WriteExceptionLogToDB("订单返利信息添加失败");
                                            }

                                            #endregion

                                            #region 订单支付申请预先入库
                                            OrderPayApplyBLL opSys_OrderPayApplyBLL = new OrderPayApplyBLL();
                                            OrderPayApply    modelSys_OrderPayApply = new OrderPayApply();
                                            modelSys_OrderPayApply.OrderRebateId  = orderRebateId;
                                            modelSys_OrderPayApply.OrderMoney     = orderMoney;
                                            modelSys_OrderPayApply.PayOrderNumber = string.Empty;
                                            modelSys_OrderPayApply.PayStatus      = 0;
                                            modelSys_OrderPayApply.PayPlatform    = 1;
                                            modelSys_OrderPayApply.PayMethod      = 1;
                                            modelSys_OrderPayApply.PayCode        = string.Empty;
                                            modelSys_OrderPayApply.PayText        = string.Empty;
                                            modelSys_OrderPayApply.PayJson        = string.Empty;
                                            modelSys_OrderPayApply.CreateDate     = DateTime.Now;
                                            modelSys_OrderPayApply.Remark         = modelSys_CompanyRebate.RebateName;
                                            modelSys_OrderPayApply.IsDeleted      = 0;
                                            int res1 = opSys_OrderPayApplyBLL.Add(modelSys_OrderPayApply);
                                            if (res1 < 0)
                                            {
                                                ExceptionLogBLL.WriteExceptionLogToDB("订单支付申请预先入库失败");
                                            }
                                            #endregion
                                        }
                                    }
                                    else
                                    {
                                        ExceptionLogBLL.WriteExceptionLogToDB("获取渠道返利设置信息获取失败");
                                    }
                                }
                                #endregion
                            }
                        }
                        else
                        {
                            trans.Rollback();
                        }
                        return(true);
                    }
                    catch (Exception ex)
                    {
                        ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
                        return(false);
                    }
                }
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                UsersBLL   oUsersBLL   = new UsersBLL();
                MachineBLL oMachineBLL = new MachineBLL();
                userId = MerchantFrontCookieBLL.GetMerchantFrontUserId();
                if (userId > 0)
                {
                    Machine oMachine = new Machine();
                    oMachine = oMachineBLL.GetModelByUserId(userId);
                    if (oMachine != null)
                    {
                        MachineID = oMachine.MachineID;
                    }
                }
                TransNo               = BWJSCommonHelper.SafeString(Request["transNo"], "");
                TransNo               = string.IsNullOrEmpty(TransNo) ? "" : TransNo.Trim();
                CaseCode              = BWJSCommonHelper.SafeString(Request["CaseCode"], "");
                CaseCode              = string.IsNullOrEmpty(CaseCode) ? "" : CaseCode.Trim();
                protectitemid         = BWJSCommonHelper.SafeString(Request["protectitemid"], "");
                protectitemid         = string.IsNullOrEmpty(protectitemid) ? "" : protectitemid.Trim();
                priceArgsId           = BWJSCommonHelper.SafeString(Request["priceArgsId"], "");
                priceArgsId           = string.IsNullOrEmpty(priceArgsId) ? "" : priceArgsId.Trim();
                price                 = BWJSCommonHelper.SafeString(Request["price"], "");
                price                 = string.IsNullOrEmpty(price) ? "" : price.Trim();
                SinglePrice           = BWJSCommonHelper.SafeString(Request["SinglePrice"], "");
                SinglePrice           = string.IsNullOrEmpty(SinglePrice) ? "" : SinglePrice.Trim();
                buyCount              = BWJSCommonHelper.SafeString(Request["buyCount"], "");
                buyCount              = string.IsNullOrEmpty(buyCount) ? "" : buyCount.Trim();
                healthId              = BWJSCommonHelper.SafeString(Request["healthId"], "");
                healthId              = string.IsNullOrEmpty(healthId) ? "" : healthId.Trim();
                productId             = DNTRequest.GetInt("productId", 0);
                insurantDateLimitVal  = BWJSCommonHelper.SafeString(Request["hdinsurantDateLimitVal"], "");  //承保值
                insurantDateLimitUnit = BWJSCommonHelper.SafeString(Request["hdinsurantDateLimitUnit"], ""); //承保单位
                CardTypeBLL oCardTypeBLL = new CardTypeBLL();
                oCardTypeList = oCardTypeBLL.GetCardTypeList(CaseCode);
                RelationBLL oRelationBLL = new RelationBLL();
                listRelationViewMode = oRelationBLL.GetRelationViewModelList(CaseCode);
                switch (CaseCode)
                {
                case "0000052178002133":
                    isShowProvince = true;
                    isoneSelf      = true;//被保人必须是投保人本人
                    break;

                case "0001075211202628":
                    isShowcaichansuozaidi    = true;
                    isShowrelatedPersonHouse = true;
                    isoneSelf = true;
                    break;

                case "0000076164701939":
                    isluyouxianCXMDD       = true;
                    oTravelDestinationList = oTravelDestinationBLL.GetTravelDestinationList(CaseCode);
                    ProductDestinationReq oProductDestinationReqModel = new ProductDestinationReq();
                    oProductDestinationReqModel.caseCode = CaseCode;
                    oProductDestinationReqModel.transNo  = TransNo;
                    ProductCXDestinationResp oProductCXDestinationResp = oBaoxianDataBLL.ProductDestinations(oProductDestinationReqModel);
                    CXMDDStr = GetCXMDDStr(oProductCXDestinationResp);
                    //     isShowrelatedPersonHouse = true;
                    break;

                case "0000052067400588":
                    isShowcaichansuozaidi = true;
                    isoneSelf             = true;
                    break;

                case "0001077178502139":
                    typeMen = true;
                    break;

                case "0001077178602140":
                    typeWomen = true;
                    break;

                case "0001076209802609":    //一起慧99-百万医疗保险 无门诊计划
                    isHaveJob = true;
                    break;

                case "0001076211102627":    //一起慧99-百万医疗保险 有门诊计划
                    isHaveJob = true;
                    break;

                case "0001075190802342":    //少儿住院宝
                    isOnlyOthers    = true;
                    StartDateParame = 3;    // 这个产品要求(起保日期只能为投保日起第三天)
                    break;
                }
                List <Products> oProductsList = bll.ProductsByCaseCode(CaseCode);
                if (oProductsList != null)
                {
                    ProModel = oProductsList.FirstOrDefault();
                }
            }
        }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CompanyId      = DNTRequest.GetInt("CompanyId", 0);
     openTypeQR     = DNTRequest.GetInt("openTypeQR", 0);
     NetLoanApplyId = DNTRequest.GetInt("NetLoanApplyId", 0);
     if (CompanyId <= 0)
     {
         Response.Redirect("/Product/Index?wd=0");
     }
     try
     {
         int             UserId        = MerchantFrontCookieBLL.GetMerchantFrontUserId();
         CompanyRelation relationModel = oCompanyRelationBLL.GetModel(CompanyId, UserId);//获取商家(只能给多个二维码的)二维码
         if (relationModel != null)
         {
             QRImg = relationModel.QRCode;
             if (string.IsNullOrEmpty(QRImg))
             {
                 if (!string.IsNullOrEmpty(relationModel.API))
                 {
                     string imgName = relationModel.CompanyRelationId + "_" + relationModel.CompanyId.ToString() + "_" + UserId.ToString();//组合文件名格式:渠道扩展编号加横杆加渠道编号
                     QRImg = GetQRImg(relationModel.API, imgName, "", "");
                 }
             }
         }
         else
         {
             model = opCompanyBLL.GetModel(CompanyId);
             if (model != null)
             {
                 if (!string.IsNullOrEmpty(model.QRCode))
                 {
                     QRImg = model.QRCode;
                 }
                 else
                 {
                     string url          = string.Empty;
                     string referralCode = string.Empty;
                     string imgName      = string.Empty;
                     if (!model.IsAPK)
                     {
                         QRType = 0;
                         url    = model.API;
                         if (model.IsRelyOnPrimaryKey == 1)
                         {
                             string prefix    = model.RecommendationPrefix;
                             int    maxlength = model.RecommendationLength;
                             referralCode = prefix + "-" + UserId.ToString() + "-" + NetLoanApplyId.ToString().PadLeft(maxlength, '0');
                         }
                         else
                         {
                             referralCode = model.RecommendationCode;
                         }
                         if (url.IndexOf("{0}") > 0)
                         {
                             url = string.Format(url, referralCode);
                         }
                         //if (!string.IsNullOrEmpty(model.ReplaceUrlParam))
                         //{
                         //    url = WebUtils.ReplaceUrlParamValue(model.API, model.ReplaceUrlParam, referralCode);
                         //}
                     }
                     else
                     {
                         QRType = 1;
                         string domain = LinkFun.getBWJSDomain();
                         url = domain + "/Product/NetLoanMiddlePage.aspx?openTypeQR=" + QRType + "&CompanyId=" + CompanyId;
                     }
                     imgName = model.CompanyId.ToString() + "_" + UserId;//渠道编号加下划线加经销商编号
                     QRImg   = GetQRImg(url, imgName, model.Logo, "");
                 }
             }
         }
         if (!string.IsNullOrEmpty(QRImg))//追加时间戳
         {
             if (QRImg.IndexOf("?") == -1)
             {
                 QRImg += string.Format("?{0}={1}", "times", DateTime.Now.ToFileTime());
             }
             else
             {
                 QRImg += string.Format("&{0}={1}", "times", DateTime.Now.ToFileTime());
             }
         }
     }
     catch (Exception ex) { ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); }
 }