예제 #1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// qiy		16.03.30
        /// <param name="value">值</param>
        /// <returns></returns>
        public bool Modify(AccountInfo value)
        {
            bool result = true;

            using (TransactionScope scope = new TransactionScope())
            {
                result &= _user.Modify(value);
                result &= accountMapper.Delete(value.UserId) > 0;

                if (result)
                {
                    accountMapper.Insert(value);
                }

                if (result)
                {
                    scope.Complete();
                }
            }

            return(result);
        }
예제 #2
0
 public IHttpActionResult Put(UserInfo value)
 {
     return(_user.Modify(value) ? (IHttpActionResult)Ok() : BadRequest("保存失败"));
 }