Ejemplo n.º 1
0
        public JsonResult UpdateBankCardInfo(int id, string cardholder, string cardno, string branch_bank, string branch_no, int?cityId, int?bank_id)
        {
            Tnet_Bank_Account daAcct = new Tnet_Bank_Account();

            if (!daAcct.SelectByPk(id))
            {
                return(FailResult("更新失败,找不到银行卡信息"));
            }
            if (!string.IsNullOrEmpty(cardholder))
            {
                daAcct.Account_Name = cardholder;
            }
            if (!string.IsNullOrEmpty(cardno))
            {
                daAcct.Card_No = cardno;
            }
            if (!string.IsNullOrEmpty(branch_bank))
            {
                daAcct.Branch_Bank = branch_bank;
            }
            if (!string.IsNullOrEmpty(branch_no))
            {
                daAcct.Branch_No = branch_no;
            }
            if (cityId.HasValue)
            {
                City     city     = ChinaArea.GetCity(cityId.Value);
                Province province = ChinaArea.GetProvince(city.Province_ID);
                daAcct.City_Id       = cityId.Value;
                daAcct.Province_Id   = city.Province_ID;
                daAcct.City_Name     = city.City_Name;
                daAcct.Province_Name = province.Province_Name;
            }
            if (bank_id.HasValue)
            {
                daAcct.Bank_Id = bank_id.Value;
            }
            if (!daAcct.Update())
            {
                return(FailResult("更新银行卡信息失败"));
            }
            return(SuccessResult());
        }
Ejemplo n.º 2
0
        public bool Bind(BankCardInfo card)
        {
            card.CardNo = card.CardNo.Replace(" ", "");//删除空格
            City city = ChinaArea.GetCity(card.City_Id);

            if (city == null)
            {
                Alert((ResultType)409, "选择的城市有误");
                return(false);
            }
            Province province = ChinaArea.GetProvince(city.Province_ID);

            if (province == null)
            {
                Alert((ResultType)409, "选择的城市有误");
                return(false);
            }
            var fac = UserModuleFactory.GetUserModuleInstance();

            if (fac == null)
            {
                Alert((ResultType)500, "系统错误");
                return(false);
            }
            IUser user = fac.GetUserByCode(card.UserCode);

            if (user == null)
            {
                Alert((ResultType)404, "找不到用户信息");
                return(false);
            }
            if (user.Auth_Status != Interface.Enums.Auth_Status.已认证)
            {
                Alert((ResultType)403, "绑定银行卡必须先认证");
                return(false);
            }
            if (!string.Equals(user.UserName, card.CardHolder))
            {
                Alert((ResultType)403, "持卡人户名与认证姓名不符");
                return(false);
            }
            BankInfo bank = xUtils.GetBankInfoById(card.BankId);

            if (bank == null)
            {
                Alert((ResultType)409, "银行类型有误");
                return(false);
            }
            Tnet_Bank_Account daAcct = new Tnet_Bank_Account();

            daAcct.Account_Name   = card.CardHolder;
            daAcct.Account_Type   = 1;
            daAcct.Bank_Id        = card.BankId;
            daAcct.Bank_Name      = bank.BankName;
            daAcct.Branch_No      = card.BranchNo;
            daAcct.Branch_Bank    = card.BranchName;
            daAcct.Card_No        = card.CardNo;
            daAcct.City_Name      = city.City_Name;
            daAcct.Image_Fullpath = card.CardImage;
            daAcct.Province_Name  = province.Province_Name;
            daAcct.Remarks        = null;
            daAcct.Status         = (int)ValidateStatus.审核中;
            daAcct.User_Id        = user.UserId;
            daAcct.Province_Id    = province.Province_Id;
            daAcct.City_Id        = city.City_ID;
            if (!daAcct.Insert())
            {
                Alert((ResultType)501, "系统错误");
                return(false);
            }
            if (string.Equals(user.UserName, card.CardHolder))//认证名称与绑卡名称一致,自动审核通过
            {
                BankCardProvider bcp = new BankCardProvider();
                bool             res = bcp.Validate(daAcct.Id, true, "系统自动审核", 0);
                Log.Info($"户名验证通过,自动审核!审核结果:{res},错误信息:{bcp.PromptInfo.CustomMessage}");
            }
            return(true);
        }