Example #1
0
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <CustomerCreditcardInfoModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <CustomerCreditcardInfoModel> customercreditcardinfos = new List <CustomerCreditcardInfoModel>();

            CustomerCreditcardInfoModel customercreditcardinfo = new CustomerCreditcardInfoModel();
            DataTable dt = DbUtil.Current.RetrieveMultiple(customercreditcardinfo, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                customercreditcardinfo = new CustomerCreditcardInfoModel();
                customercreditcardinfo.ConvertFrom(dt, i);
                customercreditcardinfos.Add(customercreditcardinfo);
            }

            return(customercreditcardinfos);
        }
Example #2
0
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="creditcardid"></param>
        /// <returns>实体</returns>
        public CustomerCreditcardInfoModel Retrieve(string creditcardid)
        {
            CustomerCreditcardInfoModel customercreditcardinfo = new CustomerCreditcardInfoModel();

            customercreditcardinfo.CreditcardId = creditcardid;

            DataTable dt = DbUtil.Current.Retrieve(customercreditcardinfo);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            customercreditcardinfo.ConvertFrom(dt);

            return(customercreditcardinfo);
        }
Example #3
0
        // 在此添加你的代码...

        public bool UpdateCreditcardInfo(CustomerCreditcardInfoModel creditInfo, out string message)
        {
            bool result = false;

            message = "操作失败,请与管理员联系";

            if (creditInfo == null)
            {
                message = "参数错误,请与管理员联系";
                return(false);
            }

            CustomerDomainModel customer = CustomerInfoService.Instance.GetCustomerDomainModelById(creditInfo.CustomerId, false);

            if (customer == null)
            {
                message = "参数错误,不存在的客户ID,请与管理员联系";
                return(false);
            }

            CustomerSecurityInfoDomainModel securityInfo = CustomerInfoService.Instance.GetCustomerSecurityInfo(creditInfo.IvrDataId, false);

            if (securityInfo == null)
            {
                message = "未能从IVR系统获取客户输入的敏感信息,请与管理员联系";
                return(false);
            }

            creditInfo.CreditcardNumber = securityInfo.CreditCardNumber;
            creditInfo.IdcardNumber     = securityInfo.IdCardNumber;
            creditInfo.Period           = securityInfo.PeriodCode;
            creditInfo.SecurityCode     = securityInfo.SecurityCode;

            if (creditInfo.CreditcardNumber.Length > 6)
            {
                BankcardTypeInfoModel bankCardTypeModel = BankcardTypeInfoService.Instance.GetBankCardInfoByBinCode(creditInfo.CreditcardNumber.Substring(0, 6));
                if (bankCardTypeModel != null)
                {
                    creditInfo.CardType   = bankCardTypeModel.CardType;
                    creditInfo.CardLevel  = bankCardTypeModel.CardLevel;
                    creditInfo.CardBrand  = bankCardTypeModel.CardBrand;
                    creditInfo.CanbeStage = (bankCardTypeModel.BankcardEnumValue == "FEB39D81-26EC-4A20-97F2-F148FDC87AFD") ? 0 : 1;
                }
            }

            if (string.IsNullOrEmpty(creditInfo.CreditcardNumber))
            {
                message = "未能从IVR系统获取客户输入的敏感信息,请检查输入";
                return(false);
            }

            try
            {
                BeginTransaction();

                if (Update(creditInfo) == 1)
                {
                    CommitTransaction();
                    message = "成功更新客户持卡信息";
                    result  = true;
                    CustomerInfoService.Instance.GetCustomerDomainModelById(creditInfo.CustomerId, true);
                }
                else
                {
                    RollbackTransaction();
                    message = "更新客户持卡信息失败,请与管理员联系";
                    result  = false;
                }
            }
            catch (Exception ex)
            {
                RollbackTransaction();
                LogUtil.Error("更新客户持卡信息异常", ex);
                throw ex;
            }

            return(result);
        }