示例#1
0
        public ResponseFPtplUpdate FPtplUpdate(RequestFPtplUpdate request)
        {
            ResponseFPtplUpdate response = new ResponseFPtplUpdate();

            using (cnn = GetConnection())
            {
                var ts = cnn.BeginTransaction();

                try
                {
                    var user = this.UserInfoGetButAccount(request.Token, ts);


                    string sql = @" 
                            UPDATE  TKS_FAS_Invoice2TPL
                               SET
                                  
                                  Type =@Type
                                  ,IsVAT = @IsVAT
                                  ,RPStatus = @RPStatus
                                  ,PayMode =@PayMode
                                  ,TPLID=@TPLID
                                  
                                  ,UpdateUser =@UpdateUser
                                  ,UpdateDate =@UpdateDate
                                  
                             where id=@Id

                            ";
                    request.Data.UpdateDate = DateTime.Now;
                    request.Data.UpdateUser = user.User.UserName;
                    var r = cnn.Execute(sql, request.Data, ts);


                    if (r == 1)
                    {
                        ts.Commit();
                        response.IsSuccess = true;
                        response.Message   = "更新成功";
                        return(response);
                    }
                    else
                    {
                        throw new AppException(user.User.UserName, "FPtplUpdate", "数据更新异常", r + "行数据被更新");
                    }
                }
                catch (Exception ex)
                {
                    ts.Rollback();
                    return(this.DealException(response, ex) as ResponseFPtplUpdate);
                }
            }
        }
示例#2
0
 public ResponseFPtplUpdate FPtplUpdate([FromBody] RequestFPtplUpdate request)
 {
     try
     {
         FPtplBLL bll = new FPtplBLL();
         return(bll.FPtplUpdate(request));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(
                   Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }