ПРОЕКТИРОВАНИЕ СТРУКТУРЫ И КОМПОНЕНТОВ ПРОГРАММНОГО ПРОДУКТА

Заказать уникальную курсовую работу
Тип работы: Курсовая работа
Предмет: Программирование
  • 39 39 страниц
  • 8 + 8 источников
  • Добавлена 28.10.2023
1 496 руб.
  • Содержание
  • Часть работы
  • Список литературы
ВВЕДЕНИЕ 2
1 АНАЛИЗ ТЕХНИЧЕСКИХ ТРЕБОВАНИЙ…………………………………..4
1.1 Предметная область исследования…………………………………………...4
1.2 Основы объектно-ориентированного программирования……………..……4
1.3 Описание функционала используемых технологий программирования для системы управления ремонтом автомашин.……………………………………..7
2 ПРОЕКТИРОВАНИЕ СТРУКТУРЫ И КОМПОНЕНТОВ ПРОГРАММНОГО ПРОДУКТА………………………………………………………………………..9
2.1 Проектирование и реализация классов приложения 9
2.2 Разработка пользовательского интерфейса 13
3 ТЕСТИРОВАНИЕ ПРИЛОЖЕНИЯ 19
ЗАКЛЮЧЕНИЕ 20
СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ 21
ПРИЛОЖЕНИЕ Код программы 22
Фрагмент для ознакомления

/// ~MainForm(){if (components){delete components;}}private: System::Windows::Forms::Panel^ panel1;private: System::Windows::Forms::Button^ bOrders;protected:private: System::Windows::Forms::Button^ bServices;private: System::Windows::Forms::Button^ bClients;private: System::Windows::Forms::Panel^ panel2;private: System::Windows::Forms::GroupBox^ groupBox1;private: System::Windows::Forms::Panel^ panel4;private: System::Windows::Forms::Panel^ panel3;private: System::Windows::Forms::Button^ bCompleteOrder;private: System::Windows::Forms::DataGridView^ dgvActiveOrders;private: System::Windows::Forms::Button^ bNewOrder;private: System::Windows::Forms::DataGridViewTextBoxColumn^ ID;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column1;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column2;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column3;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column4;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column5;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column6;protected:private:///

/// Required designer variable./// System::ComponentModel::Container^ components;#pragma region Windows Form Designer generated code#pragma endregionprivate: System::Void dgvActiveOrders_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {this->bCompleteOrder->Enabled = this->dgvActiveOrders->SelectedRows->Count > 0;}private: System::Void bClients_Click(System::Object^ sender, System::EventArgs^ e) {CarRepairManagement::ClientsForm^ fm = gcnew CarRepairManagement::ClientsForm();fm->ShowDialog();}private: System::Void bServices_Click(System::Object^ sender, System::EventArgs^ e) {CarRepairManagement::ServicesForm^ fm = gcnew CarRepairManagement::ServicesForm();fm->ShowDialog();}private: System::Void bNewOrder_Click(System::Object^ sender, System::EventArgs^ e) {CarRepairManagement::NewOrderForm^ fm = gcnew CarRepairManagement::NewOrderForm();fm->ShowDialog();refreshActiveOrders();}private: System::Void MainForm_Load(System::Object^ sender, System::EventArgs^ e) {Client::loadClients();Car::loadCars();CarService::loadServices();Order::loadOrders();refreshActiveOrders();}private: void refreshActiveOrders() {this->dgvActiveOrders->Rows->Clear();std::list items;Order::getActiveOrders(items);for (std::list::iterator it = items.begin(); it != items.end(); it++) {Client client(0, "", "", "");Client::getById(it->client_id, client);Car car(0, "", "", "", 0);Car::getById(it->car_id, car);this->dgvActiveOrders->Rows->Add(gcnew String(std::to_string(it->id).c_str()),gcnew String(it->create_date.c_str()),gcnew String(client.fio.c_str()),gcnew String(car.manufacturer.c_str()),gcnew String(car.model.c_str()),gcnew String(car.vin.c_str()),gcnew String(it->description.c_str()));}}private: System::Void bOrders_Click(System::Object^ sender, System::EventArgs^ e) {CarRepairManagement::OrdersForm^ fm = gcnew CarRepairManagement::OrdersForm();fm->ShowDialog();}private: System::Void MainForm_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {Client::saveClients();Car::saveCars();CarService::saveServices();Order::saveOrders();}private: std::string tostdstring(System::String^ s) {const char* p = (const char*)(Runtime::InteropServices::Marshal::StringToHGlobalAnsi(s)).ToPointer();std::string s1(p);Runtime::InteropServices::Marshal::FreeHGlobal(IntPtr((void*)p));return s1;}private: System::Void bCompleteOrder_Click(System::Object^ sender, System::EventArgs^ e) {int order_id = Int32::Parse(this->dgvActiveOrders->SelectedRows[0]->Cells[0]->Value->ToString());System::DateTime^ dtnow = System::DateTime::Now;std::string complete_date = tostdstring(dtnow->ToString());Order::complete(order_id, complete_date);refreshActiveOrders();}};}ClientsForm.h#pragma once#include "Client.h"#include "Car.h"#include "NewClientForm.h"#include "AddCarForm.h"namespace CarRepairManagement {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 for ClientsForm/// public ref class ClientsForm : public System::Windows::Forms::Form{public:ClientsForm(void){InitializeComponent();////TODO: Add the constructor code here//}protected:/// /// Clean up any resources being used./// ~ClientsForm(){if (components){delete components;}}private: System::Windows::Forms::Panel^ panel1;protected:private: System::Windows::Forms::Panel^ panel4;private: System::Windows::Forms::DataGridView^ dgvClients;private: System::Windows::Forms::Panel^ panel3;private: System::Windows::Forms::Panel^ panel2;private: System::Windows::Forms::GroupBox^ groupBox1;private: System::Windows::Forms::Panel^ panel6;private: System::Windows::Forms::DataGridView^ dgvCars;private: System::Windows::Forms::Panel^ panel5;private: System::Windows::Forms::Button^ bDeleteClient;private: System::Windows::Forms::Button^ bAddClient;private: System::Windows::Forms::Button^ bDeleteCar;private: System::Windows::Forms::Button^ bAddCar;private: System::Windows::Forms::DataGridViewTextBoxColumn^ ID;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column1;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column2;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column3;private: System::Windows::Forms::DataGridViewTextBoxColumn^ IDcar;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column6;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column4;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column5;protected:private:/// /// Required designer variable./// System::ComponentModel::Container^ components;#pragma region Windows Form Designer generated code#pragma endregionprivate: System::Void bAddClient_Click(System::Object^ sender, System::EventArgs^ e) {CarRepairManagement::NewClientForm^ fm = gcnew CarRepairManagement::NewClientForm();fm->ShowDialog();refreshClients();}private: System::Void dgvClients_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {bool flenabled = this->dgvClients->SelectedRows->Count > 0;this->bDeleteClient->Enabled = flenabled;this->bAddCar->Enabled = flenabled;if (!flenabled) {this->bDeleteCar->Enabled = false;}refreshClientCars();}private: void refreshClientCars() {if (this->dgvClients->SelectedRows->Count > 0) {int clientID = System::Int32::Parse(this->dgvClients->SelectedRows[0]->Cells[0]->Value->ToString());this->dgvCars->Rows->Clear();for (std::list::iterator it = Car::items.begin(); it != Car::items.end(); it++) {if (it->owner_id == clientID) {this->dgvCars->Rows->Add(gcnew String(std::to_string(it->id).c_str()),gcnew String(it->vin.c_str()),gcnew String(it->manufacturer.c_str()),gcnew String(it->model.c_str()));}}}else {this->dgvCars->Rows->Clear();}}private: System::Void dgvCars_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {this->bDeleteCar->Enabled = this->dgvCars->SelectedRows->Count > 0;}private: System::Void ClientsForm_Load(System::Object^ sender, System::EventArgs^ e) {refreshClients();}private: void refreshClients() {this->dgvClients->Rows->Clear();for (std::list::iterator it = Client::items.begin(); it != Client::items.end(); it++) {this->dgvClients->Rows->Add(gcnew String(std::to_string(it->id).c_str()),gcnew String(it->fio.c_str()),gcnew String(it->address.c_str()),gcnew String(it->contacts.c_str()));}}private: System::Void bDeleteClient_Click(System::Object^ sender, System::EventArgs^ e) {int client_id = Int32::Parse(this->dgvClients->SelectedRows[0]->Cells[0]->Value->ToString());Client::deleteById(client_id);refreshClients();}private: System::Void ClientsForm_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {}private: System::Void bAddCar_Click(System::Object^ sender, System::EventArgs^ e) {int client_id = Int32::Parse(this->dgvClients->SelectedRows[0]->Cells[0]->Value->ToString());CarRepairManagement::AddCarForm^ fm = gcnew CarRepairManagement::AddCarForm(client_id);fm->ShowDialog();refreshClientCars();}private: System::Void bDeleteCar_Click(System::Object^ sender, System::EventArgs^ e) {int car_id = Int32::Parse(this->dgvCars->SelectedRows[0]->Cells[0]->Value->ToString());Car::deleteById(car_id);refreshClientCars();}};}OrdersForm.h#pragma once#include "Order.h"#include "Client.h"#include "CarService.h"#include "Car.h"namespace CarRepairManagement {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 for OrdersForm/// public ref class OrdersForm : public System::Windows::Forms::Form{public:OrdersForm(void){InitializeComponent();////TODO: Add the constructor code here//}protected:/// /// Clean up any resources being used./// ~OrdersForm(){if (components){delete components;}}private: System::Windows::Forms::Panel^ panel1;protected:private: System::Windows::Forms::Panel^ panel2;private: System::Windows::Forms::GroupBox^ groupBox2;private: System::Windows::Forms::TextBox^ tbDescription;private: System::Windows::Forms::GroupBox^ groupBox1;private: System::Windows::Forms::ListBox^ lbServices;private: System::Windows::Forms::Button^ bDeleteOrder;private: System::Windows::Forms::Panel^ panel3;private: System::Windows::Forms::DataGridView^ dgvOrders;private: System::Windows::Forms::DataGridViewTextBoxColumn^ ID;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column1;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column7;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column2;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column3;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column4;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column5;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column6;private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column8;private:/// /// Required designer variable./// System::ComponentModel::Container^ components;#pragma region Windows Form Designer generated code#pragma endregionprivate: System::Void panel2_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {}private: System::Void dgvOrders_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {this->bDeleteOrder->Enabled = this->dgvOrders->SelectedRows->Count > 0;this->lbServices->Items->Clear();this->tbDescription->Text = "";if (this->dgvOrders->SelectedRows->Count > 0) {int order_id = Int32::Parse(this->dgvOrders->SelectedRows[0]->Cells[0]->Value->ToString());Order order(0, 0, 0, "", "", "", false, std::list());Order::getById(order_id, order);this->tbDescription->Text = gcnew String(order.description.c_str());for (std::list::iterator it = order.services.begin(); it != order.services.end(); it++) {CarService cs(0, "", "");CarService::getById(*it, cs);this->lbServices->Items->Add(gcnew String(cs.name.c_str()));}}}private: System::Void OrdersForm_Load(System::Object^ sender, System::EventArgs^ e) {refreshOrders();}private: void refreshOrders() {this->dgvOrders->Rows->Clear();Order::sortOrdersNewFirst();for (std::list::iterator it = Order::items.begin(); it != Order::items.end(); it++) {Client client(0, "", "", "");Client::getById(it->client_id, client);Car car(0, "", "", "", 0);Car::getById(it->car_id, car);this->dgvOrders->Rows->Add(gcnew String(std::to_string(it->id).c_str()),gcnew String(it->create_date.c_str()),it->completed ? gcnew String("завершен") : gcnew String("в работе"),gcnew String(client.fio.c_str()),gcnew String(car.manufacturer.c_str()),gcnew String(car.model.c_str()),gcnew String(car.vin.c_str()),gcnew String(it->description.c_str()),gcnew String(it->complete_date.c_str()));}}};}

1 Фридман, А.Л. Основы объектно-ориентированного программирования на языке Си++ / А.Л. Фридман. — М.: Гор. линия-Телеком, 2016. — 234 c.
2 Страуструп, Б. Язык программирования C++: Специальное издание / Б. Страуструп; Пер. с англ. Н.Н. Мартынов. — М.: БИНОМ, 2017. — 1136 c.
3 Васильев, А. Н. Программирование на C++ в примерах и задачах / А. Н. Васильев. – Москва : Эксмо, 2019. – 368 с.
4 Галовиц, Я. С++17 STL. Стандартная библиотека шаблонов / Я. Галовиц. – Санкт-Петербург : Питер, 2018. – 432 с.
5 Доусон, М. Изучаем C++ через программирование игр / М. Доусон. – Санкт-Петербург : Питер, 2018. – 352 с.
6 Липпман, С. Язык программирования С++. Базовый курс / С. Липпман. - М.: Вильямс И.Д., 2018. - 1120 c.
7 Обзор стандартной библиотеки C++ (STL) URL:https://learn.microsoft.com/ru-ru/cpp/standard-library/cpp-standard-library-overview?view=msvc-170
8 Visual Studio: IDE and Code Editor for Software Developers URL:https://visualstudio.microsoft.com/ru/