示例#1
0
 private bool DetalleRepetido(int idReceta, int idEmpleado)
 {
     if (DetallesProduccion.Any(dp => dp.ID_RECETA == idReceta) && DetallesProduccion.Any(dp => dp.ID_EMPLEADO == idEmpleado))
     {
         MessageBox.Show("Detalle repetido.", Application.Current.Resources["NombreAplicacion"].ToString(), MessageBoxButton.OK, MessageBoxImage.Exclamation);
         return(true);
     }
     return(false);
 }
示例#2
0
        private void AgregarProducto()
        {
            var ventanaDetalle = new EdicionDetalleProduccion
            {
                DataContext = new EdicionDetalleProduccionViewModel(true, new DETALLE_PRODUCCION())
            };
            var resultado = ventanaDetalle.ShowDialog();

            if (resultado.HasValue && resultado.Value && !DetalleRepetido(((EdicionDetalleProduccionViewModel)ventanaDetalle.DataContext).DetalleProduccion.ID_RECETA, ((EdicionDetalleProduccionViewModel)ventanaDetalle.DataContext).DetalleProduccion.ID_EMPLEADO))
            {
                DetallesProduccion.Add(((EdicionDetalleProduccionViewModel)ventanaDetalle.DataContext).DetalleProduccion);
            }
        }
示例#3
0
 private void QuitarProducto()
 {
     DetallesProduccion.Remove(DetalleProduccionSeleccionado);
 }
示例#4
0
 private bool PuedoGrabar()
 {
     return(DetallesProduccion.Count() > 0);
 }