Esempio n. 1
0
        public ResponseBBDetailtplDelete BBDetailtplDelete(RequestBBDetailtplDelete request)
        {
            ResponseBBDetailtplDelete response = new ResponseBBDetailtplDelete();

            using (cnn = GetConnection())
            {
                var ts = cnn.BeginTransaction();
                try
                {
                    string sql = "delete from TKS_FAS_ReportDetailTPL where id=@Id";
                    cnn.Execute(sql, new { Id = request.Data.Id }, ts);

                    sql = "delete from TKS_FAS_Formula where ReportDetailTPLId=@ReportDetailTPLId";
                    cnn.Execute(sql, new { ReportDetailTPLId = request.Data.Id }, ts);

                    ts.Commit();
                    response.IsSuccess = true;
                    response.Message   = "删除成功";
                    return(response);
                }
                catch (Exception ex)
                {
                    ts.Rollback();
                    return(this.DealException(response, ex) as ResponseBBDetailtplDelete);
                }
            }
        }
 public ResponseBBDetailtplDelete BBDetailtplDelete([FromBody] RequestBBDetailtplDelete request)
 {
     try
     {
         ReportTplBLL bll = new ReportTplBLL();
         return(bll.BBDetailtplDelete(request));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(
                   Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }