:
Drawing:
:
Icon^>(resources->GetObject(L"$this.Icon")));
this->MaximizeBox=false;
this->Name=L"Form1";
this->StartPosition=System:
:
Windows:
:
Forms:
:
FormStartPosition:
:
CenterScreen;
this->Text=L"学生管理系统";
this->Load+=gcnewSystem:
:
EventHandler(this,&Form1:
:
Form1_Load);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragmaendregion
private:
System:
:
VoidForm1_Load(System:
:
Object^sender,System:
:
EventArgs^e){
}
private:
System:
:
Voidbutton1_Click(System:
:
Object^sender,System:
:
EventArgs^e){
StuMan^stuMan=gcnewStuMan;
stuMan->ShowDialog();
this->Close();
}
};
}
(2)主界面代码
#pragmaonce
#include"Find.h"
#include"Add.h"
#include"AddClass.h"
#include"Del.h"
#include"Upda.h"
#include"UpdaScore.h"
#include"UpdaClass.h"
usingnamespaceSystem;
usingnamespaceSystem:
:
ComponentModel;
usingnamespaceSystem:
:
Collections;
usingnamespaceSystem:
:
Windows:
:
Forms;
usingnamespaceSystem:
:
Data;
usingnamespaceSystem:
:
Drawing;
usingnamespaceSystem:
:
Data:
:
OleDb;
namespaceStudentManagement{
///
///StuMan摘要
///
///警告:
如果更改此类的名称,则需要更改
///与此类所依赖的所有.resx文件关联的托管资源编译器工具的
///“资源文件名”属性。
否则,
///设计器将不能与此窗体的关联
///本地化资源正确交互。
///
publicrefclassStuMan:
publicSystem:
:
Windows:
:
Forms:
:
Form
{
public:
StuMan(void)
{
InitializeComponent();
//
//TODO:
在此处添加构造函数代码
//
}
intmid;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^ClassManagement;
public:
public:
public:
public:
OleDbConnection^objConnection;
//ShowView函数显示数据学生信息
public:
voidShowView()
{
objConnection=gcnewOleDbConnection(L"Provider=;DataSource=Stuman.mdb");
System:
:
Data:
:
OleDb:
:
OleDbDataAdapter^objAdapter=gcnewOleDbDataAdapter("select*fromPersonView",objConnection);
System:
:
Data:
:
DataSet^objDataset=gcnewDataSet();
objAdapter->Fill(objDataset,"PersonView");
dgv->DataSource=objDataset->Tables["PersonView"];
}
//ShowScoreView函数显示成绩信息
public:
voidShowScoreView()
{
objConnection=gcnewOleDbConnection(L"Provider=;DataSource=Stuman.mdb");
System:
:
Data:
:
OleDb:
:
OleDbDataAdapter^objAdapter=gcnewOleDbDataAdapter("select*fromPersonScoreView",objConnection);
System:
:
Data:
:
DataSet^objDataset=gcnewDataSet();
objAdapter->Fill(objDataset,"PersonScoreView");
dgv->DataSource=objDataset->Tables["PersonScoreView"];
}
//ShowClassView函数显示课程信息
public:
voidShowClassView()
{
objConnection=gcnewOleDbConnection(L"Provider=;DataSource=Stuman.mdb");
System:
:
Data:
:
OleDb:
:
OleDbDataAdapter^objAdapter=gcnewOleDbDataAdapter("select*fromPersonClassView",objConnection);
System:
:
Data:
:
DataSet^objDataset=gcnewDataSet();
objAdapter->Fill(objDataset,"PersonClassView");
dgv->DataSource=objDataset->Tables["PersonClassView"];
}
protected:
///
///清理所有正在使用的资源。
///
~StuMan()
{
if(components)
{
deletecomponents;
}
}
private:
System:
:
Windows:
:
Forms:
:
MenuStrip^menuStrip1;
protected:
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^文件ToolStripMenuItem;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^StudentManagement;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^ScoreManagement;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^编辑EToolStripMenuItem;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^添加AToolStripMenuItem;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^查找DToolStripMenuItem;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^Delect;
private:
System:
:
Windows:
:
Forms:
:
SplitContainer^splitContainer1;
private:
System:
:
Windows:
:
Forms:
:
DataGridView^dgv;
private:
System:
:
Windows:
:
Forms:
:
ToolStripMenuItem^Upd;
public:
String^xh,^xm,^xb,^bj,^dh,^ID,^Mt,^Ph,^Eg,^Et,^Ml,^Cp,^Kch,^Kc,^Xs,^Xf,^IDT;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxNum;
public:
public:
private:
System:
:
Windows:
:
Forms:
:
Label^label1;
private:
System:
:
Windows:
:
Forms:
:
GroupBox^groupBox1;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxXfj;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxCp;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxMl;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxEt;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxEg;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxPh;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxMt;
private:
System:
:
Windows:
:
Forms:
:
Label^label9;
private:
System:
:
Windows:
:
Forms:
:
Label^label8;
private:
System:
:
Windows:
:
Forms:
:
Label^label7;
private:
System:
:
Windows:
:
Forms:
:
Label^label6;
private:
System:
:
Windows:
:
Forms:
:
Label^label5;
private:
System:
:
Windows:
:
Forms:
:
Label^label4;
private:
System:
:
Windows:
:
Forms:
:
Label^label3;
private:
System:
:
Windows:
:
Forms:
:
TextBox^textBoxName;
private:
System:
:
Windows:
:
Forms:
:
Label^label2;
protected:
private:
System:
:
ComponentModel:
:
IContainer^components;
protected:
private:
///
///必需的设计器变量。
///
#pragmaregionWindowsFormDesignergeneratedcode
///
///设计器支持所需的方法-不要
///使用代码编辑器修改此方法的内容。
///
voidInitializeComponent(void)
{
System:
:
ComponentModel:
:
ComponentResourceManager^resources=(gcnewSystem:
:
ComponentModel:
:
ComponentResourceManager(StuMan:
:
typeid));
this->menuStrip1=(gcnewSystem:
:
Windows:
:
Forms:
:
MenuStrip());
this->文件ToolStripMenuItem=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->StudentManagement=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->ScoreManagement=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->ClassManagement=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->编辑EToolStripMenuItem=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->添加AToolStripMenuItem=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->查找DToolStripMenuItem=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->Delect=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->Upd=(gcnewSystem:
:
Windows:
:
Forms:
:
ToolStripMenuItem());
this->splitContainer1=(gcnewSystem:
:
Windows:
:
Forms:
:
SplitContainer());
this->groupBox1=(gcnewSystem:
:
Windows:
:
Forms:
:
GroupBox());
this->textBoxXfj=(gcnewSystem:
:
Windows:
:
Forms:
:
TextBox());
this->textBo