public ResponseInvoiceDJ WX_InvoiceCX([FromBody] RequestInvoiceDJ request) { try { InvoiceBLL bll = new InvoiceBLL(); return(bll.WX_InvoiceCX(request)); } catch (Exception ex) { throw new HttpResponseException( Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public ResponseInvoiceDJ WX_InvoiceCX(RequestInvoiceDJ request) { ResponseInvoiceDJ response = new ResponseInvoiceDJ(); using (cnn = GetConnection()) { var ts = cnn.BeginTransaction(); try { var user = this.UserInfoGet(request.Token, ts); //var user = cnn.Query<TKS_FAS_User>(@"select * from TKS_FAS_User where Id=@Id", new { Id = request.UserId }, ts).FirstOrDefault(); string sql = @" UPDATE TKS_FAS_Invoice SET Status = 0 ,UpdateUser =@UpdateUser ,UpdateDate =@UpdateDate where id=@Id "; cnn.Execute(sql, new { Id = request.Id, UpdateDate = DateTime.Now, UpdateUser = user.User.TrueName }, ts); ts.Commit(); response.IsSuccess = true; response.Message = "撤销成功"; return(response); } catch (Exception ex) { ts.Rollback(); return(this.DealException(response, ex) as ResponseInvoiceDJ); } } }