示例#1
0
        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));
            }
        }
示例#2
0
        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));
            }
        }