图书管理系统的C#代码(完整版).doc
《图书管理系统的C#代码(完整版).doc》由会员分享,可在线阅读,更多相关《图书管理系统的C#代码(完整版).doc(12页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、如有侵权,请联系网站删除,仅供学习与交流图书管理系统的C#代码(完整版)【精品文档】第 12 页C#代码清单共1个项目,包含5个类。项目: librarysystem类: Program.cs Readers.cs Manage.cs Menu.cs Publications.cs主类代码:namespace librarysystem / / 类名:Program / 功能:项目主类 / 时间:2015-11-19/ class Program static void Main(string args) Menu meu = new Menu(); meu.ShowMainMenu(); C
2、onsole.ReadLine();出版物类代码:namespace librarysystem / / 类名:Publications / 功能:馆藏出版物信息 / 时间:2015-11-19 / class Publications /*出版物编号*/ private string PublicationISBN; public string PublicationIsbn get return PublicationISBN; set PublicationISBN = value; /*出版物名称*/ public string PublicationName; /*出版物作者或出版机
3、构*/ public string PublicationAuthor; /*出版物在架状态*/ public bool PublicationStatus; /*出版物类型*/ public string PublicationType; public Publications() public Publications(string PublicationISBN,string PublicationName,string PublicationAuthor,string PublicationType,bool PublicationStatus) this. PublicationIS
4、BN = PublicationISBN; this.PublicationName = PublicationName; this.PublicationAuthor = PublicationAuthor; this.PublicationType = PublicationType; this.PublicationStatus = PublicationStatus;读者类代码:namespace librarysystem / / 类名:Readers / 功能:已获取权限读者的信息 / 时间:2015-11-19 / class Readers private string Rea
5、derID; public string ReaderId get return ReaderID; set ReaderID = value; public string ReaderName; public string ReaderSex; public string ReaderDepartment; public string ReaderMajor; public string BowPublication = new string10,; public Readers() public Readers(string ReaderID, string ReaderName, str
6、ing ReaderSex, string ReaderDepartment, string ReaderMajor) this.ReaderID = ReaderID; this.ReaderName = ReaderName; this.ReaderSex = ReaderSex; this.ReaderDepartment = ReaderDepartment; this.ReaderMajor = ReaderMajor;管理类代码:namespace librarysystem / / 类名:Manage / 功能:管理员执行图书管理操作 / 时间:2015-11-19 / clas
7、s Manage public bool BorrowFlag = false;/*借阅操作成功标志*/ public bool ReturnFlag = false;/*归还操作成功标志*/ public Publications pub_search;/*保存查询到的出版物*/ public Readers Red_valid;/*保存查询到的合法用户*/ /*声明馆藏出版物数组*/ public Publications pubs=new Publications200; /*声明注册读者数组*/ public Readers reds=new Readers30; /*实例化馆藏出版物
8、对象*/ public Publications pub0 = new Publications(000000,C#从入门到精通,明日科技,书籍,true); public Publications pub1 = new Publications(000001, 数值分析, 李清朗, 书籍, true); public Publications pub2 = new Publications(000002, 模式识别, 张学工, 书籍, true); public Publications pub3 = new Publications(000003, 中国国家地理, 地理科学院, 杂志, t
9、rue); public Publications pub4 = new Publications(000004, 意林, 长春市文学艺术界联合会 , 杂志, true); public Publications pub5 = new Publications(000005, 四川大学报, 四川大学, 报纸, true); public Publications pub6 = new Publications(000006, 经济学人, 伦敦经济学人报纸有限公司, 杂志, true); public Publications pub7 = new Publications(000007, 计算
10、机网络, 谢希仁, 书籍, true); public Publications pub8 = new Publications(000008, 红楼梦, 曹雪芹, 书籍, true); public Publications pub9 = new Publications(000009, 新东方雅思培训课程, 俞敏洪, 音像制品, true); public Publications pub10 = new Publications(000010, MATLAB实用教程, 张世杰, 音像制品, true); /*实例化已注册读者对象*/ public Readers red0 = new R
11、eaders(20150000, 李华, 男, 电子信息学院, 电子与通信工程); public Readers red1 = new Readers(20150001, 王鹏, 男, 物理学院, 微电子学); public Readers red2 = new Readers(20150002, 张建豪, 男, 数学学院, 现代数学分析); public Readers red3 = new Readers(20150003, 陈莉, 女, 化学化工学院, 化学分析); public Readers red4 = new Readers(20150004, 吴娜, 女, 医学院, 口腔医学)
12、; public Readers red5 = new Readers(20150005, 宋雅茹, 女, 电子信息学院, 光学工程); /*初始化出版物数组*/ public void PublicationsInitial() pubs0 = pub0; pubs1 = pub1; pubs2 = pub2; pubs3 = pub3; pubs4 = pub4; pubs5 = pub5; pubs6 = pub6; pubs7 = pub7; pubs8 = pub8; pubs9 = pub9; pubs10 = pub10; /*初始化读者数组*/ public void Read
13、ersInitial() reds0 = red0; reds1 = red1; reds2 = red2; reds3 = red3; reds4 = red4; reds5 = red5; /*查询图书操作*/ public bool SearchPublications() string Pub_Name; bool SearchFlag = false; Pub_Name = Console.ReadLine(); foreach (Publications pub in pubs) if (pub != null & pub.PublicationName = Pub_Name) S
14、earchFlag = true; pub_search = pub; return SearchFlag; /*借阅图书操作*/ public void Borrow() string Red_Name; string Pub_Name; bool ReaderFlag = false; Red_Name = Console.ReadLine(); foreach (Readers red in reds) if (red != null & red.ReaderName = Red_Name) ReaderFlag = true; Red_valid = red; if (ReaderFl
15、ag) Console.Write(请输入您需要借阅出版物的名称:); Pub_Name = Console.ReadLine(); foreach (Publications pub in pubs) if (pub != null & pub.PublicationName = Pub_Name) BorrowFlag = true; pub.PublicationStatus = false; AddToReders(pub.PublicationName, Red_valid); else Console.WriteLine(抱歉,您是非法读者,不能借阅图书); /*归还图书操作*/
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 图书 管理 系统 C# 代码 完整版
限制150内