public bool Delete(BankCardEntity entity)
		{
			try
            {
                _bankcardRepository.Delete(entity);
                return true;
            }
            catch (Exception e)
            {
				_log.Error(e,"数据库操作出错");
                return false;
            }
		}
		public BankCardEntity Update (BankCardEntity entity)
		{
			try
            {
                _bankcardRepository.Update(entity);
                return entity;
            }
            catch (Exception e)
            {
				_log.Error(e,"数据库操作出错");
                return null;
            }
		}
        public HttpResponseMessage AddBankCard([FromBody] AddBankCardEntity bankcard)
        {
            #region 验证码判断 解密
            var strDes = EncrypHelper.Decrypt(bankcard.Hidm, "Hos2xNLrgfaYFY2MKuFf3g==");//解密
            string[] str = strDes.Split('$');
            string source = str[0];//获取验证码
            DateTime date = Convert.ToDateTime(str[1]);//获取发送验证码的时间
            DateTime dateNow = Convert.ToDateTime(DateTime.Now.ToLongTimeString());//获取当前时间
            TimeSpan ts = dateNow.Subtract(date);
            double secMinu = ts.TotalMinutes;//得到发送时间与现在时间的时间间隔分钟数
            if (secMinu > 30) //发送时间与接受时间是否大于3分钟
            {
                return PageHelper.toJson(PageHelper.ReturnValue(false, "你已超过时间验证,请重新发送验证码!"));
            }
            else
            {
                if (bankcard.MobileYzm != source)//判断验证码是否一致
                {
                    return PageHelper.toJson(PageHelper.ReturnValue(false, "验证码错误,请重新发送!"));
                }
            }

            #endregion


            var user = (UserBase)_workContext.CurrentUser;
            if (user != null)
            {
                var broker = _brokerService.GetBrokerByUserId(user.Id);//获取当前经纪人
                if (broker != null)
                {
                    var entity = new BankCardEntity
                    {
                        Addtime = DateTime.Now,
                        Uptime = DateTime.Now,
                        Address = bankcard.Address,
                        Adduser = broker.Id,
                        Type = "储蓄卡",
                        Upuser = broker.Id,
                        Bank = _bankService.GetBankById(Convert.ToInt32(bankcard.Bank)),
                        Broker = broker,
                        Num = bankcard.Num,
                        Deadline = Convert.ToDateTime("2000-01-01 00:00:00")
                    };

                    try
                    {
                        if (_bankcardService.Create(entity) != null)
                        {
                            return PageHelper.toJson(PageHelper.ReturnValue(true, "数据添加成功!"));
                        }
                    }
                    catch
                    {
                        return PageHelper.toJson(PageHelper.ReturnValue(false, "数据添加失败!"));
                    }
                }
            }
            return PageHelper.toJson(PageHelper.ReturnValue(false, "获取用户失败,请检查是否登陆"));

        }