第一篇:图书管理系统数据库源代码
图书管理系统数据库源代码
//创建工程及设计主界面
public class Main extends JFrame { private static final JDesktopPane {
DESKTOP_PANE=new JDesktopPane();
//桌面窗体
} public static void main(String[] args)
//入口方法
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//设置系统界面外观
new BookLogin();
//登录窗口
}
catch(Exception ex)
{
ex.printStackTrace();
} } public static void addIFame(JInternalFrame iframe)
//添加子窗体的方法
{
DESKTOP_PANE.add(iframe);
//新增子窗体
} public Main(){
super();
//设置“关闭”按钮处理事件
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
//创建工具栏
Toolkit tool=Toolkit,getDefaultToolkit();
//获得屏幕大小
Dimension screenSize=tool.getScreenSize();
setSize(800,600);
//设置窗体大小
setLocation((screenSize.width-getWidth())/2,(screenSize.height-getHeight())/2;//设置窗体位置
setTitle(“图书管理系统”);
//设置窗体标题
JMenuBar menuBar=createMenu();
//创建菜单栏
setJMenuBar(menuBar);
//设置菜单栏
JToolBar toolBar=createToolBar();
//创建工具栏的方法
getContentPane(),add(toolBar,BorderLayout.NORTH);
//设置工具栏
final JLable lable=new JLable();
//创建一个标签,用来显示图片
lable.setBounds(0,0,0,0);
//设置窗体的大小和位置
lable.setIcon(null);
//窗体背景
DESKTOP_PANE.addComponentListener(new ComponentAdapter())
{
public void componentResized(final ComponentEvent e)
{
Dimension size=e.getComponent().getSize();
//获得组建大小
lable.setSize(e.getComponent().getSize());
//设置标签大小
lable.setText(“”);
//设置标签文本,设置窗口背景
}
}
//将标签添加到桌面窗体
DESKTOP_PANE.add(lable,new Integer(Integer.MIN_VALUE));
getContentPane().add(DESKTOP_PANE);
//将桌面窗体添加到主窗体中
} } private JToolBar createToolBar()
//创建工具栏的方法 { JToolBar toolBar=new JToolBar();
//初始化工具栏
toolBar.setFloatable(false);
//设置是否可以移动工具栏
toolBar.setBorder(new BevelBorder(BevelBorder.RAIZED));
//设置边框
//图书信息添加按钮
JButton bookAddButton=new JButton(MenuActions.BOOK_ADD);ImageIcon icon=new ImageIcon(Main.class.getResource(“/bookAddtb.jpg”));//添加菜单栏图标
bookAddButton.setIcon(icon);
//设置按钮图标
bookAddButton.setHideActionText(true);
//显示提示文本
toolBar.add(bookAddButton);
//添加到工具栏中
JButton bookModiAndDelButton=new JButton(MenuActions.BOOK_MODIFY);
//图书信息修改按钮
ImageIcon bookmodiicon=Icon.add(“bookModiAndDeltb.jpg”);
//创建图表方法
bookModiAndDelButton.setIcon(bookmodiicon);
//设置按钮图标
bookModiAndDelButton.setHideActionText(true);
//显示提示文本
toolBar.add(bookModiAndDelButton);
//添加到工具栏
JButton bookTypeAddButton=new JButton(MenuActions.BOOKTYPE_ADD);
//图书类别添加按钮
ImageIcon bookTypeAddicon=Icon.add(“bookTypeAddtb.jpg”);
//创建图标方法
bookTypeAddButton.setIcon(bookTypeAddicon);
//设置按钮图标
bookTypeAddButton.setHideActionText(true);
//显示提示文本
toolBar.add(bookTypeAddButton);
//添加到工具栏
JButton bookBorrowButton=new JButton(MenuActions.BORROW);
//图书借阅按钮
ImageIcon bookBorrowicon=Icon.add(“bookBorrowtb.jpg”);
//创建图标方法
bookBorrowButton.setIcon(bookBorrowicon);
//设置按钮图标
bookBorrowButton.setHideActionText(true);
//显示提示文本
toolBar.add(bookBorrowButton);
//添加到工具栏
JButton bookOrderButton=new JButton(MenuActions.NEWBOOK_ORDER);
//新书订购按钮
ImageIcon bookOrdericon=Icon.add(“bookOrdertb.jpg”);
//创建图标方法
bookOrderButton.setIcon(bookOrdericon);
//设置按钮图标
bookOrderButton.setHideActionText(true);
//显示提示文本
toolBar.add(bookOrderButton);
//添加到工具栏
JButton bookCheckButton=new JButton(MenuActions.NEWBOOK_CHECK);
//验收新书按钮
ImageIcon bookCheckicon=Icon.add(“newbookChecktb.jpg”);
//创建图标方法
bookCheckButton.setIcon(bookCheckicon);
//设置按钮图标
bookCheckButton.setHideActionText(true);
//显示提示文本
toolBar.add(bookCheckButton);
//添加到工具栏
JButton readerAddButton=new JButton(MenuActions.READER_ADD);
//读者信息添加按钮
ImageIcon readerAddicon=Icon.add(“readerAddtb.jpg”);
//创建图标方法
readerAddButton.setIcon(readerAddicon);
//设置按钮图标
readerAddButton.setHideActionText(true);
//显示提示文本
toolBar.add(readerAddButton);
//添加到工具栏
JButton readerModiAndDelButton=new JButton(MenuActions.READER_MODIFY);
//读者信息修改按钮
ImageIcon readerModiAndDelicon=Icon.add(“readerModiAndDeltb.jpg”);
//创建图标方法
readerModiAndDelButton.setIcon(readerModiAndDelicon);
//设置按钮图标
readerModiAndDelButton.setHideActionText(true);
//显示提示文本
toolBar.add(readerModiAndDelButton);
//添加到工具栏
JButton ExitButton=new JButton(MenuActions.EXIT);
//退出系统按钮
ImageIcon Exiticon=Icon.add(“exittb.jpg”);
//创建图标方法
ExitButton.setIcon(Exiticon);
//设置按钮图标
ExitButton.setHideActionText(true);
//显示提示文本
toolBar.add(ExitButton);
//添加到工具栏
return toolBar;} public class Business { protected static String dbClassName=“com.mysql.jdbc.Driver”;
//数据库驱动类
protected static String dbUr1=“jdbc:mysql://localhost/ts”;
//连接URL protected static String dbUser=“root”;
//数据库用户名
protected static String dbpwd=“root”;
//数据库密码
private static Connection conn=null;
//数据库连接对象,初值为null public Business(){
try
{
if(coon==null)
//连接对象为空
{
Class.forName(dbClassName);
//加载驱动类信息
conn=DriverManager.getConnection(dbUr1,dbUser,dbPwd);
//建立连接对象
}
}
catch(Exception ee)
{
ee.printStackTrace();
} } public static ResultSet executeQuery(String sql)
//执行查询方法
{
try
{
//如果连接对象为空,则重新调用构造方法
if(conn==null)
{
new Business();
return conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE).executeQuery(sql);
//执行查询
}
}
catch(SQLException e)
{
e.printStackTrace();
return null;
//返回null值
}
finally
{} } public static int executeUpdata(String sql)
//更新方法
{
try
{
if(conn==null)
{
new Business();
//如果连接对象为空,则重新调用构造方法
return conn.createStatement().executeUpdate(sql);//执行更新
}
}
catch(SQLException e)
{
e.printStackTrace();
return-1;
}
finally
{} } public static void close()
//关闭方法 {
try
{
conn.close();
//关闭连接对象
}
catch(SQLException e)
{
e.printStackTrace();
}
finally
{
conn=null;
//设置连接对象为null值
} } }
//为数据库添加对应的类 public class BookInfo { private String Book_id;
//图书编号
private String typeid;
//类别编号
private String writer;
//作者
private String translator;//译者
private String publisher;
//出版社
private Date date;
//出版日期
private Double price;
//图书单价
private String getBookname;//图书名称
public String getBookname(){
return bookname;} public void setBookname(String bookname){
this.bookname=bookname;} public Date getDate(){
return date;} public void setDate(Date date){
this.date=date;} public string getBook_id()
{ return Book_id;} public void setBook_id(String Book_id){ this.Book_id=Book_id;} public Double getPrice(){ return price;} public void setprice(Double price){ this.price=price;} public String getPublisher(){ return Publisher;} public void setPublisher(String publisher){ this.Publisher=Publisher;} public String getTranslator(){ return translator;} public void setTranslator(String translator){ this.translator=translator;} public String getTypeid(){ return typeid;} public void setTypeid(String typeid){ this.typeid=typeid;} public String getWriter(){ return writer;} public void setWriter(String writer){
this.writer=writer;} } public class BookType
//图书列表信息类 { private String id;
//图书类别编号
private String typeName;
//图书类别名称
private String days;
//可解天数
private String fk;//每罚款金额
public String getFk(){
return fk;} public void setFk(String fk){
this.fk=fk;} public String getDays(){
return days;} public void setDays(String days){
this.days=days;} public string getId(){
return id;} public void setId(String id){
this.Bid=id;} public String getTypeName(){
return typeName;} public void setTypeName(String typeName){
this.typeName=typeName;} } public class Order
//图书订单信息类 {
private String Book_id;
//图书编号 private Date date;
//下单时间 private String number;
//图书数量 private String operator;//操作员
private String checkAndAccept;
//是否收到货 private String zk;
//图书折扣 public String getcheckAndAccept(){ return checkAndAccept;} public void setcheckAndAccept(String checkAndAccept){ this.checkAndAccept=checkAndAccept;} public Date getDate(){ return date;} public void setDate(Date date){ this.date=date;} public string getBook_id(){ return book_id;} public void setBook_id(String book_id){ this.book_id=book_id;} public String getNumber(){ return number;} public void setNumber(String number){ this.number=number;} public String getOperator(){ return operator;} public void setOperator(String operator){
this.operatorr=operator;
} public String getZk(){
return zk;} public void setZk(String Zk){
this.zk=zk;} } public class Operater { private String id;
//操作员编号
private String name;
//操作员用户名
private String grade;
//操作员等级
private String password;//操作员密码
private String type;
//出版社
public String getType(){
return type;} public void setType(String type){
this.type=type;} public string getGrade(){
return grade;} public void setGrade(String grade){
this.grade=grade;} public String getId(){
return id;} public void setId(String id){
this.id=id;} public String getName(){
return name;} public void setName(String name){
this.name=name;} public String getPassword(){
return password;} public void setPassword(String password){
this.password=password;} } public class Borrow
//书籍借阅信息类 { private int id;
//借阅编号
private String book_id;
//图书编号
private String reader_id;
//读者编号
private String num;
//借书数量
private String borrowDate;
//借书日期
private String backDate;
//应还日期
private String Bookname;//图书名称
public String getBookname(){
return bookname;} public void setBookname(String bookname){
this.bookname=bookname;} public string getBackDate(){
return backDate;} public void setBackDate(String backDate){
this.backDate=backDate;} public string getBorrowDate(){
return borrowDate;} public void setBorrowDate(String borrowDate){
this.borrowDate=borrowDate;} public String getNum(){
return num;} public void setNum(String num){
this.num=num;} public String getBook_id(){
return book_id;} public void setBook_id(String book_id){
this.book_id=book_id;} public String getReader_id(){
return reader_id;} public void setReader_id(String reader_id){
this.reader_id=reader_id;} public int getId(){
return id;} public void setId(Int id){
this.id=id;} } public class Back
//图书归还信息类 { private String book_id;
//图书编号
private String bookname;
//图书名称
private String operatorId;
//操作员编号
private String borrowDate;//图书借阅时间
private String backDate;
//图书归还时间 private String readerName;
//读者姓名 private String reader_id;//读者编号 private int typeId;private int id; public int getId(){ return id;} public void setId(int id){ this.id=id;} public int getTypeId(){ return typeid;} public void setTypeId(int typeid){ this.typeId=typeId;} public string getBackDate(){ return backDate;} public void setBackDate(String backDate){ this.backDate=backDate;} public String getBookname(){ return bookname;} public void setBookname(String bookname){ this.bookname=bookname;} public string getBorrowDate(){ return borrowDate;} public void setBorrowDate(String borrowDate){ this.borrowDate=borrowDate;} public String getOperatorId(){
return operatorId;} public void setOperatorId(String operatorId){
this.operatorId=operatorId;} public String getBook_id(){
return book_id;} public void setBook_id(String book_id){
this.book_id=book_id;}
public String getReader_id(){
return reader_id;} public void setReader_id(String reader_id){
this.reader_id=reader_id;}
public String getReaderName(){
return readerName;} public void setReaderName(String readerName){
this.readerName=readerName;} }
//系统登录模块设计
public class BookLogin extends JFrame { private static final Operater Type=null;
//人员类型
private static Operater user;
//用户名
private JPasswordField password;private JTextField username;private JButton login;private JButton reset;public BookLogin(){
super();
final BorderLayout borderLayout=new BorderLayout();
//创建布局管理器
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//设置“关闭”按钮处理事件
borderLayout.setVgap(10);
//设置组件间的垂直关系
getContentPane().setLayout(borderLayout);
//使用布局管理器
setTitle(“图书管理系统登录”)
//设置窗体标题
Toolkit tool=Toolkit.getDefaultToolkit();
//获得默认的工具箱
Dimension screenSize=tool.getScreenSize();//获得屏幕的大小
setSize(285,194);
setLocation((screenSize.width-getWidth())/2,(screenSize.height-getHeight())/2);//设置窗体位置
final JPanel mainPanel=new JPanel();
//创建主面板
mainPanel.setLayout(new BorderLayout());
//设置边框布局
mainPanel.setBorder(new EmptyBorder(0,0,0,0))
//设置边框为0
getContentPane().add(mainPanel);
//在窗体中加入主面板
final JLabel imageLabel=new JLabel;
//创建一个标签,用来显示图片
ImageIcon loginIcon=Icon.add(“login.jpg”);
//创建一个图像图标
imagelabel.setIcon(loginIcon);
//设置图片
imageLabel.setOpaque(true);
//设置绘制其边界内的所有像素
imageLabel.setBackground(Color.GREEN);
//设置背景颜色
imageLabel.setpreferredSize(new Dimension(260,60));//设置标签大小
mainPanel.add(imageLabel,BorderLayout.NORTH);
//添加标签到主面板
final JPanel centerPanel=new JPanel();
//添加一个中心面板
final GridLayout gridLayout=new GridLayout(2,2);//创建网络布局管理器
gridLayout.setHgap(5);
//设置组件之间平行的距离
gridLayout.setVgap(20);
//设置组件之间垂直的距离
centerPanel.setLayout(gridLayout);
//使用布局管理器
mainPanel.add(centerPanel);
//添加到主桌面
final JLabel userNamelabel=new JLabel();
//创建一个标签
userNameLabel.setHorizontalAlignment(SwingConstants.CENTER);//设置对齐方式
userNameLabel.setPreferredSize(new Dimension(0,0));
//设置组件大小
userNameLabel.setMinimumSize(new Dimension(0,0));
//设置组件最小的大小
centerPanel.add(userNameLabel);
//添加到中心面板
userNameLabel.setText(“用
户
名:”);
//设置标签文本
username=new JTextField(20);
//创建文本框
username.setPreferredSize(new Dimension(0,0));
//设置组件大小
centerPanel.add(username);
//添加到中心面板
final JLabel passwordLabel=new JLabel();
//创建一个标签
passwordLabel.setHorizontalAlignment(SwingConstants.CENTER);
//设置对齐方式
centerPanel.add(passwordLabel);
//添加到中心面板
passwordLabel.setText(“密
码:”);
//设置标签文本
password=new JPasswordField(20);
//创建密码框
password.setDocument(new Document(6));
//设置密码长度为6
password.addKeyListener(new KeyAdapter()
//监听密码框
{
public void keyPressed(final keyEvent e)
//监听键盘案件事件
{
if(e.getKeyCode()==10)
//如果按了回车键
{
login.doClick();
//进行登录
}
}
})
centerPanel.add(password);
//添加到中心面板
final JPanel southPanel=new JPanel;//新增一个底部面板
mainPanel.add(southPanel,BorderLayout.SOUTH);
//添加到主面板中
login=new JButton();
//创建按钮组件
login.addActionListener(new BookLoginAtion());
//添加监听器
login.setText(“登录”);
//设置按钮文本
southPanel.add(login);
//把按钮添加到底部面板
reset=new JButton();
//创建按钮组件
reset.addActionListener(new BookResetAction());
//添加监听器
reset.setText(“重置”);
//设置按钮文本
southPanel.add(reset);
//把按钮添加到底部面板
setVisible(true);
//设置创建可见
setResizable(false);
//设置窗体不可改变大小
} public static Operater getUser(){
return user;} public static Operater getType(){
return Type;} public static void setUser(Operater user){
BookLogin.user=user;} } private class BookResetAction implements ActionListener { public void actionPerformed(final ActionEvent e){
username.setText(“");//设置用户名输入框为空
password.setText(”“);//设置密码输入框为空
} } private class BookLoginAction implements ActionListener { public void actionPerformed(final ActionEvent e){
user=Business.check(username.getText(),new String(password.getPassword()));//调用business方法
if(user.getName()!=null)
//判断用户名是否为null
{
try
{
Main frame=new Main();
//创建一个主窗体
frame.setVisible(true);
//设置其可见
BookLogin.this.setVisible(false);
//设置登录窗体为不显示
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,”请输入正确的用户名和密码!“);//弹出提示框
username.setText(”“);
//设置用户名输入框为空
password.setText(”“);
//设置密码输入框为空
} } }
//基本信息管理模块
public class ReaderAdd extends JInternalFrame
//添加读者信息 { public ReaderAdd(){
super();
setTitle(”读者相关信息添加“);
setIconifiable(true);
//设置窗体可最小化
setClosable(true);
//设置窗体可关闭
setBounds(100,100,500,350);
final JLabel logoLabel=new JLabel();
ImageIcon readerAddIcon=Icon.add(”readerAdd.jpg“);
logoLabel.setIcon(readerAddIcon);
logoLabel.setOpaque(true);
logoLabel.setBackground(Color.CYAN);
logoLabel.setPreferredSize(new Dimension(400,60));
getContentPane().add(logoLabel,BorderLayout.NORTH);
final JPanel panel=new JPanel();
panel.setLayout(new FlowLayout());
getContentPane().add(panel);
final JPanel panel_1=new JPanel();
final GridLayout gridLayout=new GridLayout(0,4);
gridLayout.setVgap(15);
gridLayout.setHgap(15);
panel_1.setLayout(gridLayout);
panel_1.setPreferredSize(new Dimension(450,200));
panel.add(panel_1);
final JLabel label_2=new JLabel();
label_2.setText(”姓名:“);
panel_1.add(label_2);
readername=new JTextField();
readername.setDocument(new Document(10));
panel_1.add(readername);
final JLabel label_3=new JLabel();
public void actionPerformed(final ActionEvent e)
{
Check validator=new Check();
//校验类
String zj=String.valueof(comboBox.getSelectedIndex());
String id=read_id.getText().trim();
Vector v1=new Vector();
v1.clear();
v1.add(”reader“);
//读取配置文件中相应的查询语句
v1.add(id);
if(l==validator.Validate(V1))
//检查是否存在该读者
{
JOptionPane.showMessageDialog(null,”添加失败,该读者编号已存在!“);
}
else
{
Int i=Business.InsertReader(readername.getText().trim(),sex.trim(),age.getText().trim(),zjnumber.getText().trim(),Date.valueOf(date.getText().trim()),maxnumber.getText().trim().tel.getText().trim(),Double.valueof(keepmoney.getText().trim()),zj,zy.getText().trim(),Date.valueOf(bztime.getText().trim()),read_id.getText().trim());
if(i==1)
{
JOptionPane.showMessageDialog(null,”添加成功!“);
doDefaultCloseAction();
}
}
}
}
class TelListener extends KeyAdapter
{ public void keyTyped(KeyEvent e){
String numStr=”0123456789-“+(char)8;
//类型转换
if(numStr.indexOf(e.getKeyChar())<0)
{
e.consume();
} }
}
//添加“关闭”按钮的事件监听器
class CloseActionListener implements ActionListener
{
public void actionPerformed(final ActionEvent e)
{
doDefaultCloseAction();
}
}
private String[] columnNames(”名称“,”性别“,”年龄“,”证件号码“,”借书证有效日期“,”借书量“,”电话“,”押金“,”证件“,”职业“,”读者编号“,”办证时间“);
private String[] array=new String[]{”身份证“,”军人证“,”学生证“};
String id;
private Object[][] getFileStates(List list)
{
Object[][]results=new Object[list.size()][columnNames.length];
for(int i=0;i { Reader reader=(Reader)list.get(i); result[i][0]=reader.getName(); //定义二维数组 String sex; if(reader.getSex().equals(”1“)) { sex=”男“; } else { sex=”女“; } results[i][1]=sex; //读取读者歌属性值 results[i][2]=reader.getAge(); results[i][3]=reader.getIdentityCard(); results[i][4]=reader.getDate(); results[i][5]=reader.getMaxNum(); results[i][6]=reader.getTel(); results[i][7]=reader.getKeepMoney(); results[i][8]=array[reader.getZj()]; results[i][9]=reader.getZy(); results[i][10]=reader.getBook_id(); results[i][11]=reader.getBZtime(); } return results; } //图书类别管理 //添加图书信息 utton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { if(bookTypeName.getText().length()==0) { JOptionPane.showMMessageDialog(null,”图书类别文本框不可为空“); return; } if(days.getText().length()==0) { JOptionPane.showMessageDialog(null,”可借天数文本框不可为空“); return; } if(!check.isNumeric(days.getText().trim())) { JOptionPane.showMessageDialog(null,”可借天数必须为数字“); return; } if(fakuan.getText().length()==0) { JOptionPane.showMessageDialog(null,”罚款文本框不可为空“); return; } if(!check.isNumeric(fakuan.getText().trim())) { JOptionPane.showMessageDialog(null,”罚款必须为数字“); return; } int i=Business.InsertBookType(bookTypeName.getText().trim(),days.getText().trim(),Double.valueof(fakuan.getText.trim())/10); if(i==1) { JOptionPane.showMessageDialog(null,”添加成功!“); doDefaultCloseAction(); } } }); panel_6.add(button); final JButton buttonDel=new JButton(); buttonDel.setText(”关闭“); buttonDel.addActionListener(new ActionListener(){ public void actionPerformed(final ActionEvent e){ doDefaultCloseAction(); } }); panel_6.add(buttonDel); setVisibel(true);} //修改图书类 class ButtonAddListener implements ActionListener{ public void actionPerformed(ActionEvent e){ Object selectedItem=bookTypeModel.getSelectedItem(); int i=Business.UpdatebookType(BookTypeId.getText().trim(),selectedItem.toString(),days.getText().trim(),fk.getText().trim()); if(i==1) { JOptionPane.showMessageDialog(null,”修改成功"); object[][] results=getFileStates(Business.selectBookCategory()); model.setDataVector(results.columnNames); } } } table.setModel(model); 环植学院深入开展创先争优活动实施方案 为贯彻落实中共中央、海南省委、省委教育工委及学校党委“关于在党的基层组织和党员中深入开展创先争优活动”的决定,根据相关文件精神,结合我院实际,特制定如下实施方案。 一、总体要求 根据上级党组织要求,以邓小平理论和“三个代表”重要思想为指导,以深入学习实践科学发展观、实现海南大学又好又快发展为主题,以加快“211工程”建设、促进新海大转型升级为载体,以树立优良校风学风和立足岗位奉献为重点,坚持服务学校教学科研和建设发展大局,振奋精神,改革创新,讲求实效,统筹推进党的建设及其他经常性工作,充分发挥基层党组织的战斗堡垒作用和共产党员的先锋模范作用,在推动科学发展、构建和谐校园、服务师生员工、加强基层组织以及服务海南国际旅游岛建设的实践中建功立业。 通过开展创先争优活动,整体提高学院各级党组织和党员队伍建设水平,树立一批充分发挥战斗堡垒作用、先锋模范作用的先进党支部和优秀共产党员,为学校顺利完成“211工程”项目建设、实现转型升级,进而更好地服务海南国际旅游岛建设提供坚强的政治保证和组织保证。 二、主要内容 创先争优活动的主要内容:创建先进基层党组织、争当优秀共产党员。 1、先进基层党组织的基本要求:建设学习型党组织,努力做到“五个好”: 一是领导班子好。深入学习实践科学发展观,全面贯彻党的教育方针,认真落实党建工作责任制,团结协作,求真务实,勤政廉洁,有较强的凝聚力、战斗力和创造力。二是党员队伍好。重视教职工党员的发展和教育,党员素质优良、党员意识较强、精神面貌良好,切实发挥先锋模范作用。三是工作机制好。围绕学院改革发展开展形式多样党建活动,规章制度健全完善,管理措施到位,长效机制建立务实有效。四是工作业绩好。在开展“211工程”项目建设、深化教育教学改革、推进学校各项事业中强化党的政治领导,围绕中心、服务大局,解决问题、促进发展,改革创新、成效明显。五是群众反映好。尊重爱护师生,为师生办实事;工作措施符合师生意愿,工作作风和工作实绩师生满意度高,党组织得到师生拥护,党群干群关系密切。 学生党支部主要突出“三个好”:党员培育好。能积极、有效做好大学生党员的发展、教育和管理工作,引导广大学生树立坚定的共产主义理想和信念;组织活动好。经常组织开展健康向上、丰富多样的支部活动,支部建设充满活力;发挥作用好。能较好地发挥支部的战斗堡垒作用,以党建带团建,以党建促进其他学生组织的健康发展和优良学风、班风、校风的形成,维护校园安全稳定,在学生中具有较强的感召力。 2、优秀共产党员的基本要求:模范履行党章规定的义务,努力争当“五个模范”。教工党员要争当:(1)学习钻研的模范。认真学习实践科学发展观,刻苦钻研业务知识,努力提高自身的党性修养和能力水平,成为热爱学习、学会学习和终身学习的楷模;(2)岗位奉献的模范。忠诚于党的教育事业,具有强烈的事业心、责任感,爱岗敬业,勇挑重担,在教学、科研、管理或服务岗位上做出显著业绩;(3)为人师表的模范。养成求真务实和严谨自律的治学态度,树立高尚的道德情操和精神追求,教书育人、管理育人、服务育人,言传身教,甘为人梯,以大德树良师形象;(4)团结协作的模范。热爱集体,服务师生,团结友爱,坚决维护集体荣誉。树立大局意识和团队精神,以团队协作争创教学、科研的高层次成果,提升单位的整体管理、服务水平;(5)遵纪守法的模范。自觉遵守党的纪律,带头遵守国家法律法规及学校各项规章制度,坚持原则,弘扬正气,敢于同不良风气、违纪违法行为作斗争。 学生党员要争当努力学习的模范、实践创新的模范、自强自立的模范、尊师爱友的模范、遵纪守法的模范,努力使自己成为志向远大、品德高尚、知识丰富、能力较强的高素质的优秀学生。 三、方法步骤 按照上级组织要求,创先争优活动通过公开承诺、领导点评、群众评议、评选表彰的方式,围绕迎接建党90周年、向党的十八大献礼两个重大节点推进展开。本次活动期间跨度2010-2012年的三个学年、六个学期。整个活动分四个步骤进行。 (一)动员部署、学习准备阶段(2010年4月—6月底)。主要抓好四项工作: 1、动员部署。学院党委召开动员大会,进行工作部署。 2、制定方案。学院党委围绕学校创先争优活动的主题、载体、重点和总体要求,从本单位实际情况出发,制定切实可行的活动实施方案;党员要围绕党性修养、作风养成、履行职责、岗位奉献等方面提出参加活动的具体打算。学院党委、党支部的活动方案和党员个人的具体打算要采取会议、网络、活动专栏等方式向群众公布,重点做出承-2- 诺,接受群众监督。 3、组织学习。各党支部组织党员认真学习胡锦涛总书记在全党深入学习实践科学发展观活动总结大会上的重要讲话及学校相关文件精神,统一思想认识,积极投入到创先争优活动中来。 4、党性分析。各党支部在2010年春季学期结束前,集中一周时间,组织党员进行一次党性分析,在职党员应撰写党性分析报告,并组织群众对党员进行评议。 (二)全面创争、扎实推进阶段(2010年9月—2011年6月底)。学院党委、党支部和党员根据实施方案和个人具体打算,紧密结合实际工作,认真扎实、机动灵活地开展创先争优活动。具体围绕几项主题活动展开: 1、“师德教育”活动。在教师节前后,对教职工党员普遍进行师德师风教育,对学生党员进行优良校风学风教育,促使一批优秀共产党员成为“三育人”标兵、师德标兵或学生标兵。 2、“岗位奉献”活动。从新学期开学开始,配合学校开展“211”建设先锋、新海大创建标兵、海大之星等推选评比活动。 3、“服务群众”活动。各党支部组织党员走向基层、走向社会,开展志愿服务、结对帮扶、走访慰问等活动;合理利用寒暑假时间,搞好调查研究和社会服务,使党员在联系基层、奉献社会的过程中增强责任感、使命感。 4、“亮牌示范”活动。通过设置党员先锋岗、示范岗或挂牌上岗等形式,树立党员形象,促使党员发挥骨干、先锋模范作用。 5、“强基创先”活动。优化组织设置,创新组织形式和活动方式,加强党组织班子、制度建设,强化组织功能,推动创新发展,真正发挥学院党组织的政治保证、战斗堡垒作用,努力提高学院党组织建设的科学化水平。 2011年“七一”前,向学校党委推荐表彰先进党组织、优秀共产党员和优秀党务工作者。 (三)典型带动、全面提升阶段(2011年9月—2012年6月底)。充分发挥先进典型的示范带动作用,全面提升活动的整体工作水平。主要抓好三项工作: 1、树立先进典型。学校将确定一批“五个好”先进基层党组织和“五个模范”优秀党员、优秀党务工作者,采取组织先进典型报告会、观摩学习、宣传报道等形式,扩大先进典型影响力。 2、开展向先进典型学习活动。各党支部和全体党员,都要对照先进典型,对照目标要求和岗位职责,查找自身差距,明确努力方向,制定跟进、赶超的具体措施。 3、实施全面提升工程。对照总体要求,着眼全面提升,进一步加强党组织建设,促进提升“五个好”先进基层党组织和“五个模范”优秀党员、优秀党务工作者的比例。 2012年“七一”前,学校将根据上级组织部署,推荐表彰“2010—2012年创先争优活动”先进基层党组织、优秀共产党员、优秀党务工作者。 (四)回顾总结、完善机制阶段(2012年9月——党的十八大召开前)。围绕向党的十八大献礼,这一阶段重点抓好四项工作: 1、展示成果。配合学校开展集中展示活动成果活动。 2、搞好总结。学院党委对开展创先争优活动进行系统总结,认真总结经验、查找不足,进一步研究制定改进措施。 3、考核评议。学校党委对学院党委、党支部、党员开展创先争优活动情况进行考核,并采取适当方式组织党员、群众进行评议。 4、完善机制。对开展创先争优活动中行之有效的科学做法用制度的形式固定下来,形成创先争优的长效机制。 四、组织领导 学院成立创先争优活动领导小组,在校党委指导、院党委领导下开展具体工作。各党支部为活动的落实单位,负责具体的学习、党内分析、主题活动、总结评议等工作。 1、领导小组成员包括:组长:沈秀清;副组长:崔昌华;成员:全体党委委员、综合办主任、各党支部书记。 2、按照校党委的要求,学院创先争优活动要坚持服务大局,围绕科教中心工作、密切联系群众、经常性为主的原则,并努力形成学习先进、崇尚先进、争当先进的活动氛围和风气。 3、各党支部要组织好各项具体工作,结合实际,力求实效,以创先争优活动的成果推进学院党的建设和各项工作,促进学院又好又快发展。 环境与植物保护学院党委 2010年5月31日 Borbook: Public sqltxt As String Public rno As String '保存读者借书证号 Public bno As String '保存读者图书编号 Public xm As String '保存读者姓名 Public dw As String '保存读者单位 Public rs As ADODB.Recordset Private Sub Comm1_Click() rno = Trim(Text1(0).Text) If rno = “" Then MsgBox ”借书证号不能为空,请输入“, vbOKOnly, ”信息提示“ Comm2.Enabled = False Else sqltxt = ”select * from reader where 借书证号='“ + rno + ”'“ Set rs = exesql(sqltxt) If rs.RecordCount = 0 Then MsgBox ”该读者未登记,不能借书“, vbOKOnly, ”信息提示“ Comm2.Enabled = False Else Text2(0).Text = rs.Fields(”姓名“) Text2(1).Text = str(rs.Fields(”借书总数“)) Text2(2).Text = str(rs.Fields(”借书总数“)rs.Fields(”已借书数“)) End If End If End If End Sub Private Sub retCom_Click() Unload Me End Sub Private Sub Form_Load() Comm2.Enabled = False End Sub Edbook: Private Sub DataGrid1_Click() End Sub Private Sub Form_Load() '说明:为什么使用recs,而不直接使用adodc1.recordset.recordcount?在调用edbook1窗体添加一个记录(确定)后,再 '返回到本表单,若不在Form_Activate()事件过程中调用adodc1.refresh进行刷新,adodc1.recordset.recordcount值 '仍未增1,这样调用encomm过程时出错;若在Form_Activate()事件过程中调用adodc1.refresh进行刷新,'adodc1.recordset.recordcount值增1了,调用encomm过程时也正确,但返回本窗体时,当前行总是第一行,显然也不行,'因为用户在添加或修改后希望在datagrid1中显示当前操作的那条记录.recs = Adodc1.Recordset.RecordCount End Sub Private Sub Form_Activate() DataGrid1.SetFocus Call encomm End Sub Private Sub Comm1_Click() flag = 1 edbook1.Show vbModal End Sub Private Sub Comm2_Click() flag = 2 edbook1.Show vbModal End Sub Private Sub Comm3_Click() If MsgBox(”真的要删除[“ + Trim(Adodc1.Recordset.Fields(”书名“))+ ”]吗?“, vbYesNo, ”信息提示“)= vbYes Then Adodc1.Recordset.Delete recs = recs1 Call encomm End If End Sub Private Sub Comm4_Click() Unload Me End Sub Private Sub encomm() If recs = 0 Then Comm2.Enabled = False Comm3.Enabled = False Else Comm2.Enabled = True Comm3.Enabled = True End If End Sub Edlev1: Dim cond As String Private Sub Form_Load() If flag = 2 Then Text1(0).Text = edlev.Adodc1.Recordset.Fields(”级别“) Text1(1).Text = edlev.Adodc1.Recordset.Fields(”过期罚款“) Text1(2).Text = edlev.Adodc1.Recordset.Fields(”借书总数“) Text1(3).Text = edlev.Adodc1.Recordset.Fields(”借书天数“) End If End Sub Private Sub Comm1_Click() If Trim(Text1(0).Text)= ”“ Or Trim(Text1(1).Text)= ”“ Or Trim(Text1(2).Text)= ”“ Or _ Trim(Text1(3).Text)= ”“ Then MsgBox ”数据项不全,请重新设置“, vbOKOnly, ”信息提示“ Text1(0).SetFocus Exit Sub End If If flag = 1 Then '添加操作 If edlev.Adodc1.Recordset.RecordCount > 0 Then '原记录个数大于0 cond = ”级别='“ + Trim(Text1(0).Text)+ ”'“ edlev.Adodc1.Recordset.MoveFirst '每次从头开始查找 edlev.Adodc1.Recordset.Find(cond) If Not edlev.Adodc1.Recordset.EOF()Then MsgBox ”存在完全相同的记录“, vbOKOnly, ”信息提示“ Text1(0).SetFocus Exit Sub End If End If edlev.Adodc1.Recordset.AddNew edlev.Adodc1.Recordset.Fields(”级别“)= Trim(Text1(0).Text) edlev.Adodc1.Recordset.Fields(”过期罚款“)= Val(Trim(Text1(1).Text)) edlev.Adodc1.Recordset.Fields(”借书总数“)= Val(Trim(Text1(2).Text)) edlev.Adodc1.Recordset.Fields(”借书天数“)= Val(Trim(Text1(3).Text)) edlev.Adodc1.Recordset.Update recs = recs + 1 Else '修改操作 n = edlev.Adodc1.Recordset.AbsolutePosition cond = ”级别='“ + Trim(Text1(0).Text)+ ”'“ edlev.Adodc1.Recordset.MoveFirst '每次从头开始查找 edlev.Adodc1.Recordset.Find(cond) If Not edlev.Adodc1.Recordset.EOF()And edlev.Adodc1.Recordset.AbsolutePosition <> n Then MsgBox ”存在完全相同的记录“, vbOKOnly, ”信息提示“ edlev.Adodc1.Recordset.MoveFirst '这两个语句恢复原记录位置 edlev.Adodc1.Recordset.Move(n1) edlev.Adodc1.Recordset.Fields(”级别“)= Trim(Text1(0).Text) edlev.Adodc1.Recordset.Fields(”过期罚款“)= Val(Trim(Text1(1).Text)) edlev.Adodc1.Recordset.Fields(”借书总数“)= Val(Trim(Text1(2).Text)) edlev.Adodc1.Recordset.Fields(”借书天数“)= Val(Trim(Text1(3).Text)) edlev.Adodc1.Recordset.Update End If Unload Me End Sub Private Sub Comm2_Click() Unload Me End Sub Edreader: Private Sub DataGrid1_Click() End Sub Private Sub Form_Load() recs = Adodc1.Recordset.RecordCount End Sub Private Sub Form_Activate() DataGrid1.SetFocus Call encomm End Sub Private Sub Comm1_Click() flag = 1 edreader1.Show vbModal End Sub Private Sub Comm2_Click() flag = 2 edreader1.Show vbModal End Sub Private Sub Comm3_Click() If MsgBox(”真的要删除[“ + Trim(Adodc1.Recordset.Fields(”姓名“))+ ”]吗?“, vbYesNo, ”信息提示“)= vbYes Then Adodc1.Recordset.Delete recs = recs1 Call encomm End If End Sub Private Sub Comm4_Click() Adodc1.Recordset.UpdateBatch Adodc1.Recordset.Close Unload Me End Sub Private Sub encomm() If recs = 0 Then Comm2.Enabled = False Comm3.Enabled = False Else Comm2.Enabled = True Comm3.Enabled = True End If End Sub Edrec1: Dim cond As String Private Sub Form_Load() Label1.Caption = cap If flag = 1 Then Text1.Text = ”“ Else Text1.Text = edrec.Adodc1.Recordset.Fields(”fn“) End If End Sub Private Sub Comm1_Click() If Trim(Text1.Text)= ”“ Then MsgBox ”数据项不能为空,请重新设置“, vbOKOnly, ”信息提示“ Text1.SetFocus Exit Sub End If If flag = 1 Then '添加操作 If edrec.Adodc1.Recordset.RecordCount > 0 Then '原记录个数大于0 cond = ”fn='“ + Trim(Text1.Text)+ ”'“ edrec.Adodc1.Recordset.MoveFirst '每次从头开始查找 edrec.Adodc1.Recordset.Find(cond) If Not edrec.Adodc1.Recordset.EOF()Then MsgBox ”存在完全相同的记录“, vbOKOnly, ”信息提示“ Text1.SetFocus Exit Sub End If End If edrec.Adodc1.Recordset.AddNew edrec.Adodc1.Recordset.Fields(”fn“)= Trim(Text1.Text) edrec.Adodc1.Recordset.Update recs = recs + 1 Else '修改操作 n = edrec.Adodc1.Recordset.AbsolutePosition cond = ”fn='“ + Trim(Text1.Text)+ ”'“ edrec.Adodc1.Recordset.MoveFirst '每次从头开始查找 edrec.Adodc1.Recordset.Find(cond) If Not edrec.Adodc1.Recordset.EOF()And edrec.Adodc1.Recordset.AbsolutePosition <> n Then MsgBox ”存在完全相同的记录“, vbOKOnly, ”信息提示“ edrec.Adodc1.Recordset.MoveFirst '这两个语句恢复原记录位置 edrec.Adodc1.Recordset.Move(n1) edrec.Adodc1.Recordset.Fields(”fn“)= Trim(Text1.Text) edrec.Adodc1.Recordset.Update End If Unload Me End Sub Private Sub Comm2_Click() Unload Me End Sub Menu: Private Sub MDIForm_Load() If Not userlevel = ”系统管理员“ Then menu21.Enabled = False menu31.Enabled = False menu41.Enabled = False menu42.Enabled = False End If End Sub Private Sub menu11_Click() borbook.Show vbModal End Sub Private Sub menu12_Click() retbook.Show vbModal End Sub Private Sub menu13_Click() End End Sub Private Sub menu21_Click() edbook.Show vbModal End Sub Private Sub menu22_Click() qubook.Show vbModal End Sub Private Sub menu31_Click() edreader.Show vbModal End Sub Private Sub menu32_Click() qureader.Show vbModal End Sub Private Sub menu41_Click() setuser.Show vbModal End Sub Private Sub menu42_Click() If MsgBox(”本功能要清除系统中所有数据,真的初始化吗?“, vbYesNo, ”确认初始化操作“) = vbYes Then Call deldata(”book“)Call deldata(”reader“)Call deldata(”borrow“)Call deldata(”rlevel“) Call deldata(”depart“) Call deldata(”press“) Call deldata(”oper“) MsgBox ”系统初始化完毕,下次只能以1234/1234(用户名/口令)进入本系统“, vbOKOnly, ”信息提示“ End If End Sub Pass: Public n As Integer Private Sub Command1_Click() Dim mrc As ADODB.Recordset txtsql = ”select * from oper where 用户名='“ & _ Trim$(Text1(0).Text)& ”'“ & ” And 口令 = '“ & Trim$(Text1(1).Text)+ ”'“ Set mrc = exesql(txtsql) If mrc.RecordCount = 0 Then '未找到用户记录 n = n + 1 If n < 3 Then MsgBox ”没有这个用户,继续登录“, vbOKOnly + vbExclamation, ”信息提示“ Text1(0).Text = ”“ Text1(1).Text = ”“ Text1(0).SetFocus Else MsgBox ”已登录失败三次,退出系统“, vbOKOnly + vbExclamation, ”信息提示“ mrc.Close Unload Me End If Else '找到合法用户记录 userlevel = Trim(mrc.Fields(”级别“)) mrc.Close Unload Me menu.Show '调用menu窗体 End If End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() n = 0 'n保存登录的次数 End Sub Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) Call endata(KeyAscii)End Sub Qubook: Private Sub Comm1_Click() Dim sqltxt As String If Adodc1.Recordset.Fields(”借否“)= ”借“ Then no = Trim(Adodc1.Recordset.Fields(”图书编号“)) sqltxt = ”select * from borrow where 图书编号='“ + no + ”'“ Set rs = exesql(sqltxt) If rs.RecordCount = 0 Then MsgBox ”该图书没有借书记录“, vbOKOnly, ”信息提示“ Else MsgBox ”图书编号:“ + no + Chr(10)+ Chr(13)+ _ ”书 名:“ + Trim(rs.Fields(”书名“))+ Chr(10)+ Chr(13)+ _ ”借 书 人:“ + Trim(rs.Fields(”姓名“))+ Chr(10)+ Chr(13)+ _ ”单 位:“ + Trim(rs.Fields(”单位“))+ Chr(10)+ Chr(13)+ _ ”借书日期:“ + Format(rs.Fields(”借书日期“), ”yyyy.mm.dd“), vbOKOnly, ”查找结果“ End If rs.Close Else MsgBox ”该书没有外借,不能显示借书人“, vbOKOnly, ”信息提示“ End If End Sub Private Sub Comm2_Click() Unload Me End Sub Private Sub Form_Activate() Adodc1.Refresh DataGrid1.Refresh DataGrid1.SetFocus Call encomm End Sub Private Sub selcmd1_Click()'设置条件确定 Dim str As String str = ”“ '条件表达式 If Trim(Text1(0).Text)<> ”“ Then If str = ”“ Then str = ”图书编号='“ + Trim(Text1(0).Text)+ ”'“ Else str = str + ” and 图书编号='“ + Trim(Text1(0).Text)+ ”'“ End If End If If Trim(Text1(1).Text)<> ”“ Then If str = ”“ Then str = ”书名='“ + Trim(Text1(1).Text)+ ”'“ Else str = str + ” and 书名='“ + Trim(Text1(1).Text)+ ”'“ End If End If If Trim(Text1(2).Text)<> ”“ Then If str = ”“ Then str = ”作者='“ + Trim(Text1(2).Text)+ ”'“ Else str = str + ” and 作者='“ + Trim(Text1(2).Text)+ ”'“ End If End If If Trim(Text1(3).Text)<> ”“ Then If str = ”“ Then str = ”出版社='“ + Trim(Text1(3).Text)+ ”'“ Else str = str + ” and 出版社='“ + Trim(Text1(3).Text)+ ”'“ End If End If If Trim(Text1(4).Text)<> ”“ Then If str = ”“ Then str = ”借否='“ + Trim(Text1(4).Text)+ ”'“ Else str = str + ” and 借否='“ + Trim(Text1(4).Text)+ ”'“ End If End If If Trim(Text1(5).Text)<> ”“ Then If str = ”“ Then str = ”定价=“ + Trim(Text1(5).Text) Else str = str + ” and 定价=“ + Trim(Text1(5).Text) End If End If If str <> ”“ Then Adodc1.RecordSource = ”select * from book where “ + str Adodc1.Refresh Else Adodc1.RecordSource = ”select * from book“ Adodc1.Refresh End If If Adodc1.Recordset.RecordCount = 0 Then MsgBox ”没有任何满足条件的记录“, vbOKOnly, ”信息提示“ End If Call encomm End Sub Private Sub selcmd2_Click()'设置条件重置 Text1(0).Text = ”“ Text1(1).Text = ”“ Text1(2).Text = ”“ Text1(3).Text = ”“ Text1(4).Text = ”“ Text1(5).Text = ”“ End Sub Private Sub encomm()'自定义子过程:判断Adodc1中是否存在记录 If Adodc1.Recordset.RecordCount = 0 Then Comm1.Enabled = False Else Comm1.Enabled = True End If End Sub Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) Call endata(KeyAscii)End Sub Qureader: Private Sub Comm1_Click() Dim strn As String Dim sqltxt As String no = Trim(Adodc1.Recordset.Fields(”借书证号“)) sqltxt = ”select * from borrow where 借书证号='“ + no + ”'“ Set rs = exesql(sqltxt) If rs.RecordCount = 0 Then MsgBox ”该读者没有借任何图书“, vbOKOnly, ”信息提示“ Else rs.MoveFirst strn = ”书 名(借书日期)“ + Chr(10)+ Chr(13) Do While Not rs.EOF() strn = strn & Trim(rs.Fields(”书名“))& ”(“ & Format(rs.Fields(”借书日期“), ”yyyy.mm.dd“)& ”)“ + Chr(10)+ Chr(13) rs.MoveNext Loop MsgBox strn, vbOKOnly, ”列所借图书清单“ rs.Close End If End Sub Private Sub Comm2_Click() Unload Me End Sub Private Sub Form_Activate() Adodc1.Refresh DataGrid1.Refresh DataGrid1.SetFocus Call encomm End Sub Private Sub selcmd1_Click()'设置条件确定 Dim str As String str = ”“ '条件表达式 If Trim(Text1(0).Text)<> ”“ Then If str = ”“ Then str = ”借书证号='“ + Trim(Text1(0).Text)+ ”'“ Else str = str + ” and 借书证号='“ + Trim(Text1(0).Text)+ ”'“ End If End If If Trim(Text1(1).Text)<> ”“ Then If str = ”“ Then str = ”姓名='“ + Trim(Text1(1).Text)+ ”'“ Else str = str + ” and 姓名='“ + Trim(Text1(1).Text)+ ”'“ End If End If If Trim(Text1(2).Text)<> ”“ Then If str = ”“ Then str = ”单位='“ + Trim(Text1(2).Text)+ ”'“ Else str = str + ” and 单位='“ + Trim(Text1(2).Text)+ ”'“ End If End If If Trim(Text1(3).Text)<> ”“ Then If str = ”“ Then str = ”级别='“ + Trim(Text1(3).Text)+ ”'“ Else str = str + ” and 级别='“ + Trim(Text1(3).Text)+ ”'“ End If End If If Trim(Text1(4).Text)<> ”“ Then If str = ”“ Then str = ”性别='“ + Trim(Text1(4).Text)+ ”'“ Else str = str + ” and 性别='“ + Trim(Text1(4).Text)+ ”'“ End If End If If str <> ”“ Then Adodc1.RecordSource = ”select * from reader where “ + str Adodc1.Refresh Else Adodc1.RecordSource = ”select * from reader“ Adodc1.Refresh End If If Adodc1.Recordset.RecordCount = 0 Then MsgBox ”没有任何满足条件的记录“, vbOKOnly, ”信息提示“ End If Call encomm End Sub Private Sub selcmd2_Click()'设置条件重置 Text1(0).Text = ”“ Text1(1).Text = ”“ Text1(2).Text = ”“ Text1(3).Text = ”“ Text1(4).Text = ”“ End Sub Private Sub encomm()'自定义子过程:判断Adodc1中是否存在记录 If Adodc1.Recordset.RecordCount = 0 Then Comm1.Enabled = False Else Comm1.Enabled = True End If End Sub Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) Call endata(KeyAscii)End Sub Retbook: Public rno As String Public bno As String Private Sub Comm1_Click() bno = Trim(Text1.Text) If bno <> ”“ Then Dim sqltxt As String sqltxt = ”select * from borrow where 图书编号='“ + bno + ”'“ Set brs = exesql(sqltxt) If brs.RecordCount = 0 Then MsgBox ”该书不是从本图书馆所借的,不能归还!“, vbOKOnly, ”信息提示“ Else If Trim(brs.Fields(”借书证号“))<> rno Then If rno <> ”“ Then '另一读者还书,自动列出上一个还书人的罚款单 dstr = ”罚款单“ + Chr(10)+ Chr(13) dstr = dstr & ”姓名:“ & Trim(Text2(1).Text)+ ”(“ + rno + ”)罚款总额:“ & str(Text2(4).Text)& ”元“ MsgBox dstr, vbOKOnly, ”列罚款单“ End If rno = Trim(brs.Fields(”借书证号“)) sqltxt = ”select * from book where 图书编号='“ + bno + ”'“ '处理图书记录 Set bs = exesql(sqltxt) bs.Fields(”借否“)= ”否“ bs.Update sqltxt = ”select * from reader where 借书证号='“ + rno + ”'“ '处理读者记录 Set rs = exesql(sqltxt) rs.Fields(”已借书数“)= rs.Fields(”已借书数“)rs.Fields(”已借书数“) If(Datebrs.Fields(”借书日期“)1 rs.Update If(Datebrs.Fields(”借书日期“)1 Call encomm End If End Sub Private Sub Comm4_Click() Unload Me End Sub Private Sub encomm() If recs = 0 Then Comm2.Enabled = False Comm3.Enabled = False Else Comm2.Enabled = True Comm3.Enabled = True End If End Sub Setuser1: Dim cond As String Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys ”{TAB}“ End If End Sub Private Sub Form_Load() If flag = 2 Then Text1(0).Text = setuser.Adodc1.Recordset.Fields(”用户名“) Text1(1).Text = setuser.Adodc1.Recordset.Fields(”口令“) Combo1.Text = setuser.Adodc1.Recordset.Fields(”级别“) End If End Sub Private Sub Comm1_Click() If Trim(Text1(0).Text)= ”“ Or Trim(Text1(1).Text)= ”“ Or Trim(Combo1.Text)= ”“ Then MsgBox ”数据项不全,请重新设置“, vbOKOnly, ”信息提示“ Text1(0).SetFocus Exit Sub End If If flag = 1 Then '添加操作 If setuser.Adodc1.Recordset.RecordCount > 0 Then '原记录个数大于0 cond = ”级别='“ + Trim(Text1(0).Text)+ ”'“ setuser.Adodc1.Recordset.MoveFirst '每次从头开始查找 setuser.Adodc1.Recordset.Find(cond) If Not setuser.Adodc1.Recordset.EOF()Then MsgBox ”存在完全相同的记录“, vbOKOnly, ”信息提示“ Text1(0).SetFocus Exit Sub End If End If setuser.Adodc1.Recordset.AddNew setuser.Adodc1.Recordset.Fields(”用户名“)= Trim(Text1(0).Text) setuser.Adodc1.Recordset.Fields(”口令“)= Val(Trim(Text1(1).Text)) setuser.Adodc1.Recordset.Fields(”级别“)= Trim(Combo1.Text) setuser.Adodc1.Recordset.Update recs = recs + 1 Else '修改操作 n = setuser.Adodc1.Recordset.AbsolutePosition cond = ”级别='“ + Trim(Text1(0).Text)+ ”'“ setuser.Adodc1.Recordset.MoveFirst '每次从头开始查找 setuser.Adodc1.Recordset.Find(cond) If Not setuser.Adodc1.Recordset.EOF()And setuser.Adodc1.Recordset.AbsolutePosition <> n Then MsgBox ”存在完全相同的记录“, vbOKOnly, ”信息提示“ setuser.Adodc1.Recordset.MoveFirst '这两个语句恢复原记录位置 setuser.Adodc1.Recordset.Move(n1) setuser.Adodc1.Recordset.Fields(”用户名“)= Trim(Text1(0).Text) setuser.Adodc1.Recordset.Fields(”口令“)= Val(Trim(Text1(1).Text)) setuser.Adodc1.Recordset.Fields(”级别“)= Trim(Combo1.Text) setuser.Adodc1.Recordset.Update End If Unload Me End Sub Private Sub Comm2_Click() Unload Me End Sub Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) Call endata(KeyAscii)End Sub 模块: Public userlevel As String '保存用户级别 Public flag As Integer '用作记录操作标记 Public tna As String '保存表名:用于调用edrec1窗体 Public cap As String '保存标题名:用于调用edrec1窗体 Public recs As Integer '保存记录集中记录个数 Sub main() pass.Show vbModal End Sub Public Function exesql(ByVal sql As String)As ADODB.Recordset sql = Trim$(sql) Set conn = New ADODB.Connection Set rst = New ADODB.Recordset conn.ConnectionString = ”DSN=Library;UID=sa;PWD=;“ conn.Open Set rst.ActiveConnection = conn rst.LockType = adLockOptimistic rst.CursorType = adOpenKeyset rst.Open sql Set exesql = rst Set rst = Nothing Set conn = Nothing End Function Public Sub deldata(ByVal tn As String)删除指定表中所有记录,对于oper表添加一个系统用户 Dim sql As String sql = ”delete “ & Trim$(tn) Set conn = New ADODB.Connection conn.ConnectionString = ”DSN=Library;UID=sa;PWD=;“ conn.Open conn.Execute sql If Trim(tn)= ”oper“ Then sql = ”insert oper values('1234','1234','系统管理员')“ conn.Execute sql End If conn.Close End Sub Public Sub endata(Keyasc As Integer) If Keyasc = 13 Then SendKeys ”{TAB}" '将回车键转换成Tab键 End If End Sub using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq; namespace WebApplication1 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){ } protected void Button1_Click(object sender, EventArgs e){ Response.Redirect(“~/登录.aspx”); } protected void Button2_Click(object sender, EventArgs e){ Response.Redirect(“~/人员信息查询.aspx”);} protected void Button3_Click(object sender, EventArgs e){ Response.Redirect(“~/人员修改.aspx”);} protected void Button4_Click(object sender, EventArgs e){ Response.Redirect(“~/部门信息.aspx”);} protected void Button5_Click(object sender, EventArgs e){ Response.Redirect(“~/工资信息.aspx”);} } } using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;namespace WebApplication1 { public partial class 部门信息 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){ } protected void Button1_Click(object sender, EventArgs e){ bool find =false;SqlConnection con=new SqlConnection(“server=localhost;Integrated Security=SSPI;database=人事管理系统”);con.Open();string cmdstr=“select * from 部门表”;SqlDataAdapter da=new SqlDataAdapter(cmdstr,con);DataSet ds=new DataSet();da.Fill(ds);for(int i=0;i TextBox2.Text=ds.Tables[0].Rows[i][“部门代码”].ToString();TextBox3.Text=ds.Tables[0].Rows[i][“部门名称”].ToString(); find=true;} } } if(find == false){ Response.Write(“”);con.Close();} } protected void Button2_Click(object sender, EventArgs e){ Response.Redirect(“~/Default.aspx”);} } } using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.Data.SqlTypes;namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){ } protected void TextBox1_TextChanged(object sender, EventArgs e){ } protected void Button1_Click(object sender, EventArgs e){ SqlConnection con = new SqlConnection(“server=localhost;Integrated Security=SSPI;database=人事管理系统”); string strCount;strCount = “select * from 人事表”;con.Open();SqlCommand com = new SqlCommand(strCount, con);SqlDataReader dr = com.ExecuteReader();string strUsername = “", strPassword = ”“; while(dr.Read()){ if(TextBox1.Text == dr[”编号“].ToString()||TextBox2.Text == dr[”用户密码“].ToString()){ strUsername = dr[”编号“].ToString();strPassword = dr[”用户密码“].ToString();break;} } dr.Close();con.Close();if(strUsername == ”“){ Response.Write(”“);return;} } protected void Button2_Click(object sender, EventArgs e){ Response.Redirect(”~/Default.aspx“); } } } using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient; namespace WebApplication1 { public partial class 工资信息 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){ } protected void TextBox2_TextChanged(object sender, EventArgs e){ } protected void TextBox5_TextChanged(object sender, EventArgs e){ } protected void Button1_Click(object sender, EventArgs e){ bool find = false;SqlConnection con = new SqlConnection(”server=localhost;Integrated Security=SSPI;database=人事管理系统“);con.Open();string cmdstr = ”select * from 工资表“;SqlDataAdapter da = new SqlDataAdapter(cmdstr, con);DataSet ds = new DataSet();da.Fill(ds);for(int i = 0;i < ds.Tables[0].Rows.Count;i++){ for(int j = 0;j < ds.Tables[0].Columns.Count;j++){ String data =(ds.Tables[0].Rows[i][j].ToString()).Trim();if(data == TextBox1.Text.Trim()){ TextBox2.Text = ds.Tables[0].Rows[i][”应发工资“].ToString();TextBox3.Text = ds.Tables[0].Rows[i][”岗位津贴“].ToString();TextBox4.Text = ds.Tables[0].Rows[i][”奖励“].ToString();TextBox5.Text = ds.Tables[0].Rows[i][”保险“].ToString(); find = true;} } } if(find == false){ Response.Write(”“);con.Close();} } protected void Button2_Click(object sender, EventArgs e){ Response.Redirect(”~/Default.aspx“);} } } using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;namespace WebApplication1 { public partial class 人员信息 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){ } protected void Button1_Click(object sender, EventArgs e){ Response.Redirect(”~/Default.aspx“);} protected void Button2_Click(object sender, EventArgs e){ bool find =false;SqlConnection con = new SqlConnection(”server=localhost;Integrated Security=SSPI;database=人事管理系统“);con.Open();string cmdstr=”select * from 工资表“;SqlDataAdapter da=new SqlDataAdapter(cmdstr,con);DataSet ds=new DataSet();da.Fill(ds);for(int i=0;i TextBox2.Text=ds.Tables[0].Rows[i][”应发工资“].ToString();TextBox3.Text=ds.Tables[0].Rows[i][”岗位津贴“].ToString();TextBox4.Text=ds.Tables[0].Rows[i][”奖励“].ToString();TextBox5.Text = ds.Tables[0].Rows[i][”保险“].ToString(); find=true;} } } if(find == false){ Response.Write(”“);con.Close();} } } } using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;namespace WebApplication1 { public partial class 人员修改 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){ } protected void TextBox5_TextChanged(object sender, EventArgs e){ } protected void Button2_Click(object sender, EventArgs e){ SqlConnection con=new SqlConnection(”server=localhost;Integrated Security=SSPI;database=人事管理系统“);con.Open();string insert=”insert into 人事表(员工号,姓名,性别,职称,学历)values(“+”“+ TextBox1.Text.Trim()+”“+”,“+”“ + TextBox2.Text.Trim()+”“+”,“+ TextBox3.Text.Trim()+ ”,“ +”“+ TextBox4.Text.Trim()+”“+”,“+”“ +TextBox5.Text.Trim()+ ”“+”)“;Response.Write(insert);SqlCommand cmd1=new SqlCommand(insert,con); con.Close();} protected void Button1_Click(object sender, EventArgs e){ Response.Redirect(”~/Default.aspx");} protected void GridView1_SelectedIndexChanged(object sender, EventArgs e){ } } } 数据库设计.................................................................2 3.1 专门术语的定义...................................................2 3.1.1 系统中常用的术语(或使用频率较高的术语).........................2 3.1.2 表格定义及规范.................................................2 3.1.2.1数据约定.....................................................2 3.1.2.2表和表字段命名规范:.........................................3 3.2 数据设计.........................................................3 3.2.1 数据流程图设计.................................................3 3.2.2实体关系结构设计...............................................4 3.3安全保密设计.....................................................6 3.3.1 逻辑上的安全保密...............................................6 3.3.2 物理上的安全保密...............................................6 3.4 表格与功能模块相关性分析.........................................7 3.5 表格定义.........................................................7 数据库设计 3.1 专门术语的定义 暂无 3.1.1 系统中常用的术语(或使用频率较高的术语)暂无 3.1.2 表格定义及规范 3.1.2.1数据约定 所有数据项都用英文、汉语拼音或缩写表示,数据库名称除外。 所有字段在设计时,除以下数据类型timestamp、image、datetime、smalldatetime、uniqueidentifier、binary、sql_variant、binary、varbinary外,必须有默认值。字符型的默认值为一个空字符值串;数值型的默认值为数值0;逻辑型的默认值为数值0; 其中:系统中所有逻辑型中数值0表示为“假”;数值1表示为“真”。datetime、smalldatetime类型的字段没有默认值,必须为NULL。当字段定义为字符串形时建议使用varchar而不用nvarchar。建议在大多数表中(如报销单,申请单),应都有以下字段: 字段名说明类型默认值 CreatorID创建者int CreatedTime创建时间DatetimeNULL 字符集采用 UTF-8,请注意字符的转换。 所有数据表第一个字段都是系统内部使用自动序列主键列,自增字段,不可空,名称为:id,确保不把此字段暴露给最终用户。 除特别说明外,所有字符串字段都采用varchar(50)类型,(无论汉字还是英文,都算一个字符)。 除特别说明外,所有小数的字段都采用 decimal(18,2)的形式表达。 除特别说明外,所有日期格式都采用 datetime 格式(根据需要提取时间格式); 除特别说明外,所有整形都采用 bigint 格式。除特别说明外,所有字段默认都设置为 null。3.1.2.2表和表字段命名规范: 命名规则约束的范围包括:数据库的命名、表的命名及字段的命名。数据库相关的命名规则采用与通常的编程的变量命名规则原则一致,具体要求如下: 1)字段名及表名为典型的名词结构; 2)中文名称要求语言精练、文法严谨; 3)望文知意、易懂易用,禁止采用如:A002这种命名; 4)主体采用拼音字母的首写字母拼写构成,基于惯常法可适度采用无词义歧义性的英文命名; 5)长度不少于3个字母,不大于12个字母; 6)在对于拼音首字母类似的字段和表,为区别,添加下划线和数字如男性人数:NXRS,女性人数:NXRS_2。 3.2 数据设计 绘制数据流程图的目的是为了方便开发人员与用户的交流,以及为系统的设计提供依据。数据流程图的绘制过程通常采用自顶向下,逐层分解,直到功能细化为止,形成若干层次的数据流程图。3.2.1 数据流程图设计 0层数据流图 1层数据流图 3.2.2实体关系结构设计 图书实体关系 读者实体关系 图书借阅关系实体 用户实体关系 图书类别实体关系 3.3安全保密设计 3.3.1 逻辑上的安全保密 1、系统对非法使用者的安全保密处理措施 2、系统对正常使用者的安全保密处理措施 3、系统对管理员的安全保密 3.3.2 物理上的安全保密 1、数据库系统异常时的还原处理措施 2、设备遭异常毁坏时的安全防护措施 3、数据参数做到及时更新,保证系统正常运行 3.4 表格与功能模块相关性分析 3.5 表格定义 a.图书信息表 b.读者信息表 c.借阅表 d.管理员_书籍 e.管理员_学生第二篇:图书管理系统源代码
第三篇:vb图书管理系统源代码
第四篇:人事管理系统数据库源代码
第五篇:图书管理系统数据库设计