今天给各位分享正方教务管理系统源码的知识,其中也会对正方教务系统软件进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
跪求c语言教务管理系统源代码
#include stdio.h
#include string.h
#include windows.h
struct student
{
long int num;
char name[20];
int age;
char sex[4];
char b[30];
char p[15];
};
int n=0;
struct student stu[100];
struct student *p;
void lr();
void ll();
void cx();
void xg();
void sc();
void main()
{
int z;
printf("+---------------------------+\n");
printf("| 欢迎使用学生信息管理系统 |\n");
printf("+---------------------------+\n");
printf("提示:为保证您的操作得到保存,请按正常顺序退出系统^_^\n");
do
{
printf("\n\t\t\t--------------------------------\n");
printf("\t\t\t+ 主菜单 |\n");
printf("\t\t\t--------------------------------\n");
printf("\t\t\t+ [1]----录入学生信息 |\n");
printf("\t\t\t+ [2]----浏览学生信息 |\n");
printf("\t\t\t+ [3]----查询学生信息 |\n");
printf("\t\t\t+ [4]----删除学生信息 |\n");
printf("\t\t\t+ [5]----修改学生信息 |\n");
printf("\t\t\t+ [0]----退出系统 |\n");
printf("\t\t\t--------------------------------\n");
printf("请输入您的选择:");
scanf("%d", z);
system("color 2f");
switch(z)
{
case 0 : break;
case 1 :lr();break;
case 2 :ll();break;
case 3 :cx();break;
case 4 :sc();break;
case 5 :xg();break;
default:printf("\n无效选项!");
}
}
while(z!= 0);
}
void lr()/*录入函数*/
{
int y;
if(n==0)
p=stu;
do
{
printf("--------------------\n");
printf("请输入学生的学号:");
scanf("%ld",p-num);
printf("请输入学生的姓名:");
scanf("%s",p-name);
printf("请输入学生的年龄:");
scanf("%d",p-age);
printf("请输入学生的性别:");
scanf("%s",p-sex);
printf("请输入学生的地址:");
scanf("%s",p-b);
printf("请输入学生的电话:");
scanf("%s",p-p);
n++;
p++;
printf("\n1.继续输入.\n0.输入完毕.\n");
printf("请选择:");
scanf("%d",y);
}
while(y==1);
printf("提示:输入完毕!你一共输入%d个\n",n);
}
void ll()/*浏览函数*/
{
int i,j;
if(n!=0)
{ printf("学生总数:%d\n", n);
printf("学号\t姓名\t年龄\t性别\t地址\t\t电话\n");
printf("-----------------------------------------------------\n");
for(i=0;in;i++)
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
}
else printf("提示:无学生数据,请输入数据!");
}
void cx()/*查询函数*/
{
int c;
int w,i,j=0;
char name[20];
if(n!=0)
{
do{ printf("\n");
printf("+--------------------+\n");
printf("| 按学号查询 请按 1 |\n");
printf("| 按姓名查询 请按 2 |\n");
printf("| 取消 请按 0 |\n");
printf("+--------------------+\n");
printf("请输入您的选择:");
scanf("%d", c);
switch(c)
{
case 0:break;
case 1:
printf("请输入学生的学号;");
scanf("%ld", w);
printf("\n");
for(i=0;in;i++)
if(stu[i].num==w)
{
printf("\n学号\t姓名\t年龄\t性别\t地址\t\t电话\n");
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
j=1;
}
if(j==0)
printf("提示:没有该学生记录,请核对!");
break;
case 2:
printf("请输入学生的姓名:");
scanf("%s", name);
printf("\n");
for(i=0;in;i++)
if(strcmp(name,stu[i].name)==0)
{
printf("\n学号\t姓名\t年龄\t性别\t地址\t\t电话\n");
j=1;
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
}
if(j==0)
printf("提示:没有该学生记录,请核对!");
break;
default:
printf("\n提示:无效选项!");
break;
}
}while(c!= 0);
}else printf("提示:无学生数据,请输入数据!");
return;
}
void xg()/*修改函数*/
{
long int num;
int i,j,c;
if(n!=0)
{
printf("请输入您要修改的学生的学号:");
scanf("%ld", num);
printf("\n");
for(i=0;in;i++)
if(stu[i].num==num)
j=i;
do{
printf("请选择您要修改的学生的信息内容:\n");
printf("+----------------------+\n");
printf("| 姓名 请按 1 |\n");
printf("| 年龄 请按 2 |\n");
printf("| 性别 请按 3 |\n");
printf("| 学号 请按 4 |\n");
printf("| 地址 请按 5 |\n");
printf("| 电话 请按 6 |\n");
printf("| 取消 请按 0 |\n");
printf("+----------------------+\n");
printf("请输入您的选择:");
scanf("%d", c);
printf("\n");
switch(c)
{
case 0:break;
case 1:printf("请输入新姓名:");
scanf("%s",stu[j].name);
break;
case 2:printf("请输入新年龄:");
scanf("%d",stu[j].age);
break;
case 3:printf("请输入新性别:");
scanf("%s",stu[j].sex);
break;
case 4:printf("请输入新学号:");
scanf("%ld",stu[j].num);
break;
case 5:printf("请输入新地址:");
scanf("%s",stu[j].b);
break;
case 6:printf("请输入新电话:");
scanf("%s",stu[j].p);
break;
default:
printf("\n无效选项!");
break;
}
}while(c!= 0);
}else printf("提示:无学生数据,请输入数据!");
}
void sc()/*删除函数*/
{
long int num;
int i,j,e;
if(n!=0)
{
printf("学号\t姓名\t年龄\t性别\t地址\t\t电话\n");
printf("-----------------------------------------------------\n");
for(i=0;in;i++)
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
printf("请输入您要删除的学生的学号:");
scanf("%ld", num);
printf("\n");
for(i=0;in;i++)
if(num==stu[i].num)
j=i;
if(j!=(n-1))
{
for(e=i-1;en;e++,j++)
{
stu[j].num=stu[j+1].num;
strcpy(stu[j].name,stu[j+1].name);
strcpy(stu[j].sex,stu[j+1].sex);
stu[j].age=stu[j+1].age;
strcpy(stu[j].b,stu[j+1].b);
strcpy(stu[j].p,stu[j+1].p);
n--;p--;
}
}else {n--;p--;}
printf("提示:删除完毕!");
}else printf("提示:无学生数据,请输入数据!");
}
如何入侵学校教务系统
问题一:你能入侵学校的教务系统吗? 学点编程语言就能做到,但不是专业黑客的话很难做到入侵后退出时不留痕迹,或被技术人员和工程师发现,如果发现,立即拦截,然后迅路径找到电脑,接受法律的制裁
问题二:求教如何入侵教务管理系统 如果这样做,警察会上门。毁了一生,那时就后悔了。自己稍加勤奋努力就能解决问题,何必想这些危险办法呢?
问题三:怎么入侵教务处系统里的成绩单 看你学校用德什么教务系统了,国内的青果,正方。
问题四:如何入侵学校的正方教务管理系统oracle数据库?要步骤啊 我知道一高手可以指点
问题五:怎样入侵学院教务系统修改成绩 怎么说,说呢高手就可以做到这种高难度的事情,看你能不能找到了!!!
问题六:如何入侵学校的正方教务管理系统oracle数据库?要步骤啊 这难道有点啊
问题七:入侵教务处系统修改成绩,可以吗? 不可以,
问题八:你能侵入学校教务系统改成绩吗 你可以百度华盟雇佣军找他们问问
问题九:如何侵入正方教务管理系统篡改成绩 还是别想了,还是努力读书吧
问题十:能侵入学校教务系统修改成绩吗 这是可以的
但是这是违法的
所以你不要这么做
不然会特别麻烦
学生管理系统php源码谁有
php学生管理系统源码,供大家参考,具体内容如下
功能:
1.添加/删除/修改
2.数据存储.
界面分布:
index.php
---主界面
add.php ---stu添加
action --- sql中add/del/update
(处理html表单--mysql的数据存储 && 页面跳转)
edit.php ---stu修改
menu.php
--首页
1. index.php
!DOCTYPE html
html lang="en"
head
meta charset="UTF-8"
title学生信息管理/title
script
function doDel(id) {
if(confirm('确认删除?')) {
window.location='action.php?action=delid='+id;
}
}
/script
/head
body
center
?php
include ("menu.php");
?
h3浏览学生信息/h3
table width="500" border="1"
tr
thID/th
th姓名/th
th性别/th
th年龄/th
th班级/th
th操作/th
/tr
?php
// 1. 链接数据库
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
die('connection failed'.$e-getMessage());
}
//2.执行sql
$sql_select = "select * from stu";
//3.data 解析
foreach ( $pdo-query($sql_select) as $row) {
echo "tr";
echo "th{$row['id']} /th";
echo "th{$row['name']}/th";
echo "th{$row['sex']} /th";
echo "th{$row['age']} /th";
echo "th{$row['classid']}/th";
echo "td
a href='edit.php?id={$row['id']}'修改/a
a href='javascript:void(0);' onclick='doDel({$row['id']})'删除/a
/td";
echo "/tr";
}
?
/table
/center
/body
/html
2. add.php
!DOCTYPE html
html lang="en"
head
meta charset="UTF-8"
title学生管理系统/title
/head
body
center
?php include ('menu.php'); ?
h3增加学生信息/h3
form action="action.php?action=add" method="post"
table
tr
td姓名/td
tdinput type="text" name="name"/td
/tr
tr
td年龄/td
tdinput type="text" name="age"/td
/tr
tr
td性别/td
tdinput type="radio" name="sex" value="男"男/td
tdinput type="radio" name="sex" value="女"女/td
/tr
tr
td班级/td
tdinput type="text" name="classid"/td
/tr
tr
!-- td /td--
tda href="index.php"返回/td
tdinput type="submit" value="添加"/td
tdinput type="reset" value="重置"/td
/tr
/table
/form
/center
/body
/html
3. action.php
?php
/**
* Created by PhpStorm.
* User: hyh
* Date: 16-7-7
* Time: 下午9:37
*/
//1. 链接数据库
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
// echo 'Connection failed: ' . $e-getMessage();
die('connection failed'.$e-getMessage());
}
//2.action 的值做对操作
switch ($_GET['action']){
case 'add'://add
$name = $_POST['name'];
$sex = $_POST['sex'];
$age = $_POST['age'];
$classid = $_POST['classid'];
$sql = "insert into stu (name, sex, age, classid) values ('{$name}', '{$sex}','{$age}','{$classid}')";
$rw = $pdo-exec($sql);
if ($rw 0){
echo "scriptalter('添加成功');/script";
}else{
echo "scriptalter('添加失败');/script";
}
header('Location: index.php');
break;
case 'del'://get
$id = $_GET['id'];
$sql = "delete from stu where id={$id}";
$rw = $pdo-exec($sql);
if ($rw 0){
echo "scriptalter('删除成功');/script";
}else{
echo "scriptalter('删除失败');/script";
}
header('Location: index.php');
break;
case 'edit'://post
$id = $_POST['id'];
$name = $_POST['name'];
$age = $_POST['age'];
$classid = $_POST['classid'];
$sex = $_POST['sex'];
// echo $id, $age, $age, $name;
$sql = "update stu set name='{$name}', age={$age},sex='{$sex}',classid={$classid} where id={$id};";
// $sql = "update myapp.stu set name='jike',sex='女', age=24,classid=44 where id=17";
print $sql;
$rw = $pdo-exec($sql);
if ($rw 0){
echo "scriptalter('更新成功');/script";
}else{
echo "scriptalter('更新失败');/script";
}
header('Location: index.php');
break;
default:
header('Location: index.php');
break;
}
4.edit.php
!DOCTYPE html
html lang="en"
head
meta charset="UTF-8"
title学生管理系统/title
/head
body
center
?php include ('menu.php');
//1. 链接数据库
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
die('connection failed'.$e-getMessage());
}
//2.执行sql
$sql_select = "select * from stu where id={$_GET['id']}";
$stmt = $pdo-query($sql_select);
if ($stmt-rowCount() 0) {
$stu = $stmt-fetch(PDO::FETCH_ASSOC); // 解析数据
}else{
die("no have this id:{$_GET['id']}");
}
?
h3修改学生信息/h3
form action="action.php?action=edit" method="post"
input type="hidden" name="id" value="?php echo $stu['id'];?"
table
tr
td姓名/td
tdinput type="text" name="name" value="?php echo $stu['name'];?"/td
/tr
tr
td年龄/td
tdinput type="text" name="age" value="?php echo $stu['age'];?"/td
/tr
tr
td性别/td
td
input type="radio" name="sex" value="男" ?php echo ($stu['sex'] == "男")? "checked":"";? 男
/td
td
input type="radio" name="sex" value="女" ?php echo ($stu['sex'] == "女")? "checked":"";? 女
/td
/tr
tr
td班级/td
tdinput type="text" name="classid" value="?php echo $stu['classid']?"/td
/tr
tr
td /td
tdinput type="submit" value="更新"/td
tdinput type="reset" value="重置"/td
/tr
/table
/form
/center
?php
?
/body
/html
5. menu.php
!DOCTYPE html
html lang="en"
body
h2学生管理系统/h2
a href="index.php" 浏览学生/a
a href="add.php" 添加学生/a
hr
/body
/html
急求(教务管理系统 pb9.0 源代码)毕业设计用 高分!
这是我用来交作业的程序.虽然不是自己写的.传上来再说了.
等我自己的可以用了.再传...
package jettang;
import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
//////////////////////////////////////////////
//主类
public class STU {
public STU() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void main(String args[]) {
new Frm_Main();
}
private void jbInit() throws Exception {
}
}
//主框架,数据库
class Frm_Main implements ActionListener { //throws IOException
public static final int EXIT_ON_CLOSE = 0;
public JFrame frame;
public Container c;
public JMenuBar menuBar;
public JMenu mainMenu1;
public JMenu mainMenu2;
public JMenu mainMenu3;
public JMenuItem subMenu1[] = new JMenuItem[5];
public JMenuItem subMenu2[] = new JMenuItem[7];
public JMenuItem subMenu3[] = new JMenuItem[2];
JButton toolBarButton[] = new JButton[8];
public JToolBar toolBar;
//////////////////////////////////////////////
String strTip[] = {"姓名查询...", "添加信息...",
"删除...", "修改...", "修改确认...",
"添加确认...", "删除确认...", "关于产品信息:)"};
//////////////////////////////////////////////
// String id = new String();
String name = new String();
String sex = new String();
String age = new String();
String classid = new String();
String department = new String();
String call = new String();
//////////////////////////////////////////////
Connection con;
ResultSet rs;
Statement st;
// ResultSetMetaData rsmd;
// Vector columnHeads=new Vector();
// Vector rows = new Vector();
// Vector currentRow=new Vector();
///////////////////////////////////////////////
public JLabel classidL = new JLabel("班级");
public JLabel nameL = new JLabel("姓名");
public JLabel sexL = new JLabel("性别");
public JLabel ageL = new JLabel("年龄");
public JLabel departmentL = new JLabel("单位");
public JLabel callL = new JLabel("电话");
public JLabel tittleLabel = new JLabel();
//////////////////////////////////////////////
public JTextField classidT = new JTextField();
public JTextField nameT = new JTextField();
public JTextField sexT = new JTextField();
public JTextField ageT = new JTextField();
public JTextField departmentT = new JTextField();
public JTextField callT = new JTextField();
public JTextArea textT = new JTextArea();
//////////////////////////////////////////////
//////////////////////////////////////////////
public Frm_Main() {
/////////////////////////////////////////////////
frame = new JFrame("学籍管理系统V1.0");
c = frame.getContentPane();
c.setLayout(null);
menuBar = new JMenuBar();
toolBar = new JToolBar();
toolBar.setFloatable(false);
frame.setJMenuBar(menuBar);
frame.setResizable(false);
////////////////////////////////////////////////
mainMenu1 = new JMenu("管理");
String str1[] = {"添加", "删除", "查询", " ", "关闭"};
for (int i = 0; i 5; i++) {
if (i == 3) {
mainMenu1.addSeparator();
} else {
subMenu1[i] = new JMenuItem(str1[i]);
subMenu1[i].addActionListener(this);
mainMenu1.add(subMenu1[i]);
}
}
menuBar.add(mainMenu1);
/////////////////////////////////////////////////
mainMenu2 = new JMenu("操作");
String str2[] = {"查询", "添加", "删除", "修改",
"提交修改", "提交添加", "提交删除"};
for (int i = 0; i 7; i++) {
subMenu2[i] = new JMenuItem(str2[i]);
subMenu2[i].addActionListener(this);
mainMenu2.add(subMenu2[i]);
}
menuBar.add(mainMenu2);
/////////////////////////////////////////////////
mainMenu3 = new JMenu("集体查询");
String str3[] = {"按班级...", "按单位..."};
for (int i = 0; i 2; i++) {
subMenu3[i] = new JMenuItem(str3[i]);
subMenu3[i].addActionListener(this);
mainMenu3.add(subMenu3[i]);
}
menuBar.add(mainMenu3);
////////////////////////////////////////////////
String strToolBar[] = {"查询", "添加", "删除", "修改", "提交修改",
"提交添加", "提交删除", "关于"};
for (int i = 0; i 8; i++) {
toolBarButton[i] = new JButton(strToolBar[i]);
toolBarButton[i].setToolTipText(strTip[i]);
toolBarButton[i].addActionListener(this);
toolBar.add(toolBarButton[i]);
}
toolBar.setLocation(0, 0);
toolBar.setSize(400, 30);
c.add(toolBar);
////////////////////////////////////////////////
classidL.setLocation(35, 40);
classidL.setSize(40, 20);
//classidL.setFont(new Font("",Font.BOLD,12));
c.add(classidL);
classidT.setLocation(90, 40);
classidT.setSize(200, 20);
//classidT.setEnabled(false);
c.add(classidT);
nameL.setLocation(35, 70);
nameL.setSize(40, 20);
c.add(nameL);
nameT.setLocation(90, 70);
nameT.setSize(200, 20);
c.add(nameT);
sexL.setLocation(35, 100);
sexL.setSize(40, 20);
c.add(sexL);
sexT.setLocation(90, 100);
sexT.setSize(200, 20);
c.add(sexT);
ageL.setLocation(35, 130);
ageL.setSize(40, 20);
c.add(ageL);
ageT.setLocation(90, 130);
ageT.setSize(200, 20);
c.add(ageT);
departmentL.setLocation(35, 160);
departmentL.setSize(40, 20);
c.add(departmentL);
departmentT.setLocation(90, 160);
departmentT.setSize(200, 20);
c.add(departmentT);
callL.setLocation(35, 190);
callL.setSize(40, 20);
c.add(callL);
callT.setLocation(90, 190);
callT.setSize(200, 20);
c.add(callT);
/////////////////////////////////////////////////
tittleLabel.setText("----------集体查询结果--------");
tittleLabel.setSize(300, 20);
tittleLabel.setLocation(10, 210);
c.add(tittleLabel);
////////////////////////////////////////////
textT.setSize(400, 300);
textT.setLocation(10, 240);
c.add(textT, 14);
///////////////////////////////////////////////
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 650);
frame.setLocation(200, 200);
frame.setVisible(true);
conDB();
}
//以上是框架设计
//JDBC
public void conDB() {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
JOptionPane.showMessageDialog(null, "数据库错误");
}
try {
con = DriverManager.getConnection("jdbc:odbc:jettang", "sa", "");
st = con.createStatement();
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "数据库连接失败");
}
}
//关闭连接
public void closeDB() {
try {
st.close();
con.close();
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "数据库关闭失败");
}
}
//事件响应
public void actionPerformed(ActionEvent e) {
//////////////////////////////////////////////
if (e.getSource() == toolBarButton[7]) {
JOptionPane.showMessageDialog(null, "当前版本1.0,designed by qyq wxm");
}
/////////////////////////////////////////////查询(按姓名)
if (e.getSource() == subMenu2[0] || e.getSource() == toolBarButton[0] ||
e.getSource() == subMenu1[2]) {
String idid = JOptionPane.showInputDialog("请输入学生姓名");
if (idid.trim() != "") {
String strSQL = "select * from stuinfo where name ='" + idid +
"'";
try {
rs = st.executeQuery(strSQL);
int count = 0;
while (rs.next()) {
classid = rs.getString("classid");
name = rs.getString("name");
department = rs.getString("department");
sex = rs.getString("sex");
age = rs.getString("age");
call = rs.getString("call");
++count;
}
if (count == 0) {
JOptionPane.showMessageDialog(null, "无此信息");
} else {
classidT.setText(classid);
nameT.setText(name);
sexT.setText(sex);
ageT.setText(age);
callT.setText(call);
departmentT.setText(department);
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "查询失败");
}
}
}
/////////////////////////////////////////////关闭
if (e.getSource() == subMenu1[4]) {
frame.dispose();
closeDB();
}
/////////////////////////////////////////////添加
if (e.getSource() == subMenu1[0] || e.getSource() == subMenu2[1] ||
e.getSource() == toolBarButton[1]) {
JOptionPane.showMessageDialog(null, "请输入你添加的信息再点击提交添加键");
classidT.setEnabled(true);
classidT.setText("");
nameT.setText("");
sexT.setText("");
ageT.setText("");
callT.setText("");
departmentT.setText("");
}
/////////////////////////////////////////////提交添加
if (e.getSource() == toolBarButton[5] || e.getSource() == subMenu2[5]) {
if ((classidT.getText().trim()).equals("") ||
(nameT.getText().trim()).equals("") ||
(sexT.getText().trim()).equals("") ||
(ageT.getText().trim()).equals("") ||
(callT.getText().trim()).equals("") ||
(departmentT.getText().trim()).equals("")) {
JOptionPane.showMessageDialog(null, "请先点击添加键");
} else {
classid = classidT.getText();
name = nameT.getText();
sex = sexT.getText();
age = ageT.getText();
call = callT.getText();
department = departmentT.getText();
String strSQL =
"insert into stuinfo(classid,name,sex,age,call,department) values('" +
classid + "','" +
name + "','" + sex + "','" + age + "','" + call + "','" +
department + "')";
try {
st.executeUpdate(strSQL);
} catch (Exception exx) {
JOptionPane.showMessageDialog(null, "添加失败");
return;
}
JOptionPane.showMessageDialog(null, "添加成功");
classidT.setText("");
nameT.setText("");
sexT.setText("");
ageT.setText("");
callT.setText("");
departmentT.setText("");
}
}
////////////////////////////////////////////提交修改
if (e.getSource() == subMenu2[4] || e.getSource() == toolBarButton[4]) {
if ((classidT.getText().trim()).equals("") ||
(nameT.getText().trim()).equals("") ||
(sexT.getText().trim()).equals("")
|| (ageT.getText().trim()).equals("") ||
(callT.getText().trim()).equals("") ||
(departmentT.getText().trim()).equals("")) {
JOptionPane.showMessageDialog(null, "请先点击修改键");
return;
} else {
classid = classidT.getText();
name = nameT.getText();
sex = sexT.getText();
age = ageT.getText();
call = callT.getText();
department = departmentT.getText();
String strSQL = "update stuinfo set classid='" + classid +
"',sex='" + sex + "',age='" + age + "',call='" +
call + "',department='" + department + "'" +
"where name='" + name + "'";
try {
st.executeUpdate(strSQL);
} catch (Exception exx) {
JOptionPane.showMessageDialog(null, "修改失败");
return;
}
JOptionPane.showMessageDialog(null, "修改成功");
classidT.setText("");
nameT.setText("");
sexT.setText("");
ageT.setText("");
callT.setText("");
departmentT.setText("");
}
}
///////////////////////////////////////////////修改
if (e.getSource() == subMenu2[3] || e.getSource() == toolBarButton[3]) {
String idid = JOptionPane.showInputDialog
("请输入你要修改的学生姓名后点击提交修改键确认");
if (idid.trim() != "") {
String strSQL = "select * from stuinfo where name ='" + idid +
"'";
try {
rs = st.executeQuery(strSQL);
int count = 0;
while (rs.next()) {
classid = rs.getString("classid");
name = rs.getString("name");
department = rs.getString("department");
sex = rs.getString("sex");
age = rs.getString("age");
call = rs.getString("call");
++count;
}
if (count == 0) {
JOptionPane.showMessageDialog(null, "无此信息");
} else {
classidT.setText(classid);
nameT.setText(name);
sexT.setText(sex);
ageT.setText(age);
callT.setText(call);
departmentT.setText(department);
classidT.setEnabled(false);
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "修改失败");
}
}
}
/////////////////////////////////////////////////删除
if (e.getSource() == subMenu2[2] || e.getSource() == toolBarButton[2] ||
e.getSource() == subMenu1[1]) {
String idDel = JOptionPane.showInputDialog
("请输入要删除的学生姓名后点击提交删除键确认");
if (idDel.trim() != "") {
String strSQL = "select * from stuinfo where name ='" + idDel +
"'";
try {
rs = st.executeQuery(strSQL);
int count = 0;
while (rs.next()) {
classid = rs.getString("classid");
name = rs.getString("name");
department = rs.getString("department");
sex = rs.getString("sex");
age = rs.getString("age");
call = rs.getString("call");
++count;
}
if (count == 0) {
JOptionPane.showMessageDialog(null, "无此信息");
} else {
classidT.setText(classid);
nameT.setText(name);
sexT.setText(sex);
ageT.setText(age);
callT.setText(call);
departmentT.setText(department);
classidT.setEnabled(false);
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "删除失败");
}
}
}
//////////////////////////////////////////////////提交删除
if (e.getSource() == toolBarButton[6] ||
e.getSource() == subMenu2[6]) {
if ((classidT.getText().trim()).equals("") ||
(nameT.getText().trim()).equals("") ||
(sexT.getText().trim()).equals("") ||
(ageT.getText().trim()).equals("") ||
(callT.getText().trim()).equals("") ||
(departmentT.getText().trim()).equals("")) {
JOptionPane.showMessageDialog(null, "请先点击删除键");
return;
} else {
name = nameT.getText();
String strSQL = "delete from stuinfo where name='" + name +
"'";
try {
st.executeUpdate(strSQL);
} catch (Exception exx) {
JOptionPane.showMessageDialog(null, "删除失败");
return;
}
JOptionPane.showMessageDialog(null, "删除成功");
classidT.setText("");
nameT.setText("");
sexT.setText("");
ageT.setText("");
callT.setText("");
departmentT.setText("");
}
}
//////////////////////////////////////////////集体查询(按班级)
if (e.getSource() == subMenu3[0]) {
classidT.setText("");
nameT.setText("");
sexT.setText("");
ageT.setText("");
callT.setText("");
departmentT.setText("");
if ((classidT.getText().trim()).equals("")) {
String idclass = JOptionPane.showInputDialog("请输入班级");
String strSQL = "select * from stuinfo where classid='" +
idclass +
"'";
try {
rs = st.executeQuery(strSQL);
displayres(rs);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "查询失败");
}
} else {
String idclass = classidT.getText();
String strSQL = "select * from stuinfo where classid='" +
idclass +
"'";
try {
rs = st.executeQuery(strSQL);
displayres(rs);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "查询失败");
}
}
}
////////////////////////////按单位
if (e.getSource() == subMenu3[1]) {
classidT.setText("");
nameT.setText("");
sexT.setText("");
ageT.setText("");
callT.setText("");
departmentT.setText("");
if ((departmentT.getText().trim()).equals("")) {
String idclass = JOptionPane.showInputDialog("请输入单位");
String strSQL = "select * from stuinfo where department='" +
idclass +
"'";
try {
rs = st.executeQuery(strSQL);
displayres(rs);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "查询失败");
}
} else {
String idclass = departmentT.getText();
String strSQL = "select * from stuinfo where department='" +
idclass +
"'";
try {
rs = st.executeQuery(strSQL);
displayres(rs);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "查询失败");
}
}
}
}
public void displayres(ResultSet rs1) throws SQLException {
//定位到达第一条记录
boolean moreRecords = rs1.next();
//如果没有记录,则提示一条消息
if (!moreRecords) {
JOptionPane.showMessageDialog(null, "无此记录");
return;
}
try {
//获取数据
getNextRow(rs1);
//刷新Table
c.validate();
}
catch (SQLException sqlex) {
sqlex.printStackTrace();
}
}
public void getNextRow(ResultSet rs2) throws
SQLException {
int count = 1;
while (rs2.next()) {
name = " 姓名:" + rs2.getString(1);
age = " 年龄:" + rs2.getString(2) + " 单位:";
department = rs2.getString(3) + "\n";
textT.append(count + "." + name + age + department);
count++;
}
}
}
关于正方教务管理系统源码和正方教务系统软件的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
2、本站永久网址:https://www.yuanmacun.com
3、本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长进行删除处理。
4、本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6、本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
源码村资源网 » 正方教务管理系统源码(正方教务系统软件)
1 评论