Beispiel #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;
            //}
        }
Beispiel #2
0
        public void CancelBankCard(string userId)
        {
            //try
            //{
            //    DB.Begin();
            var manager = new BankCardManager();
            var entity  = manager.BankCardById(userId);

            if (entity == null)
            {
                DB.Rollback();
                throw new Exception("未查到信息");
            }
            manager.DeleteBankCard(entity);
            //    DB.Commit();
            //}
            //catch (Exception ex)
            //{
            //    DB.Rollback();
            //    throw ex;
            //}
        }