Giter Site home page Giter Site logo

book-library-system's People

Contributors

ygsama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

book-library-system's Issues

求助老哥

老哥能不能把sql文件发我邮箱一份,感谢感谢

导入代码报了很多错误;能上传一下数据库脚本吗,文件导入失败

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 CS0234 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名“PowerPacks”(是否缺少程序集引用?) 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\BorrowBooks.Designer.cs 345 活动的
错误 CS0234 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名“PowerPacks”(是否缺少程序集引用?) 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\BorrowBooks.Designer.cs 344 活动的
错误 CS0234 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名“PowerPacks”(是否缺少程序集引用?) 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\ReturnBooks.Designer.cs 392 活动的
错误 CS0234 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名“PowerPacks”(是否缺少程序集引用?) 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\ReturnBooks.Designer.cs 393 活动的
错误 CS0234 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名“PowerPacks”(是否缺少程序集引用?) 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\BorrowBooks.Designer.cs 54 活动的
错误 CS0234 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名“PowerPacks”(是否缺少程序集引用?) 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\BorrowBooks.Designer.cs 55 活动的
错误 CS0234 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名“PowerPacks”(是否缺少程序集引用?) 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\BorrowBooks.Designer.cs 273 活动的
警告 CS0108 '“ReturnBooks.Tag”隐藏继承的成员“Control.Tag”。如果是有意隐藏,请使用关键字 new。 图书管理系统 D:\C#Project\BooK-Library-System-master\图书管理系统\ReturnBooks.Designer.cs 402 活动的
警告 未能找到引用的组件“Microsoft.VisualBasic.PowerPacks.Vs”。 图书管理系统
警告 未能解析此引用。未能找到程序集“Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL”。请检查磁盘上是否存在该程序集。 如果您的代码需要此引用,则可能出现编译错误。 图书管理系统

能上传一下数据库脚本吗,文件导入失败

borrowBooks.cs和InsertNewBook.cs中存在的已知问题的修复请求!

①在borrowBooks中当先还书再借书的过程中容易产生ID冲突错误,简单修改如下:

//获取最大的编号
string sqlL = "SELECT MAX(ID) FROM borrow";
string maxID = SqlHelper.ExecuteScalar(sqlL).ToString();

if (maxID == "NULL" || maxID == "")
{
    // 如果maxID为空或没有值,我们可以假设它为1,然后加1  
    maxID = "000001";
}
else {
    int temp = int.Parse(maxID) + 1; // 确保先转换为整数,然后再加1  
    maxID = temp.ToString("D6"); // 更新maxID的值  
}
 // 插入数据到借书表(borrow)
 sql = "insert into borrow values(@ID,@uId,@bName,@bNum,@bPrice,convert(varchar(20),GETDATE() ,111),convert(varchar(20),dateadd(day," + comboBox1.Text.ToString().Substring(0, 2) + ",CONVERT(varchar(20),GETDATE() ,111)),111),@Tag)";
 MyDictionary dic = new MyDictionary();
 dic.Add("@ID", maxID);
 dic.Add("@uId", uIdTb.Text.Trim());
 dic.Add("@bName", bNameTB.Text.Trim());
 dic.Add("@bNum", bNumTB.Text.Trim());
 dic.Add("@bPrice", bPriceTB.Text.Trim());
 dic.Add("@Tag", "0");// Tag = 0 标记该书未超归还期限 
 int i = SqlHelper.ExecuteNonQuery(sql, dic);
 if (i > 0)
 {
     n = (Convert.ToInt32(n) - 1).ToString(); // 库存量-1
     sql = "update books set bTag=@bTag where bNum=@bNum";
     MyDictionary dic2 = new MyDictionary();
     dic2.Add("@bTag", n);
     dic2.Add("@bNum", bNumTB.Text.Trim());
     SqlHelper.ExecuteScalar(sql, dic2);
     MessageBox.Show("提交成功");
 }

②在InsertNewBook.cs中,注销书籍后新增书籍造成ID冲突错误,简单修改如下:

 private void 新书入库Btn_Click(object sender, EventArgs e)
 {
     if (bNameTB.Text.Trim() == "" || bAuthorTB.Text.Trim() == "" || bPubComTB.Text.Trim() == "" || ISBN.Text.Trim() == "" || bTagTB.Text.Trim() == "" || bPriceTB.Text.Trim() == "" || bPubDatTB.Text.Trim() == "")
     {
         MessageBox.Show("请填写完整信息", "失败");
     }
     else
     {
         //获取最大的编号
         string sqlL = "SELECT MAX(bNUM) FROM books";
         string maxID = SqlHelper.ExecuteScalar(sqlL).ToString();

         if (maxID == "NULL" || maxID == "")
         {
             // 如果maxID为空或没有值,我们可以假设它为1,然后加1  
             maxID = "000001";
         }
         else
         {
             int temp = int.Parse(maxID) + 1; // 确保先转换为整数,然后再加1  
             maxID = temp.ToString("D6"); // 更新maxID的值  
         }

         // 自动获得图书序列号
         string sql = " select COUNT(*)+1 from books";
         string bNum = SqlHelper.ExecuteScalar(sql).ToString();
         StringBuilder sb = new StringBuilder(bNum);
         while (sb.Length != 6)
         {
             sb.Insert(0, "0");
         }
         bNum = sb.ToString();
         
         // 添加操作
         sql = "insert into books values(@bNum,@bName,@bAuthor,@bPubCom,@bPubDat,@ISBN,@bPrice,@bTag)";
         MyDictionary dic = new MyDictionary();
         dic.Add("@bNum", maxID);
         dic.Add("@bName", bNameTB.Text.Trim());
         dic.Add("@bAuthor", bAuthorTB.Text.Trim());
         dic.Add("@bPubCom", bPubComTB.Text.Trim());
         dic.Add("@bPubDat", bPubDatTB.Text.Trim());
         dic.Add("@ISBN", ISBN.Text.Trim());
         dic.Add("@bPrice", bPriceTB.Text.Trim());
         dic.Add("@bTag", bTagTB.Text.Trim());
         int i = SqlHelper.ExecuteNonQuery(sql, dic);
         if (i == 1)
         {
             MessageBox.Show("添加成功,图书序列号为" + maxID);
         }
     }
 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.