public async Task <ServiceResponse <GetCargaMasivaDto> > DeleteTerminalCargaMasivaAux(int terminal_id) { ServiceResponse <GetCargaMasivaDto> serviceResponse = new ServiceResponse <GetCargaMasivaDto>(); try { CargaMasivaAux terminalAux = await _context.CargaMasivaAux.FirstAsync(c => c.id == terminal_id); if (terminalAux != null) { _context.CargaMasivaAux.Remove(terminalAux); } await _context.SaveChangesAsync(); serviceResponse.Data = _mapper.Map <GetCargaMasivaDto>(terminalAux); } catch (Exception ex) { serviceResponse.Success = false; serviceResponse.Message = ex.Message; } return(serviceResponse); }
public async Task <ServiceResponse <CargaMasivaAux> > InsertTerminalCargaMasivaAux(AddFullTerminalSystemDto fullTerminalSystemDto) { ServiceResponse <CargaMasivaAux> serviceResponse = new ServiceResponse <CargaMasivaAux>(); try { CargaMasivaAux terminales = new CargaMasivaAux(); terminales.Custom1 = fullTerminalSystemDto.HeaderLine1 ?? null; terminales.Custom2 = fullTerminalSystemDto.HeaderLine2 ?? null; terminales.Custom3 = fullTerminalSystemDto.HeaderLine3 ?? null; terminales.Custom4 = fullTerminalSystemDto.Custom4; terminales.Custom5 = fullTerminalSystemDto.Custom5; terminales.Custom6 = fullTerminalSystemDto.Custom6; terminales.Custom7 = fullTerminalSystemDto.Custom7; terminales.Custom8 = fullTerminalSystemDto.Custom8; terminales.Custom9 = fullTerminalSystemDto.Custom9; terminales.Custom10 = fullTerminalSystemDto.Custom10; terminales.Custom11 = fullTerminalSystemDto.Custom11; terminales.Custom12 = fullTerminalSystemDto.Custom12; terminales.Custom13 = fullTerminalSystemDto.Custom13; terminales.Custom14 = fullTerminalSystemDto.Custom14; terminales.Custom15 = fullTerminalSystemDto.Custom15; terminales.Custom16 = fullTerminalSystemDto.Custom16; terminales.Custom19 = fullTerminalSystemDto.Custom19; if (fullTerminalSystemDto.TerminalChecksum) { terminales.TerminalChecksum = 0; } terminales.ConnectGroup = fullTerminalSystemDto.ConnectGroup; if (fullTerminalSystemDto.ParmConnChecksum) { terminales.ParmConnChecksum = 0; } terminales.ControlGroup = fullTerminalSystemDto.ControlGroup; if (fullTerminalSystemDto.ControlCheckSum) { terminales.ControlCheckSum = 0; } terminales.ParameterGroup = fullTerminalSystemDto.ParameterGroup; terminales.ParameterVersion = fullTerminalSystemDto.ParameterVersion; if (fullTerminalSystemDto.ParameterReload) { terminales.ParameterReload = 1; } terminales.ProgramID = fullTerminalSystemDto.ProgramID; terminales.ProgramVersion = fullTerminalSystemDto.ProgramVersion; if (fullTerminalSystemDto.ProgramReload) { terminales.ProgramReload = 1; } terminales.Paquete = fullTerminalSystemDto.Paquete; //prueba cargando todos los parametros terminales.TerminalID = ""; terminales.SerialNumber = ""; terminales.id_jpos = ""; terminales.value = ""; //listaAux.Add(terminales); await _context.CargaMasivaAux.AddAsync(terminales); await _context.SaveChangesAsync(); //await _context.SaveChangesAsync(); serviceResponse.Data = terminales; } catch (Exception ex) { serviceResponse.Success = false; serviceResponse.Message = ex.Message; } return(serviceResponse); }