学生成绩管理系统设计说明书

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

设计说明
一.本程序的设计思路与体系简述:
(1)设计思路:
Ⅰ.设计程序预期功能;Ⅱ.确定程序语言与运行环境;Ⅲ.设计程序的整体结构;Ⅳ.用模块化的理念对各个小的功能进行编写并进行初期调试;Ⅴ.将各个小的模块集合成整体,形成真正的功能全面的程序;Ⅵ.对程序进行总的调试修改;Ⅶ.后期完善,修复bug等,以及对新功能的引入,外包处理,最终完成整个程序的设计。

(2)本程序的体系:
二.相关代码
(1)初始化窗口代码:
#pragma once
#include"StuMan.h"
namespace StudentManagement {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Form1 摘要
///
/// 警告: 如果更改此类的名称,则需要更改
/// 与此类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。

否则,
/// 设计器将不能与此窗体的关联
/// 本地化资源正确交互。

/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: 在此处添加构造函数代码
//
}
protected:
/// <summary>
/// 清理所有正在使用的资源。

/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
protected:
private: System::Windows::Forms::ListView^ listView1;
private: System::Windows::Forms::Label^ label1;
private:
/// <summary>
/// 必需的设计器变量。

/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。

/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->button1 = (gcnew System::Windows::Forms::Button());
this->listView1 = (gcnew System::Windows::Forms::ListView());
this->label1 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(24, 115);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 0;
this->button1->Text = L"学生管理";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this,
&Form1::button1_Click);
//
// listView1
//
this->listView1->BackgroundImage =
(cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"listView1.BackgroundI mage")));
this->listView1->Location = System::Drawing::Point(131, 22);
this->listView1->Name = L"listView1";
this->listView1->Size = System::Drawing::Size(140, 135);
this->listView1->TabIndex = 3;
this->listView1->UseCompatibleStateImageBehavior = false;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(134)));
this->label1->Location = System::Drawing::Point(156, 176);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(105, 120);
this->label1->TabIndex = 4;
this->label1->Text = L"Copyright by\r\n西北工业大学\r\n 机电学院 \r\n 高岭\r\n\r\n\r\n";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(292, 266);
this->Controls->Add(this->label1);
this->Controls->Add(this->listView1);
this->Controls->Add(this->button1);
this->Icon =
(cli::safe_cast<System::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 += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { }
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { StuMan^stuMan=gcnew StuMan;
stuMan->ShowDialog();
this->Close();
}
};
}
(2)主界面代码
#pragma once
#include"Find.h"
#include"Add.h"
#include"AddClass.h"
#include"Del.h"
#include"Upda.h"
#include"UpdaScore.h"
#include"UpdaClass.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Data::OleDb;
namespace StudentManagement {
/// <summary>
/// StuMan 摘要
///
/// 警告: 如果更改此类的名称,则需要更改
/// 与此类所依赖的所有 .resx 文件关联的托管资源编译器工具的/// “资源文件名”属性。

否则,
/// 设计器将不能与此窗体的关联
/// 本地化资源正确交互。

/// </summary>
public ref class StuMan : public System::Windows::Forms::Form
{
public:
StuMan(void)
{
InitializeComponent();
//
//TODO: 在此处添加构造函数代码
//
}
int mid;
private: System::Windows::Forms::ToolStripMenuItem^ ClassManagement;
public:
public:
public:
public: OleDbConnection^objConnection;
//ShowView函数显示数据学生信息
public: void ShowView()
{
objConnection = gcnew OleDbConnection(L"Provider=;Data Source=Stuman.mdb");
System::Data::OleDb::OleDbDataAdapter^ objAdapter = gcnew OleDbDataAdapter("select * from PersonView" , objConnection);
System::Data::DataSet^ objDataset = gcnew DataSet();
objAdapter->Fill(objDataset, "PersonView");
dgv->DataSource = objDataset->Tables["PersonView"];
}
//ShowScoreView函数显示成绩信息
public: void ShowScoreView()
{
objConnection = gcnew OleDbConnection(L"Provider=;Data Source=Stuman.mdb");
System::Data::OleDb::OleDbDataAdapter^ objAdapter = gcnew OleDbDataAdapter("select * from PersonScoreView" , objConnection);
System::Data::DataSet^ objDataset = gcnew DataSet();
objAdapter->Fill(objDataset, "PersonScoreView");
dgv->DataSource = objDataset->Tables["PersonScoreView"];
}
//ShowClassView函数显示课程信息
public: void ShowClassView()
{
objConnection = gcnew OleDbConnection(L"Provider=;Data
Source=Stuman.mdb");
System::Data::OleDb::OleDbDataAdapter^ objAdapter = gcnew OleDbDataAdapter("select * from PersonClassView" , objConnection);
System::Data::DataSet^ objDataset = gcnew DataSet();
objAdapter->Fill(objDataset, "PersonClassView");
dgv->DataSource = objDataset->Tables["PersonClassView"];
}
protected:
/// <summary>
/// 清理所有正在使用的资源。

/// </summary>
~StuMan()
{
if (components)
{
delete components;
}
}
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:
/// <summary>
/// 必需的设计器变量。

/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。

/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(StuMan::typeid));
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->文件ToolStripMenuItem = (gcnew
System::Windows::Forms::ToolStripMenuItem());
this->StudentManagement = (gcnew
System::Windows::Forms::ToolStripMenuItem());
this->ScoreManagement = (gcnew
System::Windows::Forms::ToolStripMenuItem());
this->ClassManagement = (gcnew
System::Windows::Forms::ToolStripMenuItem());
this->编辑EToolStripMenuItem = (gcnew
System::Windows::Forms::ToolStripMenuItem());
this->添加AToolStripMenuItem = (gcnew
System::Windows::Forms::ToolStripMenuItem());
this->查找DToolStripMenuItem = (gcnew
System::Windows::Forms::ToolStripMenuItem());
this->Delect = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->Upd = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
this->textBoxXfj = (gcnew System::Windows::Forms::TextBox());
this->textBoxCp = (gcnew System::Windows::Forms::TextBox());
this->textBoxMl = (gcnew System::Windows::Forms::TextBox());
this->textBoxEt = (gcnew System::Windows::Forms::TextBox());
this->textBoxEg = (gcnew System::Windows::Forms::TextBox());
this->textBoxPh = (gcnew System::Windows::Forms::TextBox());
this->textBoxMt = (gcnew System::Windows::Forms::TextBox());
this->label9 = (gcnew System::Windows::Forms::Label());
this->label8 = (gcnew System::Windows::Forms::Label());
this->label7 = (gcnew System::Windows::Forms::Label());
this->label6 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->textBoxName = (gcnew System::Windows::Forms::TextBox());
this->label2 = (gcnew System::Windows::Forms::Label());
this->textBoxNum = (gcnew System::Windows::Forms::TextBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->dgv = (gcnew System::Windows::Forms::DataGridView());
this->menuStrip1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->splitContainer 1))->BeginInit();
this->splitContainer1->Panel1->SuspendLayout();
this->splitContainer1->Panel2->SuspendLayout();
this->splitContainer1->SuspendLayout();
this->groupBox1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->dgv))->BeginIn it();
this->SuspendLayout();
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array<
System::Windows::Forms::ToolStripItem^ >(2) {this->文件ToolStripMenuItem,
this->编辑EToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(718, 25);
this->menuStrip1->TabIndex = 1;
this->menuStrip1->Text = L"menuStrip1";
//
// 文件ToolStripMenuItem
//
this->文件ToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->StudentManagement,
this->ScoreManagement, this->ClassManagement});
this->文件ToolStripMenuItem->Name = L"文件ToolStripMenuItem";
this->文件ToolStripMenuItem->Size = System::Drawing::Size(58, 21);
this->文件ToolStripMenuItem->Text = L"文件(&F)";
//
// StudentManagement
//
this->StudentManagement->Name = L"StudentManagement";
this->StudentManagement->Size = System::Drawing::Size(152, 22);
this->StudentManagement->Text = L"学生管理";
this->StudentManagement->Click += gcnew System::EventHandler(this,
&StuMan::StudentManagement_Click);
//
// ScoreManagement
//
this->ScoreManagement->Name = L"ScoreManagement";
this->ScoreManagement->Size = System::Drawing::Size(152, 22);
this->ScoreManagement->Text = L"成绩管理";
this->ScoreManagement->Click += gcnew System::EventHandler(this,
&StuMan::ScoreManagement_Click);
//
// ClassManagement
//
this->ClassManagement->Name = L"ClassManagement";
this->ClassManagement->Size = System::Drawing::Size(152, 22);
this->ClassManagement->Text = L"课程管理";
this->ClassManagement->Click += gcnew System::EventHandler(this,
&StuMan::ClassManagement_Click);
//
// 编辑EToolStripMenuItem
//
this->编辑EToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) {this->添加AToolStripMenuItem,
this->查找DToolStripMenuItem, this->Delect, this->Upd});
this->编辑EToolStripMenuItem->Name = L"编辑EToolStripMenuItem";
this->编辑EToolStripMenuItem->Size = System::Drawing::Size(59, 21);
this->编辑EToolStripMenuItem->Text = L"编辑(&E)";
//
// 添加AToolStripMenuItem
//
this->添加AToolStripMenuItem->Name = L"添加AToolStripMenuItem";
this->添加AToolStripMenuItem->Size = System::Drawing::Size(126, 22);
this->添加AToolStripMenuItem->Text = L"添加(&A)...";
this->添加AToolStripMenuItem->Click += gcnew System::EventHandler(this,
&StuMan::Add_Click);
//
// 查找DToolStripMenuItem
//
this->查找DToolStripMenuItem->Name = L"查找DToolStripMenuItem";
this->查找DToolStripMenuItem->Size = System::Drawing::Size(126, 22);
this->查找DToolStripMenuItem->Text = L"查找(&F)...";
this->查找DToolStripMenuItem->Click += gcnew System::EventHandler(this,
&StuMan::Find_Click);
//
// Delect
//
this->Delect->Name = L"Delect";
this->Delect->Size = System::Drawing::Size(126, 22);
this->Delect->Text = L"删除(&D)...";
this->Delect->Click += gcnew System::EventHandler(this,
&StuMan::Delect_Click);
//
// Upd
//
this->Upd->Name = L"Upd";
this->Upd->Size = System::Drawing::Size(126, 22);
this->Upd->Text = L"修改(&U)...";
this->Upd->Click += gcnew System::EventHandler(this, &StuMan::Upda_Click);
//
// splitContainer1
//
this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
this->splitContainer1->Location = System::Drawing::Point(0, 25);
this->splitContainer1->Name = L"splitContainer1";
//
// splitContainer1.Panel1
//
this->splitContainer1->Panel1->Controls->Add(this->groupBox1);
this->splitContainer1->Panel1->Controls->Add(this->textBoxName);
this->splitContainer1->Panel1->Controls->Add(this->label2);
this->splitContainer1->Panel1->Controls->Add(this->textBoxNum);
this->splitContainer1->Panel1->Controls->Add(this->label1);
//
// splitContainer1.Panel2
//
this->splitContainer1->Panel2->Controls->Add(this->dgv);
this->splitContainer1->Size = System::Drawing::Size(718, 360); this->splitContainer1->SplitterDistance = 172;
this->splitContainer1->TabIndex = 2;
//
// groupBox1
//
this->groupBox1->Controls->Add(this->textBoxXfj);
this->groupBox1->Controls->Add(this->textBoxCp);
this->groupBox1->Controls->Add(this->textBoxMl);
this->groupBox1->Controls->Add(this->textBoxEt);
this->groupBox1->Controls->Add(this->textBoxEg);
this->groupBox1->Controls->Add(this->textBoxPh);
this->groupBox1->Controls->Add(this->textBoxMt);
this->groupBox1->Controls->Add(this->label9);
this->groupBox1->Controls->Add(this->label8);
this->groupBox1->Controls->Add(this->label7);
this->groupBox1->Controls->Add(this->label6);
this->groupBox1->Controls->Add(this->label5);
this->groupBox1->Controls->Add(this->label4);
this->groupBox1->Controls->Add(this->label3);
this->groupBox1->Location = System::Drawing::Point(0, 90);
this->groupBox1->Name = L"groupBox1";
this->groupBox1->Size = System::Drawing::Size(170, 268);
this->groupBox1->TabIndex = 4;
this->groupBox1->TabStop = false;
this->groupBox1->Text = L"成绩";
//
// textBoxXfj
//
this->textBoxXfj->Enabled = false;
this->textBoxXfj->Location = System::Drawing::Point(80, 241); this->textBoxXfj->Name = L"textBoxXfj";
this->textBoxXfj->ReadOnly = true;
this->textBoxXfj->Size = System::Drawing::Size(79, 21);
this->textBoxXfj->TabIndex = 14;
//
// textBoxCp
//
this->textBoxCp->Enabled = false;
this->textBoxCp->Location = System::Drawing::Point(100, 203); this->textBoxCp->Name = L"textBoxCp";
this->textBoxCp->ReadOnly = true;
this->textBoxCp->Size = System::Drawing::Size(59, 21);
this->textBoxCp->TabIndex = 13;
//
// textBoxMl
//
this->textBoxMl->Enabled = false;
this->textBoxMl->Location = System::Drawing::Point(100, 170); this->textBoxMl->Name = L"textBoxMl";
this->textBoxMl->ReadOnly = true;
this->textBoxMl->Size = System::Drawing::Size(59, 21);
this->textBoxMl->TabIndex = 12;
//
// textBoxEt
//
this->textBoxEt->Enabled = false;
this->textBoxEt->Location = System::Drawing::Point(100, 135); this->textBoxEt->Name = L"textBoxEt";
this->textBoxEt->ReadOnly = true;
this->textBoxEt->Size = System::Drawing::Size(59, 21);
this->textBoxEt->TabIndex = 11;
//
// textBoxEg
//
this->textBoxEg->Enabled = false;
this->textBoxEg->Location = System::Drawing::Point(100, 100); this->textBoxEg->Name = L"textBoxEg";
this->textBoxEg->ReadOnly = true;
this->textBoxEg->Size = System::Drawing::Size(59, 21);
this->textBoxEg->TabIndex = 10;
//
// textBoxPh
//
this->textBoxPh->Enabled = false;
this->textBoxPh->Location = System::Drawing::Point(100, 63); this->textBoxPh->Name = L"textBoxPh";
this->textBoxPh->ReadOnly = true;
this->textBoxPh->Size = System::Drawing::Size(59, 21);
this->textBoxPh->TabIndex = 9;
//
// textBoxMt
//
this->textBoxMt->Enabled = false;
this->textBoxMt->Location = System::Drawing::Point(100, 29); this->textBoxMt->Name = L"textBoxMt";
this->textBoxMt->ReadOnly = true;
this->textBoxMt->Size = System::Drawing::Size(59, 21);
this->textBoxMt->TabIndex = 8;
//
// label9
//
this->label9->AutoSize = true;
this->label9->Location = System::Drawing::Point(6, 244);
this->label9->Name = L"label9";
this->label9->Size = System::Drawing::Size(41, 12);
this->label9->TabIndex = 7;
this->label9->Text = L"学分积";
//
// label8
//
this->label8->AutoSize = true;
this->label8->Location = System::Drawing::Point(6, 206);
this->label8->Name = L"label8";
this->label8->Size = System::Drawing::Size(71, 12);
this->label8->TabIndex = 6;
this->label8->Text = L"C++程序设计";
//
// label7
//
this->label7->AutoSize = true;
this->label7->Location = System::Drawing::Point(6, 173);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(53, 12);
this->label7->TabIndex = 5;
this->label7->Text = L"材料力学";
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System::Drawing::Point(6, 103);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(53, 12);
this->label6->TabIndex = 4;
this->label6->Text = L"大学英语";
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System::Drawing::Point(6, 138);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(53, 12);
this->label5->TabIndex = 3;
this->label5->Text = L"电工技术";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(6, 66);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(53, 12);
this->label4->TabIndex = 2;
this->label4->Text = L"大学物理";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(6, 32);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(53, 12);
this->label3->TabIndex = 1;
this->label3->Text = L"高等数学";
//
// textBoxName
//
this->textBoxName->Enabled = false;
this->textBoxName->Location = System::Drawing::Point(59, 52); this->textBoxName->Name = L"textBoxName";
this->textBoxName->ReadOnly = true;
this->textBoxName->Size = System::Drawing::Size(100, 21);
this->textBoxName->TabIndex = 3;
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(12, 55);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(29, 12);
this->label2->TabIndex = 2;
this->label2->Text = L"姓名";
//
// textBoxNum
//
this->textBoxNum->Enabled = false;
this->textBoxNum->Location = System::Drawing::Point(59, 15);
this->textBoxNum->Name = L"textBoxNum";
this->textBoxNum->ReadOnly = true;
this->textBoxNum->Size = System::Drawing::Size(100, 21);
this->textBoxNum->TabIndex = 1;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(12, 18);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(29, 12);
this->label1->TabIndex = 0;
this->label1->Text = L"学号";
//
// dgv
//
this->dgv->AllowUserToAddRows = false;
this->dgv->AllowUserToDeleteRows = false;
this->dgv->ColumnHeadersHeightSizeMode =
System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->dgv->Dock = System::Windows::Forms::DockStyle::Fill;
this->dgv->Location = System::Drawing::Point(0, 0);
this->dgv->MultiSelect = false;
this->dgv->Name = L"dgv";
this->dgv->ReadOnly = true;
this->dgv->RowTemplate->Height = 23;
this->dgv->SelectionMode =
System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
this->dgv->Size = System::Drawing::Size(542, 360);
this->dgv->TabIndex = 0;
this->dgv->CellClick += gcnew
System::Windows::Forms::DataGridViewCellEventHandler(this, &StuMan::dgv_CellClick);
//
// StuMan
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(718, 385);
this->Controls->Add(this->splitContainer1);
this->Controls->Add(this->menuStrip1);
this->FormBorderStyle =
System::Windows::Forms::FormBorderStyle::FixedSingle;
this->Icon =
(cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->MainMenuStrip = this->menuStrip1;
this->MaximizeBox = false;
this->Name = L"StuMan";
this->StartPosition =
System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"学生管理";
this->Load += gcnew System::EventHandler(this, &StuMan::StuMan_Load);
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
this->splitContainer1->Panel1->ResumeLayout(false);
this->splitContainer1->Panel1->PerformLayout();
this->splitContainer1->Panel2->ResumeLayout(false);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->splitContainer 1))->EndInit();
this->splitContainer1->ResumeLayout(false);
this->groupBox1->ResumeLayout(false);
this->groupBox1->PerformLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->dgv))->EndInit ();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void StuMan_Load(System::Object^ sender, System::EventArgs^ e) { this->Upd->Enabled=false;//“更新”菜单不可用
this->Delect->Enabled=false;//“删除”菜单不可用
ShowView();
mid=1;
}
//点击让数据在左侧显示
private: System::Void dgv_CellClick(System::Object^ sender,
System::Windows::Forms::DataGridViewCellEventArgs^ e) {
if(mid!=3){
objConnection->Open();
OleDbCommand^olecmd=gcnew OleDbCommand("select * from PersonScoreView where 姓名='" + this->dgv->CurrentRow->Cells[1]->Value->ToString() +"'", objConnection);
OleDbDataReader^oledrd=olecmd->ExecuteReader();
while (oledrd->Read())
{
this->textBoxMt->Text=oledrd->GetValue(2)->ToString();
this->textBoxPh->Text=oledrd->GetValue(3)->ToString();
this->textBoxEg->Text=oledrd->GetValue(4)->ToString();
this->textBoxEt->Text=oledrd->GetValue(5)->ToString();
this->textBoxMl->Text=oledrd->GetValue(6)->ToString();
this->textBoxCp->Text=oledrd->GetValue(7)->ToString();
this->textBoxXfj->Text=oledrd->GetValue(8)->ToString();
}
objConnection->Close();
this->textBoxNum->Text=this->dgv->CurrentRow->Cells[0]->Value->ToString();
this->textBoxName->Text=this->dgv->CurrentRow->Cells[1]->Value->ToString();
}
this->Upd->Enabled=true;
this->Delect->Enabled =true;
}
//
//查找数据
//
private: System::Void Find_Click(System::Object^ sender, System::EventArgs^ e) { Find^find=gcnew Find;
find->ShowDialog();
int index;
index = find->comboBoxFind->SelectedIndex;
if(index==0){
if(find->textPutIn->Text==""){
MessageBox::Show(L"请输入学号");
return ;
}
System::Data::DataTable ^mydatatable=gcnew
System::Data::DataTable("ParentTable");
DataColumn^ mydatacolumn1 =gcnew DataColumn();
mydatacolumn1->DataType = System::Type::GetType("System.String");
mydatacolumn1->ColumnName = "学号";
mydatatable->Columns->Add(mydatacolumn1);
DataColumn^ mydatacolumn2 =gcnew DataColumn();
mydatacolumn2->DataType = System::Type::GetType("System.String");
mydatacolumn2->ColumnName = "姓名";
mydatatable->Columns->Add(mydatacolumn2);
DataColumn^ mydatacolumn3 =gcnew DataColumn();
mydatacolumn3->DataType = System::Type::GetType("System.String");。

相关文档
最新文档