public async Task <IActionResult> PutTransacciones(int id, Transacciones transacciones) { if (id != transacciones.Indice) { return(BadRequest()); } _context.Entry(transacciones).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TransaccionesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("Indice,Peticion,Respuesta,Estado,Fecha,Pruebas,Completas,Orden,Siapsid,Orc,Ox")] Transacciones transacciones) { if (ModelState.IsValid) { _context.Add(transacciones); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Estado"] = new SelectList(_context.EstadosTransacciones, "Idestado", "Idestado", transacciones.Estado); return(View(transacciones)); }
public bool validateToken(string tokenString) { var result = _hl7Context.Sessions.Where(session => session.Token == tokenString).ToList(); if (result.Count > 0) { _hl7Context.Sessions.RemoveRange(_hl7Context.Sessions.Where(session => session.Token == tokenString)); _hl7Context.SaveChangesAsync(); return(true); } return(false); }
private async Task <Boolean> saveTransaction(PeticionEntrante ordersData, string messageString) { RequestBuilderUtil utilData = new RequestBuilderUtil(); Transacciones newTransaction = new Transacciones(); string orderID = utilData.compuseOrderId(ordersData.Orc4_placerGroupNumer); newTransaction.Peticion = messageString; newTransaction.Estado = 0; newTransaction.Fecha = DateTime.Now; newTransaction.Completas = 0; newTransaction.Pruebas = ordersData.ListaORB.Count(); newTransaction.Siapsid = orderID; newTransaction.Ox = ordersData.Orc1_orderControl; newTransaction.Orc = int.Parse(ordersData.Orc2_placerOrderNumer); if (newTransaction.Ox == CoreConfiguration.ModificacionString) { _context.RemoveRange(_context.His2lis.Where(data => data.Orden == orderID)); _context.RemoveRange(_context.Ohistidx.Where(data => data.Orden == orderID)); _context.RemoveRange(_context.Oficha.Where(data => data.Custom == decimal.Parse(orderID))); _context.RemoveRange(_context.OtPerfil.Where(data => data.OtPerfilOrder == decimal.Parse(orderID))); _context.RemoveRange(_context.Ot.Where(data => data.TCustom == decimal.Parse(orderID))); var deleteCount = _context.SaveChanges(); var oldTransaction = _hl7Context.Transacciones.Where(data => data.Siapsid == ordersData.Orc4_placerGroupNumer); foreach (Transacciones tran in oldTransaction) { tran.Estado = 8; } _hl7Context.Transacciones.UpdateRange(oldTransaction); _hl7Context.SaveChanges(); } _hl7Context.Transacciones.Add(newTransaction); var result = await _hl7Context.SaveChangesAsync(); return(result > 0); }