예제 #1
0
        private void button_Add_Click(object sender, EventArgs e)
        {
            int       cur  = BookList.nextBookID;
            Form_Item item = new Form_Item(cur);

            item.ReturnBook += (o, e1) =>
            {
                BookDetail now = item.book;
                now.BookInfo.buildRawData();
                now.BookPrint.buildRawData();
                // 填充到 BookList
                BookList.Add(cur, now, true);
                // 重新整理内容到 ListView
                ListViewItem line = listView_Books.Items.Add(cur.ToString());
                for (int i = 0; i < 12; i++)
                {
                    line.SubItems.Add("");
                }
                RefreshBookList(ref now, ref line);
                if (listView_Books.Items.Count <= 1)
                {
                    SetWidthListView_Books(-2);
                }
            };
            item.ShowDialog();
        }
예제 #2
0
        private void listViewBooks_DoubleClick(object sender, EventArgs e)
        {
            int        lineNumber = this.listView_Books.SelectedIndices[0];
            var        line       = this.listView_Books.Items[lineNumber];
            string     bid        = line.SubItems[0].Text;
            int        id         = int.Parse(bid);
            BookDetail book;

            if (!BookList.tryFind(id, out book))
            {
                return;
            }
            Form_Item item = new Form_Item(book);

            item.ReturnBook += (o, e1) =>
            {
                BookDetail tmp = item.book;
                tmp.BookInfo.buildRawData();
                tmp.BookPrint.buildRawData();
                // 填充到 BookList
                BookList.ReplaceTo(id, tmp);
                BookDetail now; BookList.tryFind(id, out now);
                // 重新整理内容到 ListView
                RefreshBookList(ref now, ref line);
            };
            item.ShowDialog();
        }
예제 #3
0
파일: Form_Main.cs 프로젝트: cfrpg/Publish
 private void button_Add_Click(object sender, EventArgs e)
 {
     int cur = BookList.nextBookID;
     Form_Item item = new Form_Item(cur);
     item.ReturnBook += (o, e1) =>
     {
         BookDetail now = item.book;
         now.BookInfo.buildRawData();
         now.BookPrint.buildRawData();
         // 填充到 BookList
         BookList.Add(cur, now, true);
         // 重新整理内容到 ListView
         ListViewItem line = listView_Books.Items.Add(cur.ToString());
         for (int i = 0; i < 12; i++) line.SubItems.Add("");
         RefreshBookList(ref now, ref line);
         if (listView_Books.Items.Count <= 1)
             SetWidthListView_Books(-2);
     };
     item.ShowDialog();
 }
예제 #4
0
파일: Form_Main.cs 프로젝트: cfrpg/Publish
 private void listViewBooks_DoubleClick(object sender, EventArgs e)
 {
     int lineNumber = this.listView_Books.SelectedIndices[0];
     var line = this.listView_Books.Items[lineNumber];
     string bid = line.SubItems[0].Text;
     int id = int.Parse(bid);
     BookDetail book;
     if (!BookList.tryFind(id, out book)) return;
     Form_Item item = new Form_Item(book);
     item.ReturnBook += (o, e1) =>
     {
         BookDetail tmp = item.book;
         tmp.BookInfo.buildRawData();
         tmp.BookPrint.buildRawData();
         // 填充到 BookList
         BookList.ReplaceTo(id, tmp);
         BookDetail now; BookList.tryFind(id, out now);
         // 重新整理内容到 ListView
         RefreshBookList(ref now, ref line);
     };
     item.ShowDialog();
 }