日期:2014-05-17  浏览次数:20876 次

winform修改listview数据问题
//修改窗体
//修改窗体加载时,同时加载修改的数据
        private void FrmUpdateBook_Load(object sender, EventArgs e)
        {
            FrmMain fm = new FrmMain();
            BindTypeAndPub();
            txtUpIsbn.Text = _upbookisbn;
            txtUpBookName.Text = _upbookname;
            txtUpAuthor.Text = _upauthor;
            txtUpBookClick.Text = _upbookclicks.ToString();
            txtUpBookCount.Text = _upbookcount.ToString();
            txtUpBookIntro.Text = _upbookintru;
            txtUpBookPrice.Text = _upbookprice.ToString();
            txtUpBookTOC.Text = _upbooktoc;
            txtUpWordCount.Text = _upbookwordcount.ToString();
            cmbUpPub.Text= _uppublisher;
            cmbUpType.Text = _upbooktype;
            dtpUp.Value =Convert.ToDateTime( _uppubdate);
        }

        //修改图书的方法
        public void UpdateBookShow()
        {
            BookInfo book = new BookInfo();
            book.ISBN = this.txtUpIsbn.Text;
            book.BookName = this.txtUpBookName.Text;
            book.Author = this.txtUpAuthor.Text;
            book.BookClicks = Convert.ToInt32(this.txtUpBookClick.Text);
            book.BookCount = Convert.ToInt32(this.txtUpBookCount.Text);
            book.BookIntru = this.txtUpBookIntro.Text;
            book.BookPrice = Convert.ToDouble(this.txtUpBookPrice.Text);
            book.BookStatus = BookStatus.Normal;
            book.WordCount = Convert.ToInt32(this.txtUpWordCount.Text);
            book.PubDate = this.dtpUp.Value;
            book.TOC = this.txtUpBookTOC.Text;
            book.PubId = Convert.To