public ActionResult Edit(int id, TbExportacion a) { try { var context = HttpContext.RequestServices.GetService(typeof(riviera_businessContext)) as riviera_businessContext; var objectEdit = context.TbExportacion.FirstOrDefault(te => te.IdExportacion == a.IdExportacion); if (objectEdit != null) { objectEdit.CartaPoderId = a.CartaPoderId; objectEdit.Cfdi = a.Cfdi; objectEdit.CfdiFpA = a.CfdiFpA; objectEdit.Entregada = a.Entregada; objectEdit.FechaFactura = a.FechaFactura; objectEdit.FechaPago = a.FechaPago; objectEdit.FechaPromesaEntrega = a.FechaPromesaEntrega; objectEdit.IdEstado = a.IdEstado; objectEdit.IdPersona = a.IdPersona; objectEdit.NoFactura = a.NoFactura; objectEdit.ObservacionesReclamos = a.ObservacionesReclamos; objectEdit.OrdenCompra = a.OrdenCompra; objectEdit.Pagada = a.Pagada; objectEdit.PedimientoImpOk = a.PedimientoImpOk; objectEdit.SalidaAgencia = a.SalidaAgencia; objectEdit.ValorFactura = a.ValorFactura; objectEdit.Xml = a.Xml; context.TbExportacion.Update(objectEdit); context.SaveChanges(); } return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Create(TbExportacion a) { try { var context = HttpContext.RequestServices.GetService(typeof(riviera_businessContext)) as riviera_businessContext; context.TbExportacion.Add(a); context.SaveChanges(); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }