Пример #1
0
        public ActionResult List(DateTime bDate, DateTime eDate, string SearchType = "", int codeID = 0, string code = "", int codeID2 = 0, decimal lowValue = 0, decimal highValue = 0)
        {
            /*
             * ViewBag.BeginDate = bDate;
             * ViewBag.EndDate = eDate;
             * ViewBag.SearchType = SearchType;
             * ViewBag.CodeID = codeID;
             * ViewBag.Code = code;
             * ViewBag.CodeID2 = codeID2;
             * ViewBag.LowValue = lowValue;
             * ViewBag.HighValue = highValue;
             * */

            IEnumerable <propertyinventory> InventoryList;

            if (SearchType == "AssignedToSearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByAssignTo(code);
            }
            else if (SearchType == "LocationSearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByLocation(code);
            }
            else if (SearchType == "PurchaseDateSearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByPerchaseDateRange(bDate, eDate);
            }
            else if (SearchType == "QuantitySearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByQuantityRange(codeID, codeID2);
            }
            else if (SearchType == "StatusSearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByStatus(code);
            }
            else if (SearchType == "TagSearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByTag(code);
            }
            else if (SearchType == "ValueSearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByValueRange(lowValue, highValue);
            }
            else if (SearchType == "ConditionSearch")
            {
                InventoryList = PropertyInventoryRepository.GetInventoryByCondition(code);
            }
            else
            {
                InventoryList = PropertyInventoryRepository.GetAllPropertyInventory();
            }

            ViewBag.RecordCount = InventoryList.Count();
            GetData();
            return(PartialView(InventoryList));
        }
Пример #2
0
        public InventoriesPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IEventAggregator eventAggregator)
            : base(navigationService, pageDialogService)
        {
            Title = "Inventory list";

            _restClient = new RestClient();
            //_inventoryCollection = new ObservableCollection<InventoryThumbnail>(InventoryFactory.GetInventories());
            _inventoryList = new ObservableCollection <WrappedSelection <InventoryThumbnail> >();

            /*
             * foreach (var inventory in InventoryFactory.GetInventories())
             * {
             *  _inventoryList.Add(new WrappedSelection<InventoryThumbnail>() { Item = inventory, IsSelected = false });
             * }*/

            ItemTappedCommand = new DelegateCommand <Object>(OnItemTappedCommandExecuted);

            NewCommand    = new DelegateCommand(OnNewCommandExecuted);
            ScanCommand   = new DelegateCommand(OnScanCommand);
            SearchCommand = new DelegateCommand(OnSearchCommandExecuted);

            PrintCommand  = new DelegateCommand(OnPrintCommandExecuted);
            RemoveCommand = new DelegateCommand(OnRemoveCommandExecuted);

            RegisterTransactionCommand = new DelegateCommand(OnRegisterTransactionCommandExecuted);
            //UpdateAttributeBatchCommand = new DelegateCommand(OnUpdateAttributeBatchCommandExecuted);

            ChangeLocationCommand       = new DelegateCommand(OnChangeLocationCommandExecuted);
            ViewInventoryActionsCommand = new DelegateCommand(OnViewInventoryActionsCommand);
            SaveListCommand             = new DelegateCommand(OnSaveListCommand);

            SelectItemCommand = new DelegateCommand <Object>(OnSelectItemCommand);

            SelectedRowsCount = InventoryList.Count(i => i.IsSelected == true);
            AccessionCount    = InventoryList.Select(i => i.Item.accession_id).Distinct().Count();
            TotalQuantity     = _inventoryList.Select(i => i.Item.quantity_on_hand).Sum();

            eventAggregator.GetEvent <AddInventoryToListEvent>().Subscribe(OnAddItemToList);
        }
Пример #3
0
        public void GetInventory()
        {
            if (InventoryList.Count() == 0)
            {
                Console.WriteLine("There are no items in inventory!");
                return;
            }
            int i = 0;

            foreach (LootsList item in InventoryList)
            {
                //Any(item => item.UniqueProperty == wonderIfItsPresent.UniqueProperty)
                if (ItemList.Any(x => x.Name == item.ItemName))
                {
                    Console.WriteLine($"{i}. [{item.Count} x {item.ItemName}][value {(ItemList.Find(x => x.Name == item.ItemName)).Value}]");
                }
                else
                {
                    Console.WriteLine($"{i}. [{item.Count} x {item.ItemName}]");
                }
                i++;
            }
        }
 private void OnItemToggledCommandCommandExecuted()
 {
     SelectedRowsCount = InventoryList.Count(x => x.IsSelected == true);
 }