/// <summary> /// Elimina un registro. /// </summary> private void btnDelete_Click(object sender, RoutedEventArgs e) { try { if (CustomMessageBox.ShowOption("Eliminar", "¿Desea eliminar el registro?", "Si", "No", "", Window.GetWindow(this)) == true) { mObjInventoryFactory.GetItemService().Remove(mLonId); loadDatagrid(); ClearControls(); } } catch (Exception lObjException) { CustomMessageBox.Show("Error", lObjException.Message, this.GetParent()); } }
/// <summary> /// Realiza la busqueda o carga la ventana de dialogo /// </summary> private void txtItemId_KeyDown(object pObjSender, KeyEventArgs pObjArgs) { Item lObjItem = new Item(); if (pObjArgs.Key == Key.Enter & ((pObjSender as TextBox).AcceptsReturn == false) && (pObjSender as TextBox).Focus()) { string lStrText = (pObjSender as TextBox).Text; List <Item> lLstObjItems = mObjInventoryServicesFactory.GetItemService().SearchItem(lStrText, FilterEnum.ACTIVE); if (lLstObjItems.Count == 1) { lObjItem = lLstObjItems[0]; } else { (pObjSender as TextBox).Focusable = false; UserControl lUCItems = new UCSearchItem(lStrText, lLstObjItems, FilterEnum.ACTIVE); lObjItem = FunctionsUI.ShowWindowDialog(lUCItems, Window.GetWindow(this)) as Item; (pObjSender as TextBox).Focusable = true; } (pObjSender as TextBox).Focus(); LoadItemObject(lObjItem); } }
private void Search(string pStrText) { grdSearch.BlockUI(); try { List <Item> lLstObjItemsList = mObjInventoryServicesFactory.GetItemService().SearchItem(pStrText, mEnmFilter); this.Dispatcher.Invoke(() => { dgDataGrid.ItemsSource = null; mLcvListData = new ListCollectionView(lLstObjItemsList); dgDataGrid.ItemsSource = mLcvListData; }); } catch (Exception lObjException) { ShowMessage("Error", lObjException.Message); } finally { grdSearch.UnblockUI(); } }
private void SetItemDefinitionObject(ItemDefinitionDTO pObjItemDefinitionDTO) { SetItemObject(mObjInventoryFactory.GetItemService().Get(pObjItemDefinitionDTO.ItemId)); SetItemTypeObject(mObjInventoryFactory.GetItemTypeService().GetCustomEntity(pObjItemDefinitionDTO.ItemTypeId)); txtOrder.Text = pObjItemDefinitionDTO.Order.ToString(); }