Professional Documents
Culture Documents
Автосервис курс
Автосервис курс
Вступ
1. Постановка задачі
1.1 Опис предметної області
1.2 Огляд аналогів ІС
1.3 Формування вимог до системи
2. Проектування системи
2.1 Розробка архітектури системи
2.2 Проектування бази даних
2.3. Опис структури даних
3. Реалізація інформаційної системи
YВисновок
Список літератури
Додаток А – Програмний код
АНОТАЦІЯ
ТО - Технічне обслуговування
ВСТУП
6. Додати клієнта:
Лістинг програми
CarForm.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Autoservice.Classes.Drawing;
namespace Autoservice.Forms
{
public partial class CarForm : Form
{
private readonly CarFormDrawingManager carFormDrawingManager;
CheckForIllegalCrossThreadCalls = false;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ctrlCFPanel = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// ctrlCFPanel
//
this.ctrlCFPanel.BackColor = System.Drawing.Color.White;
this.ctrlCFPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlCFPanel.Location = new System.Drawing.Point(0, 0);
this.ctrlCFPanel.Name = "ctrlCFPanel";
this.ctrlCFPanel.Size = new System.Drawing.Size(540, 390);
this.ctrlCFPanel.TabIndex = 0;
//
// CarForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(540, 390);
this.Controls.Add(this.ctrlCFPanel);
this.Name = "CarForm";
this.Text = "Автомобиль";
this.FormClosed += new
System.Windows.Forms.FormClosedEventHandler(this.CarForm_FormClosed);
this.ResumeLayout(false);
#endregion
ClientsForm.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Autoservice.Classes;
namespace Autoservice.Forms
{
public partial class ClientsForm : Form
{
private static object locker = new object();
public ClientsForm()
{
InitializeComponent();
Manager.GetInstance().AddHandler(UpdateDgv);
CheckForIllegalCrossThreadCalls = false;
}
public void UpdateDgv(List<string> clients)
{
lock (locker)
{
if (ctrlDGVClients == null)
return;
ctrlDGVClients.RowCount = 0;
ctrlDGVClients.ColumnCount = 1;
ctrlDGVClients.RowCount = clients.Count;
ctrlDGVClients.Columns[0].Width = ctrlDGVClients.Width;
for (int i = 0; i < clients.Count; i++)
{
if (ctrlDGVClients.RowCount == clients.Count)
ctrlDGVClients.Rows[i].Cells[0].Value = clients[i];
}
}
}
Manager.GetInstance().ShowClient(name);
//Close();
}
}
}
namespace Autoservice.Forms
{
partial class ClientsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ctrlDGVClients = new
System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)
(this.ctrlDGVClients)).BeginInit();
this.SuspendLayout();
//
// ctrlDGVClients
//
this.ctrlDGVClients.AllowUserToAddRows = false;
this.ctrlDGVClients.AllowUserToDeleteRows = false;
this.ctrlDGVClients.AllowUserToResizeColumns = false;
this.ctrlDGVClients.AllowUserToResizeRows = false;
this.ctrlDGVClients.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
;
this.ctrlDGVClients.ColumnHeadersVisible = false;
this.ctrlDGVClients.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlDGVClients.Location = new System.Drawing.Point(0, 0);
this.ctrlDGVClients.MultiSelect = false;
this.ctrlDGVClients.Name = "ctrlDGVClients";
this.ctrlDGVClients.ReadOnly = true;
this.ctrlDGVClients.RowHeadersVisible = false;
this.ctrlDGVClients.Size = new System.Drawing.Size(387, 231);
this.ctrlDGVClients.TabIndex = 0;
this.ctrlDGVClients.CellClick += new
System.Windows.Forms.DataGridViewCellEventHandler(this.ctrlDGVClients_Ce
llClick);
//
// ClientsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(387, 231);
this.Controls.Add(this.ctrlDGVClients);
this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "ClientsForm";
this.Text = "Клиенты";
this.FormClosed += new
System.Windows.Forms.FormClosedEventHandler(this.ClientsForm_FormClosed)
;
((System.ComponentModel.ISupportInitialize)
(this.ctrlDGVClients)).EndInit();
this.ResumeLayout(false);
#endregion
MainForm.cs
using System;
using System.Windows.Forms;
using Autoservice.Classes;
using Autoservice.Classes.Drawing;
namespace Autoservice.Forms
{
public partial class MainForm : Form
{
private readonly Manager manager;
private readonly MainFormDrawingManager drawManager;
public MainForm()
{
InitializeComponent();
drawManager = MainFormDrawingManager.GetInstance();
manager = Manager.GetInstance();
drawManager.SetCanvas(ctrlPanel);
drawManager.EventReDraw += OnPaint;
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true);
}
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс
должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources =
new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.ctrlTS = new System.Windows.Forms.ToolStrip();
this.ctrlTSMI_Menu = new
System.Windows.Forms.ToolStripDropDownButton();
this.ctrlTSMIHelp = new
System.Windows.Forms.ToolStripMenuItem();
this.ctrlPanel = new System.Windows.Forms.Panel();
this.ctrlTSMIStart = new
System.Windows.Forms.ToolStripMenuItem();
this.ctrlTSMIClientBox = new
System.Windows.Forms.ToolStripTextBox();
this.ctrlTSMIAddClient = new
System.Windows.Forms.ToolStripMenuItem();
this.ctrlTS.SuspendLayout();
this.SuspendLayout();
//
// ctrlTS
//
this.ctrlTS.Items.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.ctrlTSMI_Menu,
this.ctrlTSMIClientBox});
this.ctrlTS.Location = new System.Drawing.Point(0, 0);
this.ctrlTS.Name = "ctrlTS";
this.ctrlTS.Size = new System.Drawing.Size(800, 25);
this.ctrlTS.TabIndex = 0;
this.ctrlTS.Text = "toolStrip1";
//
// ctrlTSMI_Menu
//
this.ctrlTSMI_Menu.DisplayStyle =
System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.ctrlTSMI_Menu.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.ctrlTSMIHelp,
this.ctrlTSMIAddClient,
this.ctrlTSMIStart});
this.ctrlTSMI_Menu.Image = ((System.Drawing.Image)
(resources.GetObject("ctrlTSMI_Menu.Image")));
this.ctrlTSMI_Menu.ImageTransparentColor =
System.Drawing.Color.Magenta;
this.ctrlTSMI_Menu.Name = "ctrlTSMI_Menu";
this.ctrlTSMI_Menu.Size = new System.Drawing.Size(54, 22);
this.ctrlTSMI_Menu.Text = "Меню";
//
// ctrlTSMIHelp
//
this.ctrlTSMIHelp.Name = "ctrlTSMIHelp";
this.ctrlTSMIHelp.Size = new System.Drawing.Size(180, 22);
this.ctrlTSMIHelp.Text = "Помощь";
this.ctrlTSMIHelp.Click += new
System.EventHandler(this.ctrlTSMIHelp_Click);
//
// ctrlPanel
//
this.ctrlPanel.BackColor =
System.Drawing.SystemColors.ControlLightLight;
this.ctrlPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlPanel.Location = new System.Drawing.Point(0, 25);
this.ctrlPanel.Name = "ctrlPanel";
this.ctrlPanel.Size = new System.Drawing.Size(800, 425);
this.ctrlPanel.TabIndex = 1;
this.ctrlPanel.MouseClick += new
System.Windows.Forms.MouseEventHandler(this.ctrlPanel_MouseClick);
//
// ctrlTSMIStart
//
this.ctrlTSMIStart.Name = "ctrlTSMIStart";
this.ctrlTSMIStart.Size = new System.Drawing.Size(180, 22);
this.ctrlTSMIStart.Text = "Старт";
this.ctrlTSMIStart.Click += new
System.EventHandler(this.ctrlTSMIStart_Click);
//
// ctrlTSMIClientBox
//
this.ctrlTSMIClientBox.Name = "ctrlTSMIClientBox";
this.ctrlTSMIClientBox.ReadOnly = true;
this.ctrlTSMIClientBox.Size = new System.Drawing.Size(100, 25);
this.ctrlTSMIClientBox.Click += new
System.EventHandler(this.ctrlTSMIClientBox_Click);
//
// ctrlTSMIAddClient
//
this.ctrlTSMIAddClient.Name = "ctrlTSMIAddClient";
this.ctrlTSMIAddClient.Size = new System.Drawing.Size(180, 22);
this.ctrlTSMIAddClient.Text = "Добавить клиента";
this.ctrlTSMIAddClient.Click += new
System.EventHandler(this.ctrlTSMIAddCLient_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.ctrlPanel);
this.Controls.Add(this.ctrlTS);
this.Name = "MainForm";
this.Text = "Автосервис";
this.FormClosed += new
System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
this.ctrlTS.ResumeLayout(false);
this.ctrlTS.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
#endregion
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Autoservice.Forms
{
public partial class ServiceCreateForm : Form
{
public string ServiceName { get; set; }
public ServiceCreateForm()
{
InitializeComponent();
ServiceName = null;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ctrlTBName = new System.Windows.Forms.TextBox();
this.ctrlLblMiscName = new System.Windows.Forms.Label();
this.ctrlLblMiscWorkers = new System.Windows.Forms.Label();
this.ctrlLblMiscOffers = new System.Windows.Forms.Label();
this.ctrlNUDWorkers = new
System.Windows.Forms.NumericUpDown();
this.ctrlNUDOffers = new
System.Windows.Forms.NumericUpDown();
this.ctrlBtnOK = new System.Windows.Forms.Button();
this.ctrlBtnClose = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)
(this.ctrlNUDWorkers)).BeginInit();
((System.ComponentModel.ISupportInitialize)
(this.ctrlNUDOffers)).BeginInit();
this.SuspendLayout();
//
// ctrlTBName
//
this.ctrlTBName.Location = new System.Drawing.Point(87, 6);
this.ctrlTBName.Name = "ctrlTBName";
this.ctrlTBName.Size = new System.Drawing.Size(148, 20);
this.ctrlTBName.TabIndex = 0;
//
// ctrlLblMiscName
//
this.ctrlLblMiscName.AutoSize = true;
this.ctrlLblMiscName.Location = new System.Drawing.Point(12, 9);
this.ctrlLblMiscName.Name = "ctrlLblMiscName";
this.ctrlLblMiscName.Size = new System.Drawing.Size(60, 13);
this.ctrlLblMiscName.TabIndex = 1;
this.ctrlLblMiscName.Text = "Название:";
//
// ctrlLblMiscWorkers
//
this.ctrlLblMiscWorkers.AutoSize = true;
this.ctrlLblMiscWorkers.Location = new System.Drawing.Point(12,
43);
this.ctrlLblMiscWorkers.Name = "ctrlLblMiscWorkers";
this.ctrlLblMiscWorkers.Size = new System.Drawing.Size(64, 13);
this.ctrlLblMiscWorkers.TabIndex = 1;
this.ctrlLblMiscWorkers.Text = "Работники:";
//
// ctrlLblMiscOffers
//
this.ctrlLblMiscOffers.AutoSize = true;
this.ctrlLblMiscOffers.Location = new System.Drawing.Point(12,
77);
this.ctrlLblMiscOffers.Name = "ctrlLblMiscOffers";
this.ctrlLblMiscOffers.Size = new System.Drawing.Size(46, 13);
this.ctrlLblMiscOffers.TabIndex = 1;
this.ctrlLblMiscOffers.Text = "Услуги:";
//
// ctrlNUDWorkers
//
this.ctrlNUDWorkers.Location = new System.Drawing.Point(87,
41);
this.ctrlNUDWorkers.Name = "ctrlNUDWorkers";
this.ctrlNUDWorkers.Size = new System.Drawing.Size(148, 20);
this.ctrlNUDWorkers.TabIndex = 2;
this.ctrlNUDWorkers.ValueChanged += new
System.EventHandler(this.ctrlNUDWorkers_ValueChanged);
//
// ctrlNUDOffers
//
this.ctrlNUDOffers.Location = new System.Drawing.Point(87, 75);
this.ctrlNUDOffers.Name = "ctrlNUDOffers";
this.ctrlNUDOffers.Size = new System.Drawing.Size(148, 20);
this.ctrlNUDOffers.TabIndex = 2;
this.ctrlNUDOffers.ValueChanged += new
System.EventHandler(this.ctrlNUDOffers_ValueChanged);
//
// ctrlBtnOK
//
this.ctrlBtnOK.DialogResult =
System.Windows.Forms.DialogResult.OK;
this.ctrlBtnOK.Location = new System.Drawing.Point(160, 137);
this.ctrlBtnOK.Name = "ctrlBtnOK";
this.ctrlBtnOK.Size = new System.Drawing.Size(75, 23);
this.ctrlBtnOK.TabIndex = 3;
this.ctrlBtnOK.Text = "ОК";
this.ctrlBtnOK.UseVisualStyleBackColor = true;
this.ctrlBtnOK.Click += new
System.EventHandler(this.ctrlBtnOK_Click);
//
// ctrlBtnClose
//
this.ctrlBtnClose.DialogResult =
System.Windows.Forms.DialogResult.Cancel;
this.ctrlBtnClose.Location = new System.Drawing.Point(15, 137);
this.ctrlBtnClose.Name = "ctrlBtnClose";
this.ctrlBtnClose.Size = new System.Drawing.Size(75, 23);
this.ctrlBtnClose.TabIndex = 3;
this.ctrlBtnClose.Text = "Отмена";
this.ctrlBtnClose.UseVisualStyleBackColor = true;
this.ctrlBtnClose.Click += new
System.EventHandler(this.ctrlBtnClose_Click);
//
// ServiceCreateForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(247, 172);
this.Controls.Add(this.ctrlBtnClose);
this.Controls.Add(this.ctrlBtnOK);
this.Controls.Add(this.ctrlNUDOffers);
this.Controls.Add(this.ctrlNUDWorkers);
this.Controls.Add(this.ctrlLblMiscOffers);
this.Controls.Add(this.ctrlLblMiscWorkers);
this.Controls.Add(this.ctrlLblMiscName);
this.Controls.Add(this.ctrlTBName);
this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ServiceCreateForm";
this.Text = "Создание сервиса";
((System.ComponentModel.ISupportInitialize)
(this.ctrlNUDWorkers)).EndInit();
((System.ComponentModel.ISupportInitialize)
(this.ctrlNUDOffers)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
#endregion
namespace Autoservice.Forms
{
public partial class ServiceForm : Form
{
private MaintenanceServiceWrapper service;
CheckForIllegalCrossThreadCalls = false;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ctrlSFDGV_offers = new
System.Windows.Forms.DataGridView();
this.ctrlSFLblOffers = new System.Windows.Forms.Label();
this.ctrlBtnClients = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)
(this.ctrlSFDGV_offers)).BeginInit();
this.SuspendLayout();
//
// ctrlSFDGV_offers
//
this.ctrlSFDGV_offers.AllowUserToAddRows = false;
this.ctrlSFDGV_offers.AllowUserToDeleteRows = false;
this.ctrlSFDGV_offers.AllowUserToResizeRows = false;
this.ctrlSFDGV_offers.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
;
this.ctrlSFDGV_offers.ColumnHeadersVisible = false;
this.ctrlSFDGV_offers.Location = new System.Drawing.Point(12,
25);
this.ctrlSFDGV_offers.MultiSelect = false;
this.ctrlSFDGV_offers.Name = "ctrlSFDGV_offers";
this.ctrlSFDGV_offers.ReadOnly = true;
this.ctrlSFDGV_offers.RowHeadersVisible = false;
this.ctrlSFDGV_offers.Size = new System.Drawing.Size(345, 150);
this.ctrlSFDGV_offers.TabIndex = 0;
//
// ctrlSFLblOffers
//
this.ctrlSFLblOffers.AutoSize = true;
this.ctrlSFLblOffers.Location = new System.Drawing.Point(9, 9);
this.ctrlSFLblOffers.Name = "ctrlSFLblOffers";
this.ctrlSFLblOffers.Size = new System.Drawing.Size(46, 13);
this.ctrlSFLblOffers.TabIndex = 1;
this.ctrlSFLblOffers.Text = "Услуги:";
//
// ctrlBtnClients
//
this.ctrlBtnClients.Location = new System.Drawing.Point(12, 193);
this.ctrlBtnClients.Name = "ctrlBtnClients";
this.ctrlBtnClients.Size = new System.Drawing.Size(167, 23);
this.ctrlBtnClients.TabIndex = 2;
this.ctrlBtnClients.Text = "Показать всех клиентов";
this.ctrlBtnClients.UseVisualStyleBackColor = true;
this.ctrlBtnClients.Click += new
System.EventHandler(this.ctrlBtnClients_Click);
//
// ServiceForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(381, 228);
this.Controls.Add(this.ctrlBtnClients);
this.Controls.Add(this.ctrlSFLblOffers);
this.Controls.Add(this.ctrlSFDGV_offers);
this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ServiceForm";
this.Text = "Сервис";
((System.ComponentModel.ISupportInitialize)
(this.ctrlSFDGV_offers)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
#endregion