Exemplo n.º 1
0
        public void UpdateBankCard(C_BankCard bankCard, string userId)
        {
            //DB.Begin();
            //try
            //{
            var manager = new BankCardManager();
            var entity  = manager.BankCardById(userId);

            if (entity == null)
            {
                //DB.Rollback();
                throw new Exception("修改信息未被查询到");
            }
            entity.BankCardNumber = bankCard.BankCardNumber;
            entity.BankCode       = bankCard.BankCode;
            entity.BankName       = bankCard.BankName;
            entity.BankSubName    = bankCard.BankSubName;
            entity.CityName       = bankCard.CityName;
            entity.ProvinceName   = bankCard.ProvinceName;
            entity.RealName       = bankCard.RealName;
            entity.UpdateTime     = DateTime.Now;
            manager.UpdateBankCard(entity);
            //    DB.Commit();
            //}
            //catch (Exception ex)
            //{
            //    DB.Rollback();
            //    throw ex;
            //}
        }
Exemplo n.º 2
0
        public void AddBankCard(C_BankCard bankCard)
        {
            //try
            //{
            //    DB.Begin();
            var manager = new BankCardManager();
            var entity  = new C_BankCard()
            {
                UserId         = bankCard.UserId,
                BankCardNumber = bankCard.BankCardNumber,
                BankCode       = bankCard.BankCode,
                BankName       = bankCard.BankName,
                BankSubName    = bankCard.BankSubName,
                CityName       = bankCard.CityName,
                CreateTime     = DateTime.Now,
                ProvinceName   = bankCard.ProvinceName,
                RealName       = bankCard.RealName,
                UpdateTime     = DateTime.Now
            };

            manager.AddBankCard(entity);
            //    DB.Commit();
            //}
            //catch (Exception ex)
            //{
            //    DB.Rollback();
            //    throw ex;
            //}
        }
Exemplo n.º 3
0
        public void AddBankCard(C_BankCard bankCard)
        {
            DB.Begin();
            var manager = new BankCardManager();
            var entity  = new C_BankCard()
            {
                UserId         = bankCard.UserId,
                BankCardNumber = bankCard.BankCardNumber,
                BankCode       = bankCard.BankCode,
                BankName       = bankCard.BankName,
                BankSubName    = bankCard.BankSubName,
                CityName       = bankCard.CityName,
                CreateTime     = DateTime.Now,
                ProvinceName   = bankCard.ProvinceName,
                RealName       = bankCard.RealName,
                UpdateTime     = DateTime.Now
            };

            manager.AddBankCard(entity);
            DB.Commit();
        }
Exemplo n.º 4
0
        /// <summary>
        /// 查询银行卡信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public C_BankCard BankCardById(string userId)
        {
            var entity = new BankCardManager().BankCardById(userId);

            //if (entity == null)
            //    throw new LogicException(string.Format("查不到{0}的银行卡信息", userId));
            entity = new C_BankCard();
            return(new C_BankCard()
            {
                UserId = entity.UserId,
                BankCardNumber = entity.BankCardNumber,
                BankCode = entity.BankCode,
                BankName = entity.BankName,
                BankSubName = entity.BankSubName,
                BId = entity.BId,
                CityName = entity.CityName,
                CreateTime = entity.CreateTime,
                ProvinceName = entity.ProvinceName,
                RealName = entity.RealName,
                UpdateTime = entity.UpdateTime
            });
        }
Exemplo n.º 5
0
 public void DeleteBankCard(C_BankCard entity)
 {
     DB.GetDal <C_BankCard>().Delete(entity);
 }
Exemplo n.º 6
0
 public void UpdateBankCard(C_BankCard entity)
 {
     DB.GetDal <C_BankCard>().Update(entity);
 }
Exemplo n.º 7
0
 public void AddBankCard(C_BankCard entity)
 {
     DB.GetDal <C_BankCard>().Add(entity);
 }