public IHttpActionResult SaveReimageSummary(ReimageSummary entity) { try { using (var scope = new TransactionScope()) { entity.Save(); string filePath; entity.GenerateExcel(out filePath); scope.Complete(); } return(Ok(entity)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult SubmitReimageSummary(ReimageSummary entity) { try { using (var scope = new TransactionScope()) { entity.Save(); string filePath; entity.GenerateExcel(out filePath); scope.Complete(); } entity.Submit(); return(Ok(entity)); } catch (Exception ex) { Log4netHelper.WriteErrorLog(JsonConvert.SerializeObject(ex)); return(BadRequest(ex.Message)); } }