示例#1
0
 /// <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());
     }
 }
示例#2
0
        /// <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);
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
 private void SetItemDefinitionObject(ItemDefinitionDTO pObjItemDefinitionDTO)
 {
     SetItemObject(mObjInventoryFactory.GetItemService().Get(pObjItemDefinitionDTO.ItemId));
     SetItemTypeObject(mObjInventoryFactory.GetItemTypeService().GetCustomEntity(pObjItemDefinitionDTO.ItemTypeId));
     txtOrder.Text = pObjItemDefinitionDTO.Order.ToString();
 }