private void cbxCategoria_SelectionChanged(object sender, SelectionChangedEventArgs e) { ObjEMNF_ArticuloCategoria = (EMNF_ArticuloCategoria)cbxCategoria.SelectedItem; if (ObjEMNF_ArticuloCategoria == null) { dtgListaPrecio.Columns.Clear(); return; } var vrListEMNF_SubCategoria = new List <EMNF_ArticuloSubCategoria>(); string strOutMessageError = string.Empty; CmpTask.ProcessAsync(() => { vrListEMNF_SubCategoria = new BMNF_ArticuloSubCategoria().ListAdministrarSubCategoria(ObjEMNF_ArticuloCategoria); vrListEMNF_SubCategoria.Add(new EMNF_ArticuloSubCategoria() { IdSubCategoria = 0, SubCategoria = "TODOS" }); }, (ex) => { if (ex != null) { CmpMessageBox.Show(CMPMensajes.TitleAdminListadoPrecio, ex.Message, CmpButton.Aceptar); return; } else { cbxSubCategoria.ItemsSource = vrListEMNF_SubCategoria; cbxSubCategoria.SelectedItem = vrListEMNF_SubCategoria.FirstOrDefault(x => x.IdSubCategoria == 0); } }); }
private void txtAriculo_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.B)) { string strFiltro = txtAriculo.Text; if (strFiltro.Trim().Length == 0) { strFiltro = "%"; } string strOutMessageError = string.Empty; CmpTask.ProcessAsync( () => { ObjEMNF_Articulo = new EMNF_Articulo() { ObjEMNF_ArticuloClase = new EMNF_ArticuloClase() { IdArtClase = 0 }, ObjEMNF_ArticuloMarca = new EMNF_ArticuloMarca() { IdMarca = 0 }, ObjEMNF_ArticuloSubCategoria = new EMNF_ArticuloSubCategoria() { IdSubCategoria = 0 }, }; ObjEMNF_ArticuloCategoria = new EMNF_ArticuloCategoria(); ListEMNF_Articulo = new BMNF_Articulo().ListGetArticulos(ObjEMNF_Articulo, ObjEMNF_ArticuloCategoria, strFiltro); }, (ex) => { if (ex != null) { CmpMessageBox.Show(CMPMensajes.TitleAdminListadoPrecio, ex.Message, CmpButton.Aceptar); return; } else { if (ListEMNF_Articulo.Count == 1) { ObjEMNF_Articulo = ListEMNF_Articulo.FirstOrDefault(); txtAriculo.Text = ObjEMNF_Articulo.Articulo; CmpLoading.LoadDetail(); } else { this.FlyoutIsOpen("PMNF_BuscarArticulos", ((value) => { if (value is PMNF_BuscarArticulos) { var FlyoutsPMNF_BuscarArticulos = (PMNF_BuscarArticulos)value; FlyoutsPMNF_BuscarArticulos.InitializePMNF_BuscarArticulos(); FlyoutsPMNF_BuscarArticulos.LoadHeader(); FlyoutsPMNF_BuscarArticulos.SetValueFilter = txtAriculo.Text; FlyoutsPMNF_BuscarArticulos.IsOpen = true; } })); } } }); } }