public async Task <bool> Update(ImportInfoDto exportInfoDto) { try { using (var conn = DapperFactory.GetConnection(exportInfoDto.ConnectionString)) { var query = " update {0} set MODIFY_FLAG=1 where {1}=:{1}"; query = string.Format(query, exportInfoDto.CurenetTableName, nameof(exportInfoDto.INVOICE_NO)); return(await conn.ExecuteAsync(query, new { exportInfoDto.INVOICE_NO }, commandType : System.Data.CommandType.Text) == 1); } } catch (Exception ex) { throw ex; } }
public async Task <List <INNERASESHJMY_IMPORTINFO> > Get_ImportInfoNum(ImportInfoDto exportInfoDto) { IEnumerable <INNERASESHJMY_IMPORTINFO> result = new List <INNERASESHJMY_IMPORTINFO>(); try { using (var conn = DapperFactory.GetConnection(exportInfoDto.ConnectionString)) { var query = "select {0} from {1} where MODIFY_FLAG=0 group by {0}"; query = string.Format(query, nameof(exportInfoDto.INVOICE_NO), exportInfoDto.CurenetTableName); result = await conn.QueryAsync <INNERASESHJMY_IMPORTINFO>(query); } } catch (Exception ex) { throw ex; } return(result.ToList()); }
public async Task <IHttpActionResult> UpdateJmyImportInfo(ImportInfoDto importInfoDto) { try { bool result = await _jmyImportInfoRepository.Update(importInfoDto); return(Json(new ReturnResult <List <INNERASESHJMY_IMPORTINFO> >() { Success = result })); } catch (System.Exception ex) { _logger.Error($"UpdateJmyImportInfo 异常:{ex}"); return(Json(new ReturnResult <object>() { Messge = ex.Message, Success = false })); } }
public async Task <IHttpActionResult> GetJmyImportInfoByNo(ImportInfoDto importInfoDto) { try { var result = await _jmyImportInfoRepository.Get_ImportInfoList(importInfoDto); _logger.Info($"获取的结果:{JsonConvert.SerializeObject(result)}"); return(Json(new ReturnResult <List <INNERASESHJMY_IMPORTINFO> >() { Data = result, Success = true })); } catch (System.Exception ex) { _logger.Error($"GetJmyImportInfoByNo 异常:{ex}"); return(Json(new ReturnResult <object>() { Messge = ex.Message, Success = false })); } }
public async Task <IHttpActionResult> GetJmyImportInfo(ImportInfoDto importInfoDto) { try { var result = await _jmyImportInfoRepository.Get_ImportInfoNum(importInfoDto); _logger.Info($"获取的结果:{JsonConvert.SerializeObject(result)}"); return(Json(new ReturnResult <object>() { Data = result.Select(x => new { x.INVOICE_NO }).ToList(), Success = true })); } catch (System.Exception ex) { _logger.Error($"GetJmyImportInfo 异常:{ex}"); return(Json(new ReturnResult <object>() { Messge = ex.Message, Success = false })); } }