Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions LibrarySearch/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<appSettings>
<add key="connectionstring" value="server=115.159.197.73;uid=sa;pwd=Hh525..;database=LibrarySearchDB"/>
</appSettings>

</configuration>
46 changes: 46 additions & 0 deletions LibrarySearch/BookComments.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LibrarySearch
{
public class BookComments
{
//标题
public string title { get; set; }
//作者
public string[] author { get; set; }
//出版社
public string publisher { get; set; }
//封面图片的url
public string image { get; set; }
//isbn10
public string isbn10 { get; set; }
//isbn13
public string isbn13 { get; set; }
//出版日期
public string pubdate { get; set; }
//概述
public string summary { get; set; }
//页数
public string pages { get; set; }
//价格
public string price { get; set; }
//获取失败的返回信息
public string msg { get; set; }
public string code { get; set; }

//评论
public string[] comment { get; set; }

public string id { get; set; }

public string starts { get; set; }




}
}
115 changes: 115 additions & 0 deletions LibrarySearch/BookContentForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions LibrarySearch/BookContentForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;


namespace LibrarySearch
{
public partial class BookContentForm : Form
{
string ISBN = "";

public BookContentForm()
{
InitializeComponent();

}

public BookContentForm(string ISBN)
{
InitializeComponent();
this.ISBN = ISBN;
}




private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{

}

private void textBox4_TextChanged(object sender, EventArgs e)
{

}

private void textBox3_TextChanged(object sender, EventArgs e)
{

}

private void BookContentForm_Load(object sender, EventArgs e)
{
string catalog; //目录
string preRead; //简介


SqlConnection con = Util.SqlConnection();
con.Open();
using (SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = "select catalogContent,preContent from dbo.BookPreConentView where ISBN=@ISBN;";
cmd.Parameters.Add(new SqlParameter("@ISBN", ISBN));
SqlDataReader readercatalog = cmd.ExecuteReader();
while (readercatalog.Read())
{
//设置目录表
catalog = readercatalog.GetString(0);
textBox_Catalog.Text = catalog;
textBox_Catalog.ReadOnly = true;
textBox_Catalog.Select(0, 0);

//设置图书简介
preRead = readercatalog.GetString(1);
textBox_preRead.Text = preRead;
textBox_preRead.ReadOnly = true;
textBox_preRead.Select(0, 0);

}

}

con.Close();
}
}

}
Loading