Beispiel #1
0
        public bool SetReader(List <BookLabel> books)
        {
            DirectoryInfo di   = ReadFolder();
            string        path = di.FullName;

            FileInfo[] labels = di.GetFiles();
            if (labels.Length == 0)
            {
                return(false);
            }

            while (books.Count() != 0)
            {
                BookLabel book = books[0];
                bool      flag = false;
                for (int i = 0; i < labels.Length; i++)
                {
                    if (book.ID == PraseFile2Label(labels[i].Name).ID)
                    {
                        string newfile = PraseLabel2File(book);
                        labels[i].MoveTo(path + "\\" + newfile);
                        flag = true;
                        break;
                    }
                }
                if (!flag)//有一个标签没写上
                {
                    return(false);
                }
                books.RemoveAt(0);
            }
            return(true);
        }
Beispiel #2
0
        private string PraseLabel2File(BookLabel label)
        {
            string newfile = label.ID;

            newfile += label.SIG == false ? '0' : '1';
            return(newfile);
        }
Beispiel #3
0
        public List <BookLabel> GetReader(int n)
        {
            List <BookLabel> books = new List <BookLabel>();
            BookLabel        a     = GetReader();

            if (a == null)
            {
                return(null);
            }
            books.Add(a);
            return(books);
        }
Beispiel #4
0
        public bool SetReader(BookLabel book)
        {
            DirectoryInfo di   = ReadFolder();
            string        path = di.Root.ToString();

            FileInfo[] labels = di.GetFiles();
            if (labels.Length == 0)
            {
                return(false);
            }
            for (int i = 0; i < labels.Length; i++)
            {
                if (book.ID == PraseFile2Label(labels[i].Name).ID)
                {
                    string newfile = PraseLabel2File(book);
                    labels[0].MoveTo(path + "\\" + newfile);
                    return(true);
                }
            }
            return(false);
        }
Beispiel #5
0
        private string PraseLabel2RFID(BookLabel label)
        {
            string newfile = label.ID;

            return(newfile);
        }
Beispiel #6
0
 public bool SetReader(BookLabel book)
 {
     return(true);
 }