public void Dispose() { if (DA != null) { DA = null; } }
public async Task <IActionResult> ConfirmarOrden(int customerID, DateTime orderDate, string orderNumber) { Order cabecera = new Order(); cabecera.CustomerId = customerID; cabecera.OrderDate = orderDate; cabecera.OrderNumber = orderNumber; List <OrderItem> detalle = new List <OrderItem>(); var productos = HttpContext.Session.GetString("listaProducto"); detalle = JsonConvert.DeserializeObject <List <OrderItem> >(productos); if (detalle.Count() == 0) { return(Json("NP")); } int newOrderID = await DAOrden.Insertar(cabecera, detalle); //HttpContext.Session.SetString("listaProducto", ""); var usuario = HttpContext.Session.GetString("objUsuario"); User user = JsonConvert.DeserializeObject <User>(usuario); Audit audit = new Audit(); audit.idorden = newOrderID; audit.fecha = DateTime.Now; audit.idusuario = user.id; bool exito = DAAuditoria.Insertar(audit); return(Json(newOrderID)); }
public BLAuditoria() { DA = new DAAuditoria(); }