private void recommendButton_Click(object sender, EventArgs e)//推荐,推荐数+1 { currentBook.Recommend = currentBook.Recommend + 1; BookShelfService.UpdateBook(currentBook); this.recommendButton.Enabled = false; this.recommendButton.Visible = false; }
private void finishButton_Click(object sender, EventArgs e)//完成 { if (Flag == 2) { currentBook.Name = this.nameTextBox.Text; currentBook.Author = this.authorTextBox.Text; currentBook.Sort = this.sortTextBox.Text; currentBook.Description = this.introductionTextBox.Text; if (path != null) { if (File.Exists(resPath + @"\" + currentBook.Name + ".jpg")) //判断文件是否存在 { File.Delete(resPath + @"\" + currentBook.Name + ".jpg"); } File.Copy(path, resPath + @"\" + currentBook.Name + ".jpg"); currentBook.imagePath = path; } BookShelfService.UpdateBook(currentBook); } this.Close(); }