Beispiel #1
0
 private void btnDelete_Click(object pObjSender, System.Windows.RoutedEventArgs pObjEventsArgs)
 {
     if (CustomMessageBox.ShowOption("Eliminar", "¿Desea eliminar el registro?", "Si", "No", "", Window.GetWindow(this)) == true)
     {
         try
         {
             mObjInventoryFactory.GetItemDefinitionService().Remove(mLonId);
             ResetForm();
             LoadDataGrid();
         }
         catch (Exception lObjException)
         {
             CustomMessageBox.Show("Error", lObjException.Message, Window.GetWindow(this));
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Elimina un registro.
 /// </summary>
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     if (CustomMessageBox.ShowOption("Eliminar", "¿Desea eliminar el registro?", "Si", "No", "", Window.GetWindow(this)) == true)
     {
         mObjServiceFactory.GetItemDefinitionService().Remove(mLonId);
         ResetForm();
     }
 }
Beispiel #3
0
        private void txtItemType_KeyDown(object pObjSender, KeyEventArgs pObjArgs)
        {
            try
            {
                if (pObjArgs.Key == Key.Enter & ((pObjSender as TextBox).AcceptsReturn == false) && (pObjSender as TextBox).Focus())
                {
                    string lStrText = (pObjSender as TextBox).Text;

                    //mObjInventoryFactory.GetItemDefinitionService().GetHeadTypeRelation(x.ItemId,lObjGoodsIssue.Batch.ItemTypeId)


                    List <ItemType> lLstObjItemTypes = mObjInventoryFactory.GetItemTypeService()
                                                       .SearchItemTypeByAuctionType(lStrText, AuctionType, FilterEnum.AUCTION)
                                                       .Where(x => !x.Removed &&
                                                              (mObjInventoryFactory.GetItemDefinitionService().GetDefinitions(x.Id))).Select(y => y).ToList();



                    if (lLstObjItemTypes.Count == 1)
                    {
                        SetItemTypeObject(lLstObjItemTypes[0]);
                    }
                    else
                    {
                        (pObjSender as TextBox).Focusable = false;
                        UserControl lUCItemType = new UCSearchItemType(lStrText, AuctionType, lLstObjItemTypes, FilterEnum.AUCTION);
                        SetItemTypeObject(FunctionsUI.ShowWindowDialog(lUCItemType, this.GetParent()) as ItemType);
                        (pObjSender as TextBox).Focusable = true;
                    }
                }
            }
            catch (Exception lObjException)
            {
                CustomMessageBox.Show("Error", lObjException.Message, this.GetParent());
            }
        }
Beispiel #4
0
        private void Search(string pStrText)
        {
            grdSearch.BlockUI();

            try
            {
                List <ItemType> lLstObjItemTypesList = new List <ItemType>();

                if (mEnmFilter == FilterEnum.AUCTION)
                {
                    lLstObjItemTypesList = mObjInventoryServicesFactory.GetItemTypeService().SearchItemTypeByAuctionType(pStrText, mEnmAuctionType, mEnmFilter).Where(x => (mObjInventoryServicesFactory.GetItemDefinitionService().GetDefinitions(x.Id))).ToList();
                }
                else
                {
                    lLstObjItemTypesList = mObjInventoryServicesFactory.GetItemTypeService().SearchItemType(pStrText, mEnmFilter);
                }

                this.Dispatcher.Invoke(() =>
                {
                    dgDataGrid.ItemsSource = null;
                    mLcvListData           = new ListCollectionView(lLstObjItemTypesList);
                    dgDataGrid.ItemsSource = mLcvListData;
                });
            }
            catch (Exception lObjException)
            {
                ShowMessage("Error", lObjException.Message);
            }
            finally
            {
                grdSearch.UnblockUI();
            }
        }