private void RegistraEntrega() { try { AsociadoMantenimiento asociadoM = new AsociadoMantenimiento(); List<SIGEEA_DetFacAsociado> listaDetalles = new List<SIGEEA_DetFacAsociado>(); SIGEEA_FacAsociado factura = new SIGEEA_FacAsociado(); factura.Estado_FacAsociado = true; factura.FecEntrega_FacAsociado = DateTime.Now; factura.FK_Id_Asociado = asociado.PK_Id_Asociado; foreach (uc_IngresoProducto ip in stpContenedor.Children) { SIGEEA_DetFacAsociado fac = new SIGEEA_DetFacAsociado(); fac.CanTotal_DetFacAsociado = ip.getCantidad(); fac.FK_Id_Lote = ip.getLote(); fac.Mercado_DetFacAsociado = ip.getMercado(); fac.FK_Id_PreProCompra = ip.getProducto();//Se le asigna la PK del producto, en la función de registrar de AsociadoMantenimiento se hace el cambio necesario. listaDetalles.Add(fac); } asociadoM.RegistraEntrega(factura, listaDetalles); MessageBox.Show("Entrega registrada con éxito.", "SIGEEA", MessageBoxButton.OK, MessageBoxImage.Exclamation); wnwFacturaEntrega ventana = new wnwFacturaEntrega(factura.PK_Id_FacAsociado); ventana.ShowDialog(); this.Close(); } catch (Exception ex) { MessageBox.Show("Error al registrar: " + ex.Message, "SIGEEA", MessageBoxButton.OK, MessageBoxImage.Error); } }
partial void DeleteSIGEEA_DetFacAsociado(SIGEEA_DetFacAsociado instance);
partial void UpdateSIGEEA_DetFacAsociado(SIGEEA_DetFacAsociado instance);
partial void InsertSIGEEA_DetFacAsociado(SIGEEA_DetFacAsociado instance);
private void detach_SIGEEA_DetFacAsociados(SIGEEA_DetFacAsociado entity) { this.SendPropertyChanging(); entity.SIGEEA_FacAsociado = null; }
private void attach_SIGEEA_DetFacAsociados(SIGEEA_DetFacAsociado entity) { this.SendPropertyChanging(); entity.SIGEEA_PreProCompra = this; }