資源簡(jiǎn)介
圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)源代碼。圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)源代碼。圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)源代碼。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Data.SqlClient;
namespace?Mybook
{
????public?partial?class?AddbookForm?:?Form
????{
???????
????????public?AddbookForm()
????????{
????????????InitializeComponent();
????????}
????????//增加
????????private?void?btnadd_Click(object?sender?EventArgs?e)
????????{
????????????if?(txtbookname.Text?==?““)
????????????{
????????????????MessageBox.Show(“請(qǐng)輸入書名“?“溫馨提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????return;
????????????}
????????????else?if?(txtpublish.Text?==?““)
????????????{
????????????????MessageBox.Show(“請(qǐng)輸入出版社“?“溫馨提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????return;
????????????}
????????????else?if?(txtauthor.Text?==?““)
????????????{
????????????????MessageBox.Show(“請(qǐng)輸入作者“?“溫馨提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????return;
????????????}
????????????else?if?(txtprice.Text?==?““)
????????????{
????????????????MessageBox.Show(“請(qǐng)輸入價(jià)格“?“溫馨提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????return;
????????????}
????????????else
????????????{
????????????????try
????????????????{
????????????????????//打開數(shù)據(jù)庫(kù)的連接
????????????????????DBHelper.connection.Open();
????????????????????//創(chuàng)建插入用的sql語句
????????????????????string?sql?=?string.Format(“insert?into?BookInfo(bookNamebookAuthorpricepublish)?values(‘{0}‘‘{1}‘‘{2}‘‘{3}‘)?“?txtbookname.Text?txtauthor.Text?txtprice.Text?txtpublish.Text);
????????????????????//創(chuàng)建command對(duì)象
????????????????????SqlCommand?command?=?new?SqlCommand(sql?DBHelper.connection);
????????????????????//執(zhí)行命令
????????????????????int?result?=?command.ExecuteNonQuery();
????????????????????if?(result?>?0)
????????????????????{
????????????????????????MessageBox.Show(“添加成功!“?“溫馨提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????????}
????????????????????else
????????????????????{
????????????????????????MessageBox.Show(“添加失??!“?“溫馨提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????????}
????????????????}
????????????????catch
????????????????{
????????????????????MessageBox.Show(“打開數(shù)據(jù)庫(kù)出錯(cuò)“);
????????????????}
????????????????finally
????????????????{
????????????????????DBHelper.connection.Close();
????????????????}
????????????}
????????}
????????//清空
????????private?void?btnclear_Click(object?sender?EventArgs?e)
????????{
????????????txtbookname.Clear();
????????????txtpublish.Clear();
????????????txtauthor.Clear();
????????????txtprice.Clear();
????????????txtbookname.Focus();
????????}
????????//退出
????????private?void?btnexist_Click(object?sender?EventArgs?e)
????????{
????????????DialogResult?result?=?MessageBox.Show(“真的要退出嗎?“?“溫馨提示“?MessageBoxButtons.OKCancel?MessageBo
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\
?????文件?????????907??2009-12-25?16:44??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook.sln
?????文件???????13312??2010-01-02?15:43??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook.suo
?????文件????????3876??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\AddbookForm.cs
?????文件????????7934??2009-12-25?17:52??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\AddbookForm.Designer.cs
?????文件????????5814??2009-12-25?17:52??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\AddbookForm.resx
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\bin\
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\bin\Debug\
?????文件???????24576??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\bin\Debug\Mybook.exe
?????文件???????30208??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\bin\Debug\Mybook.pdb
?????文件????????5632??2005-11-11?22:25??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\bin\Debug\Mybook.vshost.exe
?????文件?????????331??2009-12-25?17:04??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\DBHelper.cs
?????文件????????3699??2009-12-25?18:41??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\Mybook.csproj
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\
?????文件?????????180??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\Mybook.AddbookForm.resources
?????文件?????????913??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\Mybook.csproj.GenerateResource.Cache
?????文件???????24576??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\Mybook.exe
?????文件???????30208??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\Mybook.pdb
?????文件?????????180??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\Mybook.Properties.Resources.resources
?????文件?????????180??2009-12-26?09:58??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\Mybook.ShowbookForm.resources
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\Refactor\
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\TempPE\
?????文件????????4608??2009-12-25?18:39??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件?????????308??2010-01-02?15:43??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\obj\Mybook.csproj.FileList.txt
?????文件?????????471??2009-12-25?16:51??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\Program.cs
?????目錄???????????0??2019-12-26?17:54??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\Properties\
?????文件????????1160??2009-12-25?16:44??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\Properties\AssemblyInfo.cs
?????文件????????2834??2009-12-25?18:37??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\Properties\Resources.Designer.cs
?????文件????????5612??2009-12-25?16:44??圖書管理系統(tǒng)Mybook-C#實(shí)現(xiàn)\Mybook\Properties\Resources.resx
............此處省略8個(gè)文件信息
評(píng)論
共有 條評(píng)論