/// <summary> /// Valida el lote ingresado /// </summary> private void ValidarLote() { try { if (txtLote.Text == string.Empty) { Contexto.AlmacenInventarioLote = null; return; } var loteId = int.Parse(txtLote.Text); var lotePl = new AlmacenInventarioLotePL(); //Validar producto seleccionado //if (productoSeleccionado == null || productoSeleccionado.ProductoId == 0) if (Contexto.Producto == null || Contexto.Producto.ProductoId == 0) { SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.ReporteAuxiliarInventarioMateriaPrima_MsgSelecioneProducto, MessageBoxButton.OK, MessageImage.Warning); skAyudaProducto.Focus(); txtLote.Text = string.Empty; return; } //Validar almacen seleccionado //if (almacenSeleccionado == null || almacenSeleccionado.AlmacenID == 0) if (Contexto.Almacen == null || Contexto.Almacen.AlmacenID == 0) { SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.ReporteAuxiliarInventarioMateriaPrima_MsgSelecioneAlmacen, MessageBoxButton.OK, MessageImage.Warning); skAyudaAlmacen.Focus(); txtLote.Text = string.Empty; return; } var lotein = new AlmacenInventarioLoteInfo { Lote = loteId, //Activo = EstatusEnum.Activo, OrganizacionId = Contexto.Almacen.Organizacion.OrganizacionID, ProductoId = Contexto.Producto.ProductoId, TipoAlmacenId = Contexto.Almacen.TipoAlmacen.TipoAlmacenID, AlmacenInventario = new AlmacenInventarioInfo { AlmacenID = Contexto.Almacen.AlmacenID } }; var loteObtenido = lotePl.ObtenerAlmacenInventarioLotePorFolioLote(lotein); if (loteObtenido != null && Contexto.Producto != null) { if (loteObtenido.AlmacenInventario.AlmacenID != Contexto.Almacen.AlmacenID) { SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.ReporteAuxiliarInventarioMateriaPrima_LoteNoExiste, MessageBoxButton.OK, MessageImage.Warning); txtLote.Text = string.Empty; txtLote.Focus(); } else { Contexto.AlmacenInventarioLote = loteObtenido; } } else { SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.ReporteAuxiliarInventarioMateriaPrima_LoteNoExiste, MessageBoxButton.OK, MessageImage.Warning); txtLote.Text = string.Empty; txtLote.Focus(); } } catch (Exception ex) { Logger.Error(ex); SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.ReporteAuxiliarInventarioMateriaPrima_FalloValidarLote, MessageBoxButton.OK, MessageImage.Warning); txtLote.Text = string.Empty; txtLote.Focus(); } }