Esempio n. 1
0
        public void FillIdentityInfo(int userId, Dictionary <string, object> dictionary)
        {
            string        birth = null, industry = null;
            int?          gender = null, cityId = null;
            Vnet_Identity daIdentity = new Vnet_Identity();

            if (daIdentity.SelectByUser_Id(userId))
            {
                birth  = daIdentity.Birthday.HasValue ? daIdentity.Birthday.Value.ToString() : string.Empty;
                gender = daIdentity.Gender;
                if (daIdentity.Region_Id.HasValue)
                {
                    var region = ChinaArea.GetRegion(daIdentity.Region_Id.Value);
                    cityId = region?.City_ID;
                }
            }
            Tnet_User_Profile daUserProfile = new Tnet_User_Profile();

            if (daUserProfile.SelectByPk(userId))
            {
                if (daUserProfile.City_Id.HasValue)
                {
                    cityId = daUserProfile.City_Id.Value;
                }
                industry = daUserProfile.Industry;
            }
            dictionary.Add("Birthday", birth);
            dictionary.Add("Industry", industry);
            dictionary.Add("Gender", gender);
            dictionary.Add("CityId", cityId);
        }
Esempio n. 2
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());
        }
Esempio n. 3
0
 /// <summary>
 /// 更新地区
 /// </summary>
 /// <param name="ChinaArea">地区实体</param>
 /// <returns></returns>
 public void UpdateChinaArea(ChinaArea ChinaArea)
 {
     _chinaAreaRepository.UpdateAsync(ChinaArea);
 }
Esempio n. 4
0
 /// <summary>
 /// 导入地区
 /// </summary>
 /// <param name="ChinaArea">地区实体</param>
 /// <returns></returns>
 public void InsertChinaArea(ChinaArea ChinaArea)
 {
     _chinaAreaRepository.Insert(ChinaArea);
 }
Esempio n. 5
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);
        }