Beispiel #1
0
        private void onRecodeBookLocationAddBookListCommandExecute()
        {
            IBookLocationService bookLocationService = this.container.Resolve <IBookLocationService>();
            String        currentShelfRfid           = this.shelfRfid;
            List <String> bookRfidList = new List <String>();

            //如果图书列表和书架信息为空,则不执行插入操作
            if (this.onRecodeBookLocationAddBookListCommandCanExecute() == false)
            {
                return;
            }

            //把新的信息加入数据库
            foreach (BookItem oneBook in this.BookItemList)
            {
                bookRfidList.Add(oneBook.BookRFIDCode);
            }
            bookLocationService.setBookRfidListOnShelfRfid(currentShelfRfid, bookRfidList);
            this.clearBookListAndShelfInformation();
            //throw new NotImplementedException();
            MessageBox.Show("添加图书信息成功!");
            //添加图书后通过重置,使得set被调用,从而激活UI刷新
            this.BookItemList = this.BookItemList;

            /***
             * this.dispatcherService.Dispatch(() =>
             * {
             *  ((DelegateCommand)this.RecodeBookLocationAddBookListCommand).RaiseCanExecuteChanged();
             *  ((DelegateCommand)this.RecodeBookLocationCleanBookListCommand).RaiseCanExecuteChanged();
             *
             * });***/
        }
Beispiel #2
0
        void RecodeBookLocation()
        {
            String        shelfRfid    = ShelfRfidString;
            List <String> bookRfidList = BookRfidString.Split(';').ToList <String>();

            if ((String.IsNullOrEmpty(shelfRfid)) || (bookRfidList.Count == 0))
            {
                return;
            }
            bookLocationService.setBookRfidListOnShelfRfid(shelfRfid, bookRfidList);
        }