Фрагмент для ознакомления
");}}private: System::Void dataGridView1_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {this->buttonDelete->Enabled = this->dataGridView1->SelectedRows->Count > 0;}private: System::Void AcademicPositionsForm_Load(System::Object^ sender, System::EventArgs^ e) {loadData();}private: System::Void panel1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {}private: System::Void panel3_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {}private: System::Void dataGridView1_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) {}private: System::Void panel2_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {}};}AddAcademicPositionForm.h#pragmaonce#include"AcademicPositionsManager.h"namespace WinEducationPersonnel {usingnamespace System;usingnamespace System::ComponentModel;usingnamespace System::Collections;usingnamespace System::Windows::Forms;usingnamespace System::Data;usingnamespace System::Drawing;/// /// Summary for AddAcademicPositionForm/// publicrefclassAddAcademicPositionForm : public System::Windows::Forms::Form{public:AddAcademicPositionForm(void){InitializeComponent();////TODO: Add the constructor code here//}protected:/// /// Clean up any resources being used./// ~AddAcademicPositionForm(){if (components){delete components;}}private: System::Windows::Forms::Button^ buttonCancel;protected:private: System::Windows::Forms::Button^ buttonAdd;private: System::Windows::Forms::TextBox^ textBoxName;private: System::Windows::Forms::Label^ label1;private:/// /// Required designer variable./// System::ComponentModel::Container^ components;#pragmaregion Windows Form Designer generated code/// /// Required method for Designer support - do not modify/// the contents of this method with the code editor./// void InitializeComponent(void){this->buttonCancel = (gcnew System::Windows::Forms::Button());this->buttonAdd = (gcnew System::Windows::Forms::Button());this->textBoxName = (gcnew System::Windows::Forms::TextBox());this->label1 = (gcnew System::Windows::Forms::Label());this->SuspendLayout();// // buttonCancel// this->buttonCancel->Location = System::Drawing::Point(492, 136);this->buttonCancel->Margin = System::Windows::Forms::Padding(2);this->buttonCancel->Name = L"buttonCancel";this->buttonCancel->Size = System::Drawing::Size(98, 33);this->buttonCancel->TabIndex = 7;this->buttonCancel->Text = L"Отмена";this->buttonCancel->UseVisualStyleBackColor = true;this->buttonCancel->Click += gcnew System::EventHandler(this, &AddAcademicPositionForm::buttonCancel_Click);// // buttonAdd// this->buttonAdd->Location = System::Drawing::Point(44, 136);this->buttonAdd->Margin = System::Windows::Forms::Padding(2);this->buttonAdd->Name = L"buttonAdd";this->buttonAdd->Size = System::Drawing::Size(98, 33);this->buttonAdd->TabIndex = 6;this->buttonAdd->Text = L"Добавить";this->buttonAdd->UseVisualStyleBackColor = true;this->buttonAdd->Click += gcnew System::EventHandler(this, &AddAcademicPositionForm::buttonAdd_Click);// // textBoxName// this->textBoxName->Location = System::Drawing::Point(44, 55);this->textBoxName->Margin = System::Windows::Forms::Padding(2);this->textBoxName->Name = L"textBoxName";this->textBoxName->Size = System::Drawing::Size(547, 22);this->textBoxName->TabIndex = 5;this->textBoxName->TextChanged += gcnew System::EventHandler(this, &AddAcademicPositionForm::textBoxName_TextChanged);// // label1// this->label1->AutoSize = true;this->label1->Location = System::Drawing::Point(41, 30);this->label1->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);this->label1->Name = L"label1";this->label1->Size = System::Drawing::Size(72, 17);this->label1->TabIndex = 4;this->label1->Text = L"Название";this->label1->Click += gcnew System::EventHandler(this, &AddAcademicPositionForm::label1_Click);// // AddAcademicPositionForm// this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;this->ClientSize = System::Drawing::Size(651, 193);this->Controls->Add(this->buttonCancel);this->Controls->Add(this->buttonAdd);this->Controls->Add(this->textBoxName);this->Controls->Add(this->label1);this->Name = L"AddAcademicPositionForm";this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;this->Text = L"Добавить учебную должность";this->ResumeLayout(false);this->PerformLayout();}#pragmaendregionprivate: System::Void buttonCancel_Click(System::Object^ sender, System::EventArgs^ e) {this->Close();}private: System::Void buttonAdd_Click(System::Object^ sender, System::EventArgs^ e) {if (this->textBoxName->Text->Trim()->Length > 0) {AcademicPositionsManager^ dpMng = gcnewAcademicPositionsManager();dpMng->Add(this->textBoxName->Text->Trim());this->Close();}}private: System::Void textBoxName_TextChanged(System::Object^ sender, System::EventArgs^ e) {}private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {}};}TeachersForm.hTeachersManager^ dataMng = nullptr;private: void loadData() {if (dataMng == nullptr)dataMng = gcnewTeachersManager();this->dataGridView1->DataSource = dataMng->Read();this->dataGridView1->Refresh();}private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {}private: System::Void buttonAdd_Click(System::Object^ sender, System::EventArgs^ e) {AddTeacherForm^ form = gcnewAddTeacherForm();form->ShowDialog();loadData();}private: System::Void buttonDelete_Click(System::Object^ sender, System::EventArgs^ e) {if (this->dataGridView1->SelectedRows->Count > 0){int id = (int)((DataRowView^)this->dataGridView1->SelectedRows[0]->DataBoundItem)->Row->ItemArray[0];if (dataMng == nullptr)dataMng = gcnewTeachersManager();dataMng->Delete(id);loadData();MessageBox::Show("Записьуспешноудалена!");}}private: System::Void TeahersForm_Load(System::Object^ sender, System::EventArgs^ e) {loadData();}private: System::Void dataGridView1_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {this->buttonDelete->Enabled = this->dataGridView1->SelectedRows->Count > 0;loadTeacherSubjects();}private: void loadTeacherSubjects() {if (this->dataGridView1->SelectedRows->Count > 0) {this->buttonAddSubject->Enabled = true;int teacher_id = (int)((DataRowView^)this->dataGridView1->SelectedRows[0]->DataBoundItem)->Row->ItemArray[0];if (dataMng == nullptr)dataMng = gcnewTeachersManager();this->dataGridViewSubjects->DataSource = dataMng->ReadSubjects(teacher_id);this->dataGridViewSubjects->Refresh();}else {this->buttonAddSubject->Enabled = false;this->buttonDeleteSubject->Enabled = false;//this->dataGridViewSubjects->Rows->Clear();}}private: System::Void dataGridViewSubjects_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {this->buttonDeleteSubject->Enabled = this->dataGridViewSubjects->SelectedRows->Count > 0;}private: System::Void buttonAddSubject_Click(System::Object^ sender, System::EventArgs^ e) {int teacher_id = (int)((DataRowView^)this->dataGridView1->SelectedRows[0]->DataBoundItem)->Row->ItemArray[0];AddTeacherSubjectForm^ form = gcnewAddTeacherSubjectForm(teacher_id);form->ShowDialog();loadTeacherSubjects();}private: System::Void buttonDeleteSubject_Click(System::Object^ sender, System::EventArgs^ e) {int teacherSubjectID = (int)((DataRowView^)this->dataGridViewSubjects->SelectedRows[0]->DataBoundItem)->Row->ItemArray[0];if (dataMng == nullptr)dataMng = gcnewTeachersManager();dataMng->DeleteSubject(teacherSubjectID);loadTeacherSubjects();}Form1.h#pragmaonce#include"DepartmentsForm.h"#include"SubjectsForm.h"#include"AcademicPositionsForm.h"#include"AcademicTitlesForm.h"#include"TeachersForm.h"namespace WinEducationPersonnel {usingnamespace System;usingnamespace System::ComponentModel;usingnamespace System::Collections;usingnamespace System::Windows::Forms;usingnamespace System::Data;usingnamespace System::Drawing;/// /// Summary for Form1/// publicrefclassForm1 : public System::Windows::Forms::Form{public:Form1(void){InitializeComponent();////TODO: Add the constructor code here//}protected:/// /// Clean up any resources being used./// ~Form1(){if (components){delete components;}}private: System::Windows::Forms::Panel^ panel1;private: System::Windows::Forms::Button^ buttonSubjects;private: System::Windows::Forms::Button^ buttonDepartments;private: System::Windows::Forms::Button^ buttonTeachers;private: System::Windows::Forms::Button^ buttonEditQualificationControlData;private: System::Windows::Forms::Button^ buttonHelp;private: System::Windows::Forms::PictureBox^ pictureBox1;private: System::Windows::Forms::Button^ buttonAcademicTitles;private: System::ComponentModel::IContainer^ components;protected:private:/// /// Required designer variable./// #pragmaregion Windows Form Designer generated code/// /// Required method for Designer support - do not modify/// the contents of this method with the code editor./// void InitializeComponent(void){System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));this->panel1 = (gcnew System::Windows::Forms::Panel());this->buttonAcademicTitles = (gcnew System::Windows::Forms::Button());this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());this->buttonHelp = (gcnew System::Windows::Forms::Button());this->buttonTeachers = (gcnew System::Windows::Forms::Button());this->buttonEditQualificationControlData = (gcnew System::Windows::Forms::Button());this->buttonSubjects = (gcnew System::Windows::Forms::Button());this->buttonDepartments = (gcnew System::Windows::Forms::Button());this->panel1->SuspendLayout();(cli::safe_cast(this->pictureBox1))->BeginInit();this->SuspendLayout();// // panel1// this->panel1->Controls->Add(this->buttonAcademicTitles);this->panel1->Controls->Add(this->pictureBox1);this->panel1->Controls->Add(this->buttonHelp);this->panel1->Controls->Add(this->buttonTeachers);this->panel1->Controls->Add(this->buttonEditQualificationControlData);this->panel1->Controls->Add(this->buttonSubjects);this->panel1->Controls->Add(this->buttonDepartments);this->panel1->Dock = System::Windows::Forms::DockStyle::Fill;this->panel1->Location = System::Drawing::Point(0, 0);this->panel1->Margin = System::Windows::Forms::Padding(2);this->panel1->Name = L"panel1";this->panel1->Size = System::Drawing::Size(495, 469);this->panel1->TabIndex = 1;// // buttonAcademicTitles// this->buttonAcademicTitles->Location = System::Drawing::Point(17, 380);this->buttonAcademicTitles->Margin = System::Windows::Forms::Padding(2);this->buttonAcademicTitles->Name = L"buttonAcademicTitles";this->buttonAcademicTitles->Size = System::Drawing::Size(142, 79);this->buttonAcademicTitles->TabIndex = 9;this->buttonAcademicTitles->Text = L"Ученыестепени";this->buttonAcademicTitles->UseVisualStyleBackColor = true;this->buttonAcademicTitles->Click += gcnew System::EventHandler(this, &Form1::buttonAcademicTitles_Click);// // pictureBox1// this->pictureBox1->Image = (cli::safe_cast(resources->GetObject(L"pictureBox1.Image")));this->pictureBox1->Location = System::Drawing::Point(17, 8);this->pictureBox1->Margin = System::Windows::Forms::Padding(2);this->pictureBox1->Name = L"pictureBox1";this->pictureBox1->Size = System::Drawing::Size(469, 265);this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;this->pictureBox1->TabIndex = 8;this->pictureBox1->TabStop = false;// // buttonHelp// this->buttonHelp->Image = (cli::safe_cast(resources->GetObject(L"buttonHelp.Image")));this->buttonHelp->Location = System::Drawing::Point(412, 392);this->buttonHelp->Margin = System::Windows::Forms::Padding(2);this->buttonHelp->Name = L"buttonHelp";this->buttonHelp->Size = System::Drawing::Size(73, 67);this->buttonHelp->TabIndex = 5;this->buttonHelp->UseVisualStyleBackColor = true;this->buttonHelp->Click += gcnew System::EventHandler(this, &Form1::buttonHelp_Click);// // buttonTeachers// this->buttonTeachers->Location = System::Drawing::Point(180, 380);this->buttonTeachers->Margin = System::Windows::Forms::Padding(2);this->buttonTeachers->Name = L"buttonTeachers";this->buttonTeachers->Size = System::Drawing::Size(142, 79);this->buttonTeachers->TabIndex = 4;this->buttonTeachers->Text = L"Преподаватели";this->buttonTeachers->UseVisualStyleBackColor = true;this->buttonTeachers->Click += gcnew System::EventHandler(this, &Form1::buttonTeachers_Click);// // buttonEditQualificationControlData// this->buttonEditQualificationControlData->Location = System::Drawing::Point(344, 284);this->buttonEditQualificationControlData->Margin = System::Windows::Forms::Padding(2);this->buttonEditQualificationControlData->Name = L"buttonEditQualificationControlData";this->buttonEditQualificationControlData->Size = System::Drawing::Size(142, 79);this->buttonEditQualificationControlData->TabIndex = 3;this->buttonEditQualificationControlData->Text = L"Учебныедолжности";this->buttonEditQualificationControlData->UseVisualStyleBackColor = true;this->buttonEditQualificationControlData->Click += gcnew System::EventHandler(this, &Form1::buttonEditQualificationControlData_Click);// // buttonSubjects// this->buttonSubjects->Location = System::Drawing::Point(180, 284);this->buttonSubjects->Margin = System::Windows::Forms::Padding(2);this->buttonSubjects->Name = L"buttonSubjects";this->buttonSubjects->Size = System::Drawing::Size(142, 79);this->buttonSubjects->TabIndex = 2;this->buttonSubjects->Text = L"Учебныепредметы";this->buttonSubjects->UseVisualStyleBackColor = true;this->buttonSubjects->Click += gcnew System::EventHandler(this, &Form1::buttonSubjects_Click);// // buttonDepartments// this->buttonDepartments->Location = System::Drawing::Point(17, 284);this->buttonDepartments->Margin = System::Windows::Forms::Padding(2);this->buttonDepartments->Name = L"buttonDepartments";this->buttonDepartments->Size = System::Drawing::Size(142, 79);this->buttonDepartments->TabIndex = 1;this->buttonDepartments->Text = L"Кафедры";this->buttonDepartments->UseVisualStyleBackColor = true;this->buttonDepartments->Click += gcnew System::EventHandler(this, &Form1::buttonDepartments_Click);// // Form1// this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;this->ClientSize = System::Drawing::Size(495, 469);this->Controls->Add(this->panel1);this->Margin = System::Windows::Forms::Padding(2);this->Name = L"Form1";this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;this->Text = L"Кадровый состав учебного заведения";this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);this->panel1->ResumeLayout(false);(cli::safe_cast(this->pictureBox1))->EndInit();this->ResumeLayout(false);}#pragmaendregionprivate: System::Void buttonDepartments_Click(System::Object^ sender, System::EventArgs^ e) {DepartmentsForm^ form = gcnewDepartmentsForm();form->ShowDialog();}private: System::Void buttonSubjects_Click(System::Object^ sender, System::EventArgs^ e) {SubjectsForm^ form = gcnewSubjectsForm();form->ShowDialog();}private: System::Void buttonEditQualificationControlData_Click(System::Object^ sender, System::EventArgs^ e) {AcademicPositionsForm^ form = gcnewAcademicPositionsForm();form->ShowDialog();}private: System::Void Form1_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {WEducationPConnectionParams::freeConnection();}private: System::Void buttonAcademicTitles_Click(System::Object^ sender, System::EventArgs^ e) {AcademicTitlesForm^ form = gcnewAcademicTitlesForm();form->ShowDialog();}private: System::Void buttonTeachers_Click(System::Object^ sender, System::EventArgs^ e) {TeachersForm^ form = gcnewTeachersForm();form->ShowDialog();}private: System::Void buttonHelp_Click(System::Object^ sender, System::EventArgs^ e) {MessageBox::Show("Программная реализация средствами С++ задачи определения качественного состава по кадрам в учебном заведении.");}};}
1 Грегори, Кейт Использование Visual C++ 6. Специальное издание / Кейт Грегори. - М.: Вильямс, 2022. - 864 c.
2 Stephen R. G. Fraser Pro Visual C++/CLI and the .NET 2.0 Platform / Stephen R. G. Fraser. - М.: APress, 2019. - 960 c.
3 Дэвидсон, Луис Проектирование баз данных на SQL Server 2000 / Луис Дэвидсон. - М.: Бином. Лаборатория знаний, 2021. - 662 c.
4 Дейт, К. Дж. SQL и реляционная теория. Как грамотно писать код на SQL / К.Дж. Дейт. - М.: Символ-плюс, 2017. - 480 c.
5 Джеймс Р. Грофф, Пол Н. Вайнберг, Эндрю Дж. Оппель SQL. Полное руководство; Вильямс - М., 2021. - 960 c.
6 Эйри, Джоунс Функции SQL. Справочник программиста / Джоунс Эйри. - М.: Диалектика / Вильямс, 2021. - 766 c.
7 Desktop Guide (Windows Forms .NET): https://learn.microsoft.com/en-us/dotnet/desktop/winforms/overview/?view=netdesktop-7.0
8 Importance Of Application Software: A Complete Guide URL: https://www.hyperlinkinfosystem.com/blog/importance-of-application-software