Лабораторная №1

This commit is contained in:
Vladislave 2024-11-21 20:45:28 +03:00
parent 3a0bb5ba9d
commit 6e64bcebf7
61 changed files with 4974 additions and 50 deletions

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Entities.Enums;
[Flags]
public enum BrokenElements
{
None = 0,
Wheels = 1,
Headlights = 2,
Engine = 4,
Transmission = 8
}

View File

@ -0,0 +1,20 @@
namespace ProjectTransportation.Entities.Enums;
public class Bus
{
public int Id { get; private set; }
public string LicensePlate { get; private set; } = string.Empty;
public string Model { get; private set; } = string.Empty;
public static Bus CreateEntity(int id, string licensePlate, string model)
{
return new Bus
{
Id = id,
LicensePlate = licensePlate,
Model = model
};
}
}

View File

@ -0,0 +1,23 @@
namespace ProjectTransportation.Entities.Enums;
public class Employee
{
public int Id { get; private set; }
public string FirstName { get; private set; } = string.Empty;
public string LastName { get; private set; } = string.Empty;
public EmployeePost Post { get; private set; }
public static Employee CreateEntity(int id, string first, string last, EmployeePost post)
{
return new Employee
{
Id = id,
FirstName = first ?? string.Empty,
LastName = last ?? string.Empty,
Post = post
};
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Entities.Enums;
public enum EmployeePost
{
None = 0,
Administration = 1,
Engineer = 2,
Driver = 3,
Conductor = 4
}

View File

@ -0,0 +1,26 @@
namespace ProjectTransportation.Entities.Enums;
public class GoToService
{
public int Id { get; private set; }
public DateTime Date { get; private set; }
public BrokenElements BrokenElements { get; private set; }
public int Price { get; private set; }
public int BusId { get; private set; }
public static GoToService CreateOperation(int id, BrokenElements brokenElements, int price, int busId)
{
return new GoToService
{
Id = id,
Date = DateTime.Now,
BrokenElements = brokenElements,
Price = price,
BusId = busId
};
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Entities;
public class RouteList
{
public int Id { get; private set; }
public TimeOnly Start { get; private set; }
public TimeOnly Finish { get; private set; }
public static RouteList CreateEntity(int id, TimeOnly start, TimeOnly finish)
{
return new RouteList
{
Id = id,
Start = start,
Finish = finish
};
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Entities;
public class StartingShift
{
public int Id { get; private set; }
public DateTime Date { get; private set; }
public int RouteListId { get; private set; }
public int BusId { get; private set; }
public IEnumerable<StartingShiftEmployee> StartingShiftEmployees { get; private set; } = [];
public static StartingShift CreateOperation(int id, int routeListId, int busId,
IEnumerable<StartingShiftEmployee> startingShiftEmployees)
{
return new StartingShift()
{
Id = id,
Date = DateTime.Now,
RouteListId = routeListId,
BusId = busId,
StartingShiftEmployees = startingShiftEmployees
};
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Entities;
public class StartingShiftEmployee
{
public int StartingShiftId { get; private set; }
public int EmployeeId { get; private set; }
public int WorkHours { get; private set; }
public static StartingShiftEmployee CreateElement(int startingShiftId, int employeeId, int workHours)
{
return new StartingShiftEmployee
{
StartingShiftId = startingShiftId,
EmployeeId = employeeId,
WorkHours = workHours
};
}
}

View File

@ -1,39 +0,0 @@
namespace ProjectTransportation
{
partial class Form1
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@ -1,10 +0,0 @@
namespace ProjectTransportation
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,144 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation
{
partial class FormTransportation
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
menuStrip1 = new MenuStrip();
справочникиToolStripMenuItem = new ToolStripMenuItem();
EmployeesToolStripMenuItem = new ToolStripMenuItem();
BusesToolStripMenuItem = new ToolStripMenuItem();
RouteListsToolStripMenuItem = new ToolStripMenuItem();
операцииToolStripMenuItem = new ToolStripMenuItem();
StartingShiftsToolStripMenuItem = new ToolStripMenuItem();
GoToServicesToolStripMenuItem = new ToolStripMenuItem();
отчётыToolStripMenuItem = new ToolStripMenuItem();
menuStrip1.SuspendLayout();
SuspendLayout();
//
// menuStrip1
//
menuStrip1.ImageScalingSize = new Size(28, 28);
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчётыToolStripMenuItem });
menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Padding = new Padding(4, 1, 0, 1);
menuStrip1.Size = new Size(739, 26);
menuStrip1.TabIndex = 0;
menuStrip1.Text = "menuStrip1";
//
// справочникиToolStripMenuItem
//
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { EmployeesToolStripMenuItem, BusesToolStripMenuItem, RouteListsToolStripMenuItem });
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
справочникиToolStripMenuItem.Size = new Size(117, 24);
справочникиToolStripMenuItem.Text = "Справочники";
//
// EmployeesToolStripMenuItem
//
EmployeesToolStripMenuItem.Name = "EmployeesToolStripMenuItem";
EmployeesToolStripMenuItem.Size = new Size(167, 26);
EmployeesToolStripMenuItem.Text = "Работники";
EmployeesToolStripMenuItem.Click += EmployeesToolStripMenuItem_Click;
//
// BusesToolStripMenuItem
//
BusesToolStripMenuItem.Name = "BusesToolStripMenuItem";
BusesToolStripMenuItem.Size = new Size(167, 26);
BusesToolStripMenuItem.Text = "Автобусы";
BusesToolStripMenuItem.Click += BusesToolStripMenuItem_Click;
//
// RouteListsToolStripMenuItem
//
RouteListsToolStripMenuItem.Name = "RouteListsToolStripMenuItem";
RouteListsToolStripMenuItem.Size = new Size(167, 26);
RouteListsToolStripMenuItem.Text = "Маршруты";
RouteListsToolStripMenuItem.Click += RouteListsToolStripMenuItem_Click;
//
// операцииToolStripMenuItem
//
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { StartingShiftsToolStripMenuItem, GoToServicesToolStripMenuItem });
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
операцииToolStripMenuItem.Size = new Size(95, 24);
операцииToolStripMenuItem.Text = "Операции";
//
// StartingShiftsToolStripMenuItem
//
StartingShiftsToolStripMenuItem.Name = "StartingShiftsToolStripMenuItem";
StartingShiftsToolStripMenuItem.Size = new Size(224, 26);
StartingShiftsToolStripMenuItem.Text = "Начало смены";
StartingShiftsToolStripMenuItem.Click += StartingShiftsToolStripMenuItem_Click;
//
// GoToServicesToolStripMenuItem
//
GoToServicesToolStripMenuItem.Name = "GoToServicesToolStripMenuItem";
GoToServicesToolStripMenuItem.Size = new Size(224, 26);
GoToServicesToolStripMenuItem.Text = "Тех. обслуживание";
GoToServicesToolStripMenuItem.Click += GoToServicesToolStripMenuItem_Click;
//
// отчётыToolStripMenuItem
//
отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem";
отчётыToolStripMenuItem.Size = new Size(73, 24);
отчётыToolStripMenuItem.Text = "Отчёты";
//
// FormTransportation
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources._1;
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(739, 424);
Controls.Add(menuStrip1);
MainMenuStrip = menuStrip1;
Margin = new Padding(2, 2, 2, 2);
Name = "FormTransportation";
StartPosition = FormStartPosition.CenterScreen;
Text = "Пассажирские перевозки";
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
private MenuStrip menuStrip1;
private ToolStripMenuItem справочникиToolStripMenuItem;
private ToolStripMenuItem EmployeesToolStripMenuItem;
private ToolStripMenuItem BusesToolStripMenuItem;
private ToolStripMenuItem RouteListsToolStripMenuItem;
private ToolStripMenuItem операцииToolStripMenuItem;
private ToolStripMenuItem отчётыToolStripMenuItem;
private ToolStripMenuItem StartingShiftsToolStripMenuItem;
private ToolStripMenuItem GoToServicesToolStripMenuItem;
}
}

View File

@ -0,0 +1,76 @@
using ProjectTransportation.Forms;
using Unity;
namespace ProjectTransportation
{
public partial class FormTransportation : Form
{
private readonly IUnityContainer _container;
public FormTransportation(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void EmployeesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormEmployees>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void BusesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormBuses>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void RouteListsToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormRouteLists>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void StartingShiftsToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormStartingShifts>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void GoToServicesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormGoToServices>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,133 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormBus
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
labelLicensePlate = new Label();
textBoxLicensePlate = new TextBox();
labelBusTypeName = new Label();
buttonSave = new Button();
buttonCancel = new Button();
textBoxModel = new TextBox();
SuspendLayout();
//
// labelLicensePlate
//
labelLicensePlate.AutoSize = true;
labelLicensePlate.Location = new Point(18, 23);
labelLicensePlate.Margin = new Padding(2, 0, 2, 0);
labelLicensePlate.Name = "labelLicensePlate";
labelLicensePlate.Size = new Size(78, 20);
labelLicensePlate.TabIndex = 0;
labelLicensePlate.Text = "Госномер";
//
// textBoxLicensePlate
//
textBoxLicensePlate.Location = new Point(154, 21);
textBoxLicensePlate.Margin = new Padding(2, 2, 2, 2);
textBoxLicensePlate.MaxLength = 10;
textBoxLicensePlate.Name = "textBoxLicensePlate";
textBoxLicensePlate.Size = new Size(161, 27);
textBoxLicensePlate.TabIndex = 1;
//
// labelBusTypeName
//
labelBusTypeName.AutoSize = true;
labelBusTypeName.Location = new Point(18, 66);
labelBusTypeName.Margin = new Padding(2, 0, 2, 0);
labelBusTypeName.Name = "labelBusTypeName";
labelBusTypeName.Size = new Size(129, 20);
labelBusTypeName.TabIndex = 2;
labelBusTypeName.Text = "Модель автобуса";
//
// buttonSave
//
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.Location = new Point(48, 152);
buttonSave.Margin = new Padding(2, 2, 2, 2);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(117, 33);
buttonSave.TabIndex = 6;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Location = new Point(266, 152);
buttonCancel.Margin = new Padding(2, 2, 2, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(120, 33);
buttonCancel.TabIndex = 7;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// textBoxModel
//
textBoxModel.Location = new Point(154, 64);
textBoxModel.Margin = new Padding(2, 2, 2, 2);
textBoxModel.MaxLength = 10;
textBoxModel.Name = "textBoxModel";
textBoxModel.Size = new Size(161, 27);
textBoxModel.TabIndex = 8;
//
// FormBus
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(444, 194);
Controls.Add(textBoxModel);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(labelBusTypeName);
Controls.Add(textBoxLicensePlate);
Controls.Add(labelLicensePlate);
Margin = new Padding(2, 2, 2, 2);
Name = "FormBus";
StartPosition = FormStartPosition.CenterParent;
Text = "Автобус";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelLicensePlate;
private TextBox textBoxLicensePlate;
private Label labelBusTypeName;
private Button buttonSave;
private Button buttonCancel;
private TextBox textBoxModel;
}
}

View File

@ -0,0 +1,76 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Entities.Enums;
using ProjectTransportation.Repositories;
using ProjectTransportation.Entities.Enums;
using ProjectTransportation.Repositories;
namespace ProjectTransportation.Forms
{
public partial class FormBus : Form
{
private readonly IBusRepository _busRepository;
private int? _busId;
public int Id
{
set
{
try
{
var bus = _busRepository.ReadBusById(value);
if (bus == null)
{
throw new InvalidDataException(nameof(bus));
}
textBoxLicensePlate.Text = bus.LicensePlate;
textBoxModel.Text = bus.Model;
_busId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormBus(IBusRepository busRepository)
{
InitializeComponent();
_busRepository = busRepository ?? throw new ArgumentNullException(nameof(busRepository));
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(textBoxLicensePlate.Text) || string.IsNullOrWhiteSpace(textBoxModel.Text))
{
throw new Exception("Имеются незаполненные поля");
}
if (_busId.HasValue)
{
_busRepository.UpdateBus(CreateBus(_busId.Value));
}
else
{
_busRepository.CreateBus(CreateBus(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Bus CreateBus(int id) => Bus.CreateEntity(id, textBoxLicensePlate.Text, textBoxModel.Text);
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,138 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormBuses
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBuses));
panelButtons = new Panel();
buttonDelete = new Button();
buttonUpdate = new Button();
buttonAdd = new Button();
dataGridViewData = new DataGridView();
panelButtons.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
SuspendLayout();
//
// panelButtons
//
panelButtons.Controls.Add(buttonDelete);
panelButtons.Controls.Add(buttonUpdate);
panelButtons.Controls.Add(buttonAdd);
panelButtons.Dock = DockStyle.Right;
panelButtons.Location = new Point(563, 0);
panelButtons.Margin = new Padding(2, 2, 2, 2);
panelButtons.Name = "panelButtons";
panelButtons.Size = new Size(131, 321);
panelButtons.TabIndex = 0;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.minus;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(33, 168);
buttonDelete.Margin = new Padding(2, 2, 2, 2);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(67, 67);
buttonDelete.TabIndex = 2;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonUpdate
//
buttonUpdate.BackgroundImage = Properties.Resources.i;
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
buttonUpdate.Location = new Point(33, 97);
buttonUpdate.Margin = new Padding(2, 2, 2, 2);
buttonUpdate.Name = "buttonUpdate";
buttonUpdate.Size = new Size(67, 67);
buttonUpdate.TabIndex = 1;
buttonUpdate.UseVisualStyleBackColor = true;
buttonUpdate.Click += ButtonUpdate_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = (System.Drawing.Image)resources.GetObject("buttonAdd.BackgroundImage");
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(33, 26);
buttonAdd.Margin = new Padding(2, 2, 2, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(67, 67);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// dataGridViewData
//
dataGridViewData.AllowUserToAddRows = false;
dataGridViewData.AllowUserToDeleteRows = false;
dataGridViewData.AllowUserToResizeColumns = false;
dataGridViewData.AllowUserToResizeRows = false;
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewData.Dock = DockStyle.Fill;
dataGridViewData.Location = new Point(0, 0);
dataGridViewData.Margin = new Padding(2, 2, 2, 2);
dataGridViewData.MultiSelect = false;
dataGridViewData.Name = "dataGridViewData";
dataGridViewData.ReadOnly = true;
dataGridViewData.RowHeadersVisible = false;
dataGridViewData.RowHeadersWidth = 72;
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridViewData.Size = new Size(563, 321);
dataGridViewData.TabIndex = 1;
//
// FormBuses
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(694, 321);
Controls.Add(dataGridViewData);
Controls.Add(panelButtons);
Margin = new Padding(2, 2, 2, 2);
Name = "FormBuses";
StartPosition = FormStartPosition.CenterParent;
Text = "Автобусы";
Load += FormBuses_Load;
panelButtons.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panelButtons;
private Button buttonDelete;
private Button buttonUpdate;
private Button buttonAdd;
private DataGridView dataGridViewData;
}
}

View File

@ -0,0 +1,104 @@
using ProjectTransportation.Repositories;
using ProjectTransportation.Forms;
using ProjectTransportation.Repositories;
using Unity;
namespace ProjectTransportation.Forms
{
public partial class FormBuses : Form
{
private readonly IUnityContainer _container;
private readonly IBusRepository _busRepository;
public FormBuses(IUnityContainer container, IBusRepository busRepository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_busRepository = busRepository ?? throw new ArgumentNullException(nameof(busRepository));
}
private void FormBuses_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormBus>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpdate_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
try
{
var form = _container.Resolve<FormBus>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_busRepository.DeleteBus(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridViewData.DataSource = _busRepository.ReadBuses();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridViewData.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,316 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonAdd.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsN
DhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQU
FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAEOAQ4DASIAAhEBAxEB/8QA
HwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVW
V1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG
x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQF
BgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJB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VLML1aS1fb+eMVy0lnNCcSRSRn0ZCK8+UXHSSsfL1KFWi+WpBp+aIt1GaGXYQCcUoUnsT9BUaGNh
tFWrbS7y8kCW9pNOzdBHGWJ/AV3Phv8AZ9+Ifizb/Z/hPUmRuks0Jhj/AO+nwK0jGU9Iq500sLXrvlpQ
cn5Js88pQuc+3419T+Df2A/FeqPHJ4i1ex0SEnDRwH7RMPpjC/rX0Z8Ov2P/AIeeBWiuJdObX79OftGq
ESKD6iP7v55r0aWW4io9VyrzPrMFwjmWKadSPs4/3t/u3/I+Evhl+z/40+K1wn9j6U8djnD6jdgxQJ/w
I/e+i5NfbXwX/Y58K/DbyNS1bb4k1xPmEtzH+4hbPVIzwSP7zfgBXv0NnFbwrFFGscSjCxoMKB6AdqmV
dq4r6HDZbSoWlL3mfp2VcK4HLWqk17Sfd7L0RGsIVcVIo2jFLRXrH2gUUUUAFFFFABRRRQAUUUUAFFFF
ABRRRQAUUUUAFFFFABRRRQAUUUUAN20nlin0UAR+SOeePSs2+8K6PqRY3mlWN0W6+dbI+fzFa1FJpPcl
xjJWaucpJ8KfBkrbn8J6Ix/7B8X/AMTUlv8AC/wfasGh8LaNE3qthED/AOg109FR7OHYx+rUE78i+5FG
x0Sw01dtpZ29qvpDEqfyFW/LFPoq0ktjeMVFWSGeWM5pyrtpaKYwooooAKKKKACiiigAooooAKKKKACi
iigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACi
iigAooooAKKKKAP/2Q==
</value>
</data>
</root>

View File

@ -0,0 +1,158 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormEmployee
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
comboBoxPost = new ComboBox();
buttonCancel = new Button();
buttonSave = new Button();
textBoxLastName = new TextBox();
labelLastName = new Label();
textBoxFirstName = new TextBox();
labelFirstName = new Label();
labelPost = new Label();
SuspendLayout();
//
// comboBoxPost
//
comboBoxPost.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxPost.FormattingEnabled = true;
comboBoxPost.Location = new Point(155, 111);
comboBoxPost.Margin = new Padding(2, 2, 2, 2);
comboBoxPost.Name = "comboBoxPost";
comboBoxPost.Size = new Size(161, 28);
comboBoxPost.TabIndex = 0;
//
// buttonCancel
//
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Location = new Point(214, 163);
buttonCancel.Margin = new Padding(2, 2, 2, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(90, 33);
buttonCancel.TabIndex = 14;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// buttonSave
//
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.Location = new Point(53, 163);
buttonSave.Margin = new Padding(2, 2, 2, 2);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(99, 33);
buttonSave.TabIndex = 13;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// textBoxLastName
//
textBoxLastName.Location = new Point(155, 63);
textBoxLastName.Margin = new Padding(2, 2, 2, 2);
textBoxLastName.Name = "textBoxLastName";
textBoxLastName.Size = new Size(161, 27);
textBoxLastName.TabIndex = 11;
//
// labelLastName
//
labelLastName.AutoSize = true;
labelLastName.Location = new Point(19, 65);
labelLastName.Margin = new Padding(2, 0, 2, 0);
labelLastName.Name = "labelLastName";
labelLastName.Size = new Size(73, 20);
labelLastName.TabIndex = 10;
labelLastName.Text = "Фамилия";
//
// textBoxFirstName
//
textBoxFirstName.Location = new Point(155, 19);
textBoxFirstName.Margin = new Padding(2, 2, 2, 2);
textBoxFirstName.MaxLength = 10;
textBoxFirstName.Name = "textBoxFirstName";
textBoxFirstName.Size = new Size(161, 27);
textBoxFirstName.TabIndex = 9;
//
// labelFirstName
//
labelFirstName.AutoSize = true;
labelFirstName.Location = new Point(19, 21);
labelFirstName.Margin = new Padding(2, 0, 2, 0);
labelFirstName.Name = "labelFirstName";
labelFirstName.Size = new Size(39, 20);
labelFirstName.TabIndex = 8;
labelFirstName.Text = "Имя";
//
// labelPost
//
labelPost.AutoSize = true;
labelPost.Location = new Point(19, 113);
labelPost.Margin = new Padding(2, 0, 2, 0);
labelPost.Name = "labelPost";
labelPost.Size = new Size(86, 20);
labelPost.TabIndex = 15;
labelPost.Text = "Должность";
//
// FormEmployee
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(353, 211);
Controls.Add(labelPost);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(textBoxLastName);
Controls.Add(labelLastName);
Controls.Add(textBoxFirstName);
Controls.Add(labelFirstName);
Controls.Add(comboBoxPost);
Margin = new Padding(2, 2, 2, 2);
Name = "FormEmployee";
StartPosition = FormStartPosition.CenterParent;
Text = "FormEmployee";
ResumeLayout(false);
PerformLayout();
}
#endregion
private ComboBox comboBoxPost;
private Button buttonCancel;
private Button buttonSave;
private TextBox textBoxLastName;
private Label labelLastName;
private TextBox textBoxFirstName;
private Label labelFirstName;
private Label labelPost;
}
}

View File

@ -0,0 +1,79 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Entities.Enums;
using ProjectTransportation.Repositories;
using ProjectTransportation.Entities.Enums;
using ProjectTransportation.Repositories;
namespace ProjectTransportation.Forms
{
public partial class FormEmployee : Form
{
private readonly IEmployeeRepository _employeeRepository;
private int? _employeeId;
public int Id
{
set
{
try
{
var employee = _employeeRepository.ReadEmployeeById(value);
if (employee == null)
{
throw new InvalidDataException(nameof(employee));
}
textBoxFirstName.Text = employee.FirstName;
textBoxLastName.Text = employee.LastName;
comboBoxPost.SelectedItem = employee.Post;
_employeeId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormEmployee(IEmployeeRepository employeeRepository)
{
InitializeComponent();
_employeeRepository = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository));
comboBoxPost.DataSource = Enum.GetValues(typeof(EmployeePost));
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(textBoxFirstName.Text) || string.IsNullOrWhiteSpace(textBoxLastName.Text)
|| comboBoxPost.SelectedIndex < 1)
{
throw new Exception("Имеются незаполненные поля");
}
if (_employeeId.HasValue)
{
_employeeRepository.UpdateEmployee(CreateEmployee(_employeeId.Value));
}
else
{
_employeeRepository.CreateEmployee(CreateEmployee(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Employee CreateEmployee(int id) => Employee.CreateEntity(id, textBoxFirstName.Text,
textBoxLastName.Text, (EmployeePost)comboBoxPost.SelectedItem!);
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,138 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormEmployees
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormEmployees));
dataGridViewData = new DataGridView();
panelButtons = new Panel();
buttonDelete = new Button();
buttonUpdate = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
panelButtons.SuspendLayout();
SuspendLayout();
//
// dataGridViewData
//
dataGridViewData.AllowUserToAddRows = false;
dataGridViewData.AllowUserToDeleteRows = false;
dataGridViewData.AllowUserToResizeColumns = false;
dataGridViewData.AllowUserToResizeRows = false;
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewData.Dock = DockStyle.Fill;
dataGridViewData.Location = new Point(0, 0);
dataGridViewData.Margin = new Padding(2, 2, 2, 2);
dataGridViewData.MultiSelect = false;
dataGridViewData.Name = "dataGridViewData";
dataGridViewData.ReadOnly = true;
dataGridViewData.RowHeadersVisible = false;
dataGridViewData.RowHeadersWidth = 72;
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridViewData.Size = new Size(563, 321);
dataGridViewData.TabIndex = 3;
//
// panelButtons
//
panelButtons.Controls.Add(buttonDelete);
panelButtons.Controls.Add(buttonUpdate);
panelButtons.Controls.Add(buttonAdd);
panelButtons.Dock = DockStyle.Right;
panelButtons.Location = new Point(563, 0);
panelButtons.Margin = new Padding(2, 2, 2, 2);
panelButtons.Name = "panelButtons";
panelButtons.Size = new Size(131, 321);
panelButtons.TabIndex = 2;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.minus;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(33, 176);
buttonDelete.Margin = new Padding(2, 2, 2, 2);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(67, 67);
buttonDelete.TabIndex = 2;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonUpdate
//
buttonUpdate.BackgroundImage = Properties.Resources.i;
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
buttonUpdate.Location = new Point(33, 97);
buttonUpdate.Margin = new Padding(2, 2, 2, 2);
buttonUpdate.Name = "buttonUpdate";
buttonUpdate.Size = new Size(67, 67);
buttonUpdate.TabIndex = 1;
buttonUpdate.UseVisualStyleBackColor = true;
buttonUpdate.Click += ButtonUpdate_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = (System.Drawing.Image)resources.GetObject("buttonAdd.BackgroundImage");
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(33, 19);
buttonAdd.Margin = new Padding(2, 2, 2, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(67, 67);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormEmployees
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(694, 321);
Controls.Add(dataGridViewData);
Controls.Add(panelButtons);
Margin = new Padding(2, 2, 2, 2);
Name = "FormEmployees";
StartPosition = FormStartPosition.CenterParent;
Text = "Работники";
Load += FormEmployees_Load;
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
panelButtons.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridViewData;
private Panel panelButtons;
private Button buttonDelete;
private Button buttonUpdate;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,103 @@
using ProjectTransportation.Repositories;
using ProjectTransportation.Forms;
using ProjectTransportation.Repositories;
using Unity;
namespace ProjectTransportation.Forms
{
public partial class FormEmployees : Form
{
private readonly IUnityContainer _container;
private readonly IEmployeeRepository _employeeRepository;
public FormEmployees(IUnityContainer container, IEmployeeRepository employeeRepository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_employeeRepository = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository));
}
private void FormEmployees_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormEmployee>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpdate_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
try
{
var form = _container.Resolve<FormEmployee>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_employeeRepository.DeleteEmployee(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridViewData.DataSource = _employeeRepository.ReadEmployees();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridViewData.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,316 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonAdd.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsN
DhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQU
FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAEOAQ4DASIAAhEBAxEB/8QA
HwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVW
V1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG
x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQF
BgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE
hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq
8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9U6KKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoooo
AKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAopu7
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/w
I/e+i5NfbXwX/Y58K/DbyNS1bb4k1xPmEtzH+4hbPVIzwSP7zfgBXv0NnFbwrFFGscSjCxoMKB6AdqmV
dq4r6HDZbSoWlL3mfp2VcK4HLWqk17Sfd7L0RGsIVcVIo2jFLRXrH2gUUUUAFFFFABRRRQAUUUUAFFFF
ABRRRQAUUUUAFFFFABRRRQAUUUUAN20nlin0UAR+SOeePSs2+8K6PqRY3mlWN0W6+dbI+fzFa1FJpPcl
xjJWaucpJ8KfBkrbn8J6Ix/7B8X/AMTUlv8AC/wfasGh8LaNE3qthED/AOg109FR7OHYx+rUE78i+5FG
x0Sw01dtpZ29qvpDEqfyFW/LFPoq0ktjeMVFWSGeWM5pyrtpaKYwooooAKKKKACiiigAooooAKKKKACi
iigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACi
iigAooooAKKKKAP/2Q==
</value>
</data>
</root>

View File

@ -0,0 +1,184 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormGoToService
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
comboBoxBus = new ComboBox();
labelBus = new Label();
buttonCancel = new Button();
buttonSave = new Button();
labelPrice = new Label();
numericUpDownPrice = new NumericUpDown();
checkedListBoxBrokenElements = new CheckedListBox();
labelBrokenElement = new Label();
dateTimePickerServiceDate = new DateTimePicker();
labelDate = new Label();
((System.ComponentModel.ISupportInitialize)numericUpDownPrice).BeginInit();
SuspendLayout();
//
// comboBoxBus
//
comboBoxBus.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxBus.FormattingEnabled = true;
comboBoxBus.Location = new Point(112, 259);
comboBoxBus.Margin = new Padding(2, 2, 2, 2);
comboBoxBus.Name = "comboBoxBus";
comboBoxBus.Size = new Size(165, 28);
comboBoxBus.TabIndex = 9;
//
// labelBus
//
labelBus.AutoSize = true;
labelBus.Location = new Point(17, 261);
labelBus.Margin = new Padding(2, 0, 2, 0);
labelBus.Name = "labelBus";
labelBus.Size = new Size(65, 20);
labelBus.TabIndex = 8;
labelBus.Text = "Автобус";
//
// buttonCancel
//
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Location = new Point(187, 306);
buttonCancel.Margin = new Padding(2, 2, 2, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(90, 33);
buttonCancel.TabIndex = 19;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// buttonSave
//
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.Location = new Point(43, 306);
buttonSave.Margin = new Padding(2, 2, 2, 2);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(99, 33);
buttonSave.TabIndex = 18;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// labelPrice
//
labelPrice.AutoSize = true;
labelPrice.Location = new Point(17, 208);
labelPrice.Margin = new Padding(2, 0, 2, 0);
labelPrice.Name = "labelPrice";
labelPrice.Size = new Size(83, 20);
labelPrice.TabIndex = 20;
labelPrice.Text = "Стоимость";
//
// numericUpDownPrice
//
numericUpDownPrice.Location = new Point(112, 207);
numericUpDownPrice.Margin = new Padding(2, 2, 2, 2);
numericUpDownPrice.Name = "numericUpDownPrice";
numericUpDownPrice.Size = new Size(163, 27);
numericUpDownPrice.TabIndex = 21;
//
// checkedListBoxBrokenElements
//
checkedListBoxBrokenElements.FormattingEnabled = true;
checkedListBoxBrokenElements.Location = new Point(112, 68);
checkedListBoxBrokenElements.Margin = new Padding(2, 2, 2, 2);
checkedListBoxBrokenElements.Name = "checkedListBoxBrokenElements";
checkedListBoxBrokenElements.Size = new Size(166, 92);
checkedListBoxBrokenElements.TabIndex = 22;
//
// labelBrokenElement
//
labelBrokenElement.Location = new Point(17, 68);
labelBrokenElement.Margin = new Padding(2, 0, 2, 0);
labelBrokenElement.Name = "labelBrokenElement";
labelBrokenElement.Size = new Size(85, 45);
labelBrokenElement.TabIndex = 23;
labelBrokenElement.Text = "Сломанная деталь";
//
// dateTimePickerServiceDate
//
dateTimePickerServiceDate.Enabled = false;
dateTimePickerServiceDate.Location = new Point(112, 18);
dateTimePickerServiceDate.Margin = new Padding(2, 2, 2, 2);
dateTimePickerServiceDate.Name = "dateTimePickerServiceDate";
dateTimePickerServiceDate.Size = new Size(166, 27);
dateTimePickerServiceDate.TabIndex = 24;
//
// labelDate
//
labelDate.AutoSize = true;
labelDate.Location = new Point(17, 21);
labelDate.Margin = new Padding(2, 0, 2, 0);
labelDate.Name = "labelDate";
labelDate.Size = new Size(41, 20);
labelDate.TabIndex = 25;
labelDate.Text = "Дата";
//
// FormGoToService
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(320, 347);
Controls.Add(labelDate);
Controls.Add(dateTimePickerServiceDate);
Controls.Add(labelBrokenElement);
Controls.Add(checkedListBoxBrokenElements);
Controls.Add(numericUpDownPrice);
Controls.Add(labelPrice);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(comboBoxBus);
Controls.Add(labelBus);
Margin = new Padding(2, 2, 2, 2);
Name = "FormGoToService";
StartPosition = FormStartPosition.CenterParent;
Text = "Тех. обслуживание";
((System.ComponentModel.ISupportInitialize)numericUpDownPrice).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private ComboBox comboBoxBus;
private Label labelBus;
private Button buttonCancel;
private Button buttonSave;
private Label labelPrice;
private NumericUpDown numericUpDownPrice;
private CheckedListBox checkedListBoxBrokenElements;
private Label labelBrokenElement;
private DateTimePicker dateTimePickerServiceDate;
private Label labelDate;
}
}

View File

@ -0,0 +1,55 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Entities.Enums;
using ProjectTransportation.Repositories;
using ProjectTransportation.Entities.Enums;
using ProjectTransportation.Repositories;
namespace ProjectTransportation.Forms
{
public partial class FormGoToService : Form
{
private readonly IGoToServiceRepository _goToServiceRepository;
public FormGoToService(IGoToServiceRepository goToServiceRepository, IBusRepository busRepository)
{
InitializeComponent();
_goToServiceRepository = goToServiceRepository ?? throw new ArgumentNullException(nameof(goToServiceRepository));
comboBoxBus.DataSource = busRepository.ReadBuses();
comboBoxBus.DisplayMember = "LicensePlate";
comboBoxBus.ValueMember = "Id";
foreach (var elem in Enum.GetValues(typeof(BrokenElements)))
{
checkedListBoxBrokenElements.Items.Add(elem);
}
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxBus.SelectedIndex < 0 || checkedListBoxBrokenElements.CheckedItems.Count == 0)
{
throw new Exception("Имеются незаполненные поля");
}
BrokenElements brokenElements = BrokenElements.None;
foreach (var elem in checkedListBoxBrokenElements.CheckedItems)
{
brokenElements |= (BrokenElements)elem;
}
_goToServiceRepository.CreateGoToService(GoToService.CreateOperation(0,
brokenElements,
Convert.ToInt32(numericUpDownPrice.Value),
(int)comboBoxBus.SelectedValue!));
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,122 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormGoToServices
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
dataGridViewData = new DataGridView();
panelButtons = new Panel();
buttonDelete = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
panelButtons.SuspendLayout();
SuspendLayout();
//
// dataGridViewData
//
dataGridViewData.AllowUserToAddRows = false;
dataGridViewData.AllowUserToDeleteRows = false;
dataGridViewData.AllowUserToResizeColumns = false;
dataGridViewData.AllowUserToResizeRows = false;
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewData.Dock = DockStyle.Fill;
dataGridViewData.Location = new Point(0, 0);
dataGridViewData.Margin = new Padding(2);
dataGridViewData.MultiSelect = false;
dataGridViewData.Name = "dataGridViewData";
dataGridViewData.ReadOnly = true;
dataGridViewData.RowHeadersVisible = false;
dataGridViewData.RowHeadersWidth = 72;
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridViewData.Size = new Size(1337, 321);
dataGridViewData.TabIndex = 5;
//
// panelButtons
//
panelButtons.Controls.Add(buttonDelete);
panelButtons.Controls.Add(buttonAdd);
panelButtons.Dock = DockStyle.Right;
panelButtons.Location = new Point(1337, 0);
panelButtons.Margin = new Padding(2);
panelButtons.Name = "panelButtons";
panelButtons.Size = new Size(127, 321);
panelButtons.TabIndex = 4;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.minus;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(33, 100);
buttonDelete.Margin = new Padding(2);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(67, 67);
buttonDelete.TabIndex = 2;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.plus;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(33, 19);
buttonAdd.Margin = new Padding(2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(67, 67);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormGoToServices
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1464, 321);
Controls.Add(dataGridViewData);
Controls.Add(panelButtons);
Margin = new Padding(2);
Name = "FormGoToServices";
StartPosition = FormStartPosition.CenterParent;
Text = "Тех. обслуживания";
Load += FormGoToServices_Load;
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
panelButtons.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridViewData;
private Panel panelButtons;
private Button buttonDelete;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,81 @@
using ProjectTransportation.Repositories;
using ProjectTransportation.Forms;
using ProjectTransportation.Repositories;
using Unity;
namespace ProjectTransportation.Forms;
public partial class FormGoToServices : Form
{
private readonly IUnityContainer _container;
private readonly IGoToServiceRepository _goToServiceRepository;
public FormGoToServices(IUnityContainer container, IGoToServiceRepository goToServiceRepository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_goToServiceRepository = goToServiceRepository ?? throw new ArgumentNullException(nameof(goToServiceRepository));
}
private void FormGoToServices_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormGoToService>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_goToServiceRepository.DeleteGoToService(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridViewData.DataSource = _goToServiceRepository.ReadServices();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridViewData.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
return true;
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,193 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormRouteList
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
buttonCancel = new Button();
buttonSave = new Button();
labelStart = new Label();
numericUpDownStartHour = new NumericUpDown();
labelHours = new Label();
labelMinutes = new Label();
labelFinish = new Label();
numericUpDownStartMin = new NumericUpDown();
numericUpDownFinishMin = new NumericUpDown();
numericUpDownFinishHour = new NumericUpDown();
((System.ComponentModel.ISupportInitialize)numericUpDownStartHour).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownStartMin).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownFinishMin).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownFinishHour).BeginInit();
SuspendLayout();
//
// buttonCancel
//
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Location = new Point(178, 134);
buttonCancel.Margin = new Padding(2, 2, 2, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(90, 33);
buttonCancel.TabIndex = 15;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// buttonSave
//
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.Location = new Point(42, 134);
buttonSave.Margin = new Padding(2, 2, 2, 2);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(100, 33);
buttonSave.TabIndex = 14;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// labelStart
//
labelStart.AutoSize = true;
labelStart.Location = new Point(21, 33);
labelStart.Margin = new Padding(2, 0, 2, 0);
labelStart.Name = "labelStart";
labelStart.Size = new Size(117, 20);
labelStart.TabIndex = 8;
labelStart.Text = "Начало работы";
//
// numericUpDownStartHour
//
numericUpDownStartHour.Location = new Point(155, 32);
numericUpDownStartHour.Margin = new Padding(2, 2, 2, 2);
numericUpDownStartHour.Maximum = new decimal(new int[] { 23, 0, 0, 0 });
numericUpDownStartHour.Name = "numericUpDownStartHour";
numericUpDownStartHour.Size = new Size(42, 27);
numericUpDownStartHour.TabIndex = 16;
numericUpDownStartHour.Value = new decimal(new int[] { 8, 0, 0, 0 });
//
// labelHours
//
labelHours.AutoSize = true;
labelHours.Location = new Point(155, 6);
labelHours.Margin = new Padding(2, 0, 2, 0);
labelHours.Name = "labelHours";
labelHours.Size = new Size(45, 20);
labelHours.TabIndex = 17;
labelHours.Text = "Часы";
//
// labelMinutes
//
labelMinutes.AutoSize = true;
labelMinutes.Location = new Point(226, 6);
labelMinutes.Margin = new Padding(2, 0, 2, 0);
labelMinutes.Name = "labelMinutes";
labelMinutes.Size = new Size(64, 20);
labelMinutes.TabIndex = 18;
labelMinutes.Text = "Минуты";
//
// labelFinish
//
labelFinish.AutoSize = true;
labelFinish.Location = new Point(21, 81);
labelFinish.Margin = new Padding(2, 0, 2, 0);
labelFinish.Name = "labelFinish";
labelFinish.Size = new Size(109, 20);
labelFinish.TabIndex = 19;
labelFinish.Text = "Конец работы";
//
// numericUpDownStartMin
//
numericUpDownStartMin.Location = new Point(233, 32);
numericUpDownStartMin.Margin = new Padding(2, 2, 2, 2);
numericUpDownStartMin.Maximum = new decimal(new int[] { 59, 0, 0, 0 });
numericUpDownStartMin.Name = "numericUpDownStartMin";
numericUpDownStartMin.Size = new Size(42, 27);
numericUpDownStartMin.TabIndex = 20;
//
// numericUpDownFinishMin
//
numericUpDownFinishMin.Location = new Point(233, 80);
numericUpDownFinishMin.Margin = new Padding(2, 2, 2, 2);
numericUpDownFinishMin.Maximum = new decimal(new int[] { 59, 0, 0, 0 });
numericUpDownFinishMin.Name = "numericUpDownFinishMin";
numericUpDownFinishMin.Size = new Size(42, 27);
numericUpDownFinishMin.TabIndex = 22;
//
// numericUpDownFinishHour
//
numericUpDownFinishHour.Location = new Point(155, 80);
numericUpDownFinishHour.Margin = new Padding(2, 2, 2, 2);
numericUpDownFinishHour.Maximum = new decimal(new int[] { 23, 0, 0, 0 });
numericUpDownFinishHour.Name = "numericUpDownFinishHour";
numericUpDownFinishHour.Size = new Size(42, 27);
numericUpDownFinishHour.TabIndex = 21;
numericUpDownFinishHour.Value = new decimal(new int[] { 22, 0, 0, 0 });
//
// FormRouteList
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(317, 177);
Controls.Add(numericUpDownFinishMin);
Controls.Add(numericUpDownFinishHour);
Controls.Add(numericUpDownStartMin);
Controls.Add(labelFinish);
Controls.Add(labelMinutes);
Controls.Add(labelHours);
Controls.Add(numericUpDownStartHour);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(labelStart);
Margin = new Padding(2, 2, 2, 2);
Name = "FormRouteList";
StartPosition = FormStartPosition.CenterParent;
Text = "Маршрутный лист";
((System.ComponentModel.ISupportInitialize)numericUpDownStartHour).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownStartMin).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownFinishMin).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownFinishHour).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button buttonCancel;
private Button buttonSave;
private Label labelStart;
private NumericUpDown numericUpDownStartHour;
private Label labelHours;
private Label labelMinutes;
private Label labelFinish;
private NumericUpDown numericUpDownStartMin;
private NumericUpDown numericUpDownFinishMin;
private NumericUpDown numericUpDownFinishHour;
}
}

View File

@ -0,0 +1,73 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Repositories;
using ProjectTransportation.Entities;
using ProjectTransportation.Repositories;
namespace ProjectTransportation.Forms
{
public partial class FormRouteList : Form
{
private readonly IRouteListRepository _routeListRepository;
private int? _routeListId;
public int Id
{
set
{
try
{
var routeList = _routeListRepository.ReadRouteListById(value);
if (routeList == null)
{
throw new InvalidDataException(nameof(routeList));
}
numericUpDownStartHour.Value = routeList.Start.Hour;
numericUpDownStartMin.Value = routeList.Start.Minute;
numericUpDownFinishHour.Value = routeList.Finish.Hour;
numericUpDownFinishMin.Value = routeList.Finish.Minute;
_routeListId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormRouteList(IRouteListRepository routeListRepository)
{
InitializeComponent();
_routeListRepository = routeListRepository ?? throw new ArgumentNullException(nameof(routeListRepository));
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (_routeListId.HasValue)
{
_routeListRepository.UpdateRouteList(CreateRouteList(_routeListId.Value));
}
else
{
_routeListRepository.CreateRouteList(CreateRouteList(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private RouteList CreateRouteList(int id) => RouteList.CreateEntity(id,
new TimeOnly(Convert.ToInt32(numericUpDownStartHour.Value), Convert.ToInt32(numericUpDownStartMin.Value)),
new TimeOnly(Convert.ToInt32(numericUpDownFinishHour.Value), Convert.ToInt32(numericUpDownFinishMin.Value)));
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,137 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormRouteLists
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
dataGridViewData = new DataGridView();
panelButtons = new Panel();
buttonDelete = new Button();
buttonUpdate = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
panelButtons.SuspendLayout();
SuspendLayout();
//
// dataGridViewData
//
dataGridViewData.AllowUserToAddRows = false;
dataGridViewData.AllowUserToDeleteRows = false;
dataGridViewData.AllowUserToResizeColumns = false;
dataGridViewData.AllowUserToResizeRows = false;
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewData.Dock = DockStyle.Fill;
dataGridViewData.Location = new Point(0, 0);
dataGridViewData.Margin = new Padding(2, 2, 2, 2);
dataGridViewData.MultiSelect = false;
dataGridViewData.Name = "dataGridViewData";
dataGridViewData.ReadOnly = true;
dataGridViewData.RowHeadersVisible = false;
dataGridViewData.RowHeadersWidth = 72;
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridViewData.Size = new Size(563, 321);
dataGridViewData.TabIndex = 3;
//
// panelButtons
//
panelButtons.Controls.Add(buttonDelete);
panelButtons.Controls.Add(buttonUpdate);
panelButtons.Controls.Add(buttonAdd);
panelButtons.Dock = DockStyle.Right;
panelButtons.Location = new Point(563, 0);
panelButtons.Margin = new Padding(2, 2, 2, 2);
panelButtons.Name = "panelButtons";
panelButtons.Size = new Size(131, 321);
panelButtons.TabIndex = 2;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.minus;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(33, 176);
buttonDelete.Margin = new Padding(2, 2, 2, 2);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(67, 67);
buttonDelete.TabIndex = 2;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonUpdate
//
buttonUpdate.BackgroundImage = Properties.Resources.i;
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
buttonUpdate.Location = new Point(33, 97);
buttonUpdate.Margin = new Padding(2, 2, 2, 2);
buttonUpdate.Name = "buttonUpdate";
buttonUpdate.Size = new Size(67, 67);
buttonUpdate.TabIndex = 1;
buttonUpdate.UseVisualStyleBackColor = true;
buttonUpdate.Click += ButtonUpdate_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.plus;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(33, 19);
buttonAdd.Margin = new Padding(2, 2, 2, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(67, 67);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormRouteLists
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(694, 321);
Controls.Add(dataGridViewData);
Controls.Add(panelButtons);
Margin = new Padding(2, 2, 2, 2);
Name = "FormRouteLists";
StartPosition = FormStartPosition.CenterParent;
Text = "Маршрутные листы";
Load += FormRouteLists_Load;
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
panelButtons.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridViewData;
private Panel panelButtons;
private Button buttonDelete;
private Button buttonUpdate;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,104 @@
using ProjectTransportation.Repositories;
using ProjectTransportation.Forms;
using ProjectTransportation.Repositories;
using Unity;
namespace ProjectTransportation.Forms
{
public partial class FormRouteLists : Form
{
private readonly IUnityContainer _container;
private readonly IRouteListRepository _routeListRepository;
public FormRouteLists(IUnityContainer container, IRouteListRepository routeListRepository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_routeListRepository = routeListRepository ?? throw new ArgumentNullException(nameof(routeListRepository));
}
private void FormRouteLists_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormRouteList>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpdate_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
try
{
var form = _container.Resolve<FormRouteList>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_routeListRepository.DeleteRouteList(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridViewData.DataSource = _routeListRepository.ReadRouteLists();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridViewData.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,216 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormStartingShift
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
labelRouteList = new Label();
comboBoxRouteList = new ComboBox();
comboBoxBus = new ComboBox();
labelBus = new Label();
buttonCancel = new Button();
buttonSave = new Button();
groupBoxEmployees = new GroupBox();
dataGridViewEmployees = new DataGridView();
ColumnEmployees = new DataGridViewComboBoxColumn();
ColumnWorkHours = new DataGridViewTextBoxColumn();
labelDate = new Label();
dateTimePickerShiftDate = new DateTimePicker();
groupBoxEmployees.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridViewEmployees).BeginInit();
SuspendLayout();
//
// labelRouteList
//
labelRouteList.AutoSize = true;
labelRouteList.Location = new Point(24, 65);
labelRouteList.Margin = new Padding(2, 0, 2, 0);
labelRouteList.Name = "labelRouteList";
labelRouteList.Size = new Size(73, 20);
labelRouteList.TabIndex = 0;
labelRouteList.Text = "Маршрут";
//
// comboBoxRouteList
//
comboBoxRouteList.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxRouteList.FormattingEnabled = true;
comboBoxRouteList.Location = new Point(122, 63);
comboBoxRouteList.Margin = new Padding(2, 2, 2, 2);
comboBoxRouteList.Name = "comboBoxRouteList";
comboBoxRouteList.Size = new Size(165, 28);
comboBoxRouteList.TabIndex = 1;
//
// comboBoxBus
//
comboBoxBus.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxBus.FormattingEnabled = true;
comboBoxBus.Location = new Point(122, 105);
comboBoxBus.Margin = new Padding(2, 2, 2, 2);
comboBoxBus.Name = "comboBoxBus";
comboBoxBus.Size = new Size(165, 28);
comboBoxBus.TabIndex = 5;
//
// labelBus
//
labelBus.AutoSize = true;
labelBus.Location = new Point(24, 107);
labelBus.Margin = new Padding(2, 0, 2, 0);
labelBus.Name = "labelBus";
labelBus.Size = new Size(65, 20);
labelBus.TabIndex = 4;
labelBus.Text = "Автобус";
//
// buttonCancel
//
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Location = new Point(330, 342);
buttonCancel.Margin = new Padding(2, 2, 2, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(90, 33);
buttonCancel.TabIndex = 17;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// buttonSave
//
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.Location = new Point(45, 342);
buttonSave.Margin = new Padding(2, 2, 2, 2);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(109, 33);
buttonSave.TabIndex = 16;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// groupBoxEmployees
//
groupBoxEmployees.Controls.Add(dataGridViewEmployees);
groupBoxEmployees.Location = new Point(24, 146);
groupBoxEmployees.Margin = new Padding(2, 2, 2, 2);
groupBoxEmployees.Name = "groupBoxEmployees";
groupBoxEmployees.Padding = new Padding(2, 2, 2, 2);
groupBoxEmployees.Size = new Size(356, 174);
groupBoxEmployees.TabIndex = 18;
groupBoxEmployees.TabStop = false;
groupBoxEmployees.Text = "Сотрудники";
//
// dataGridViewEmployees
//
dataGridViewEmployees.AllowUserToResizeColumns = false;
dataGridViewEmployees.AllowUserToResizeRows = false;
dataGridViewEmployees.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewEmployees.Columns.AddRange(new DataGridViewColumn[] { ColumnEmployees, ColumnWorkHours });
dataGridViewEmployees.Dock = DockStyle.Fill;
dataGridViewEmployees.Location = new Point(2, 22);
dataGridViewEmployees.Margin = new Padding(2, 2, 2, 2);
dataGridViewEmployees.MultiSelect = false;
dataGridViewEmployees.Name = "dataGridViewEmployees";
dataGridViewEmployees.RowHeadersVisible = false;
dataGridViewEmployees.RowHeadersWidth = 72;
dataGridViewEmployees.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridViewEmployees.Size = new Size(352, 150);
dataGridViewEmployees.TabIndex = 0;
//
// ColumnEmployees
//
ColumnEmployees.HeaderText = "Работник";
ColumnEmployees.MinimumWidth = 9;
ColumnEmployees.Name = "ColumnEmployees";
ColumnEmployees.Width = 175;
//
// ColumnWorkHours
//
ColumnWorkHours.HeaderText = "Часы работы";
ColumnWorkHours.MinimumWidth = 9;
ColumnWorkHours.Name = "ColumnWorkHours";
ColumnWorkHours.Width = 175;
//
// labelDate
//
labelDate.AutoSize = true;
labelDate.Location = new Point(24, 21);
labelDate.Margin = new Padding(2, 0, 2, 0);
labelDate.Name = "labelDate";
labelDate.Size = new Size(41, 20);
labelDate.TabIndex = 27;
labelDate.Text = "Дата";
//
// dateTimePickerShiftDate
//
dateTimePickerShiftDate.Enabled = false;
dateTimePickerShiftDate.Location = new Point(119, 19);
dateTimePickerShiftDate.Margin = new Padding(2, 2, 2, 2);
dateTimePickerShiftDate.Name = "dateTimePickerShiftDate";
dateTimePickerShiftDate.Size = new Size(166, 27);
dateTimePickerShiftDate.TabIndex = 26;
//
// FormStartingShift
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(463, 397);
Controls.Add(labelDate);
Controls.Add(dateTimePickerShiftDate);
Controls.Add(groupBoxEmployees);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(comboBoxBus);
Controls.Add(labelBus);
Controls.Add(comboBoxRouteList);
Controls.Add(labelRouteList);
Margin = new Padding(2, 2, 2, 2);
Name = "FormStartingShift";
StartPosition = FormStartPosition.CenterParent;
Text = "Начало смены";
groupBoxEmployees.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridViewEmployees).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelRouteList;
private ComboBox comboBoxRouteList;
private ComboBox comboBoxBus;
private Label labelBus;
private Button buttonCancel;
private Button buttonSave;
private GroupBox groupBoxEmployees;
private DataGridView dataGridViewEmployees;
private Label labelDate;
private DateTimePicker dateTimePickerShiftDate;
private DataGridViewComboBoxColumn ColumnEmployees;
private DataGridViewTextBoxColumn ColumnWorkHours;
}
}

View File

@ -0,0 +1,72 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Repositories;
using ProjectTransportation.Entities;
using ProjectTransportation.Repositories;
namespace ProjectTransportation.Forms
{
public partial class FormStartingShift : Form
{
private readonly IStartingShiftRepository _startingShiftRepository;
public FormStartingShift(IStartingShiftRepository startingShiftRepository,
IRouteListRepository routeListRepository,
IBusRepository busRepository,
IEmployeeRepository employeeRepository)
{
InitializeComponent();
_startingShiftRepository = startingShiftRepository ?? throw new ArgumentNullException(nameof(startingShiftRepository));
comboBoxRouteList.DataSource = routeListRepository.ReadRouteLists();
comboBoxRouteList.DisplayMember = "Id";
comboBoxRouteList.ValueMember = "Id";
comboBoxBus.DataSource = busRepository.ReadBuses();
comboBoxBus.DisplayMember = "LicensePlate";
comboBoxBus.ValueMember = "Id";
ColumnEmployees.DataSource = employeeRepository.ReadEmployees();
ColumnEmployees.DisplayMember = "FirstName";
ColumnEmployees.ValueMember = "Id";
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (dataGridViewEmployees.RowCount < 1 ||
comboBoxRouteList.SelectedIndex < 0 ||
comboBoxBus.SelectedIndex < 0)
{
throw new Exception("Имеются незаполненные поля");
}
_startingShiftRepository.CreateStartingShift(StartingShift.CreateOperation(0,
(int)comboBoxRouteList.SelectedValue!,
(int)comboBoxBus.SelectedValue!,
CreateListStartingShiftEmployeeFromDataGrid()));
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private List<StartingShiftEmployee> CreateListStartingShiftEmployeeFromDataGrid()
{
var list = new List<StartingShiftEmployee>();
foreach (DataGridViewRow row in dataGridViewEmployees.Rows)
{
if (row.Cells["ColumnFeed"].Value == null ||
row.Cells["ColumnCount"].Value == null)
{
continue;
}
list.Add(StartingShiftEmployee.CreateElement(0,
Convert.ToInt32(row.Cells["ColumnEmployees"].Value),
Convert.ToInt32(row.Cells["ColumnWorkHours"].Value)));
}
return list;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,107 @@
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ProjectTransportation.Forms
{
partial class FormStartingShifts
{
/// <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);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
dataGridViewData = new DataGridView();
panelButtons = new Panel();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
panelButtons.SuspendLayout();
SuspendLayout();
//
// dataGridViewData
//
dataGridViewData.AllowUserToAddRows = false;
dataGridViewData.AllowUserToDeleteRows = false;
dataGridViewData.AllowUserToResizeColumns = false;
dataGridViewData.AllowUserToResizeRows = false;
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewData.Dock = DockStyle.Fill;
dataGridViewData.Location = new Point(0, 0);
dataGridViewData.Margin = new Padding(2, 2, 2, 2);
dataGridViewData.MultiSelect = false;
dataGridViewData.Name = "dataGridViewData";
dataGridViewData.ReadOnly = true;
dataGridViewData.RowHeadersVisible = false;
dataGridViewData.RowHeadersWidth = 72;
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridViewData.Size = new Size(740, 321);
dataGridViewData.TabIndex = 5;
//
// panelButtons
//
panelButtons.Controls.Add(buttonAdd);
panelButtons.Dock = DockStyle.Right;
panelButtons.Location = new Point(740, 0);
panelButtons.Margin = new Padding(2, 2, 2, 2);
panelButtons.Name = "panelButtons";
panelButtons.Size = new Size(131, 321);
panelButtons.TabIndex = 4;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.plus;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(33, 19);
buttonAdd.Margin = new Padding(2, 2, 2, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(67, 67);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormStartingShifts
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(871, 321);
Controls.Add(dataGridViewData);
Controls.Add(panelButtons);
Margin = new Padding(2, 2, 2, 2);
Name = "FormStartingShifts";
StartPosition = FormStartPosition.CenterParent;
Text = "Смены";
Load += FormStartingShifts_Load;
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
panelButtons.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridViewData;
private Panel panelButtons;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,46 @@
using ProjectTransportation.Repositories;
using ProjectTransportation.Forms;
using ProjectTransportation.Repositories;
using Unity;
namespace ProjectTransportation.Forms;
public partial class FormStartingShifts : Form
{
private readonly IUnityContainer _container;
private readonly IStartingShiftRepository _startingShiftRepository;
public FormStartingShifts(IUnityContainer container, IStartingShiftRepository startingShiftRepository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_startingShiftRepository = startingShiftRepository ?? throw new ArgumentNullException(nameof(startingShiftRepository));
}
private void FormStartingShifts_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormStartingShift>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridViewData.DataSource = _startingShiftRepository.ReadShifts();
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,3 +1,8 @@
using ProjectTransportation.Repositories.Implementations;
using ProjectTransportation.Repositories;
using Unity.Lifetime;
using Unity;
namespace ProjectTransportation namespace ProjectTransportation
{ {
internal static class Program internal static class Program
@ -11,7 +16,20 @@ namespace ProjectTransportation
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new Form1()); Application.Run(CreateContainer().Resolve<FormTransportation>());
}
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
container.RegisterType<IBusRepository, BusRepository>(new TransientLifetimeManager());
container.RegisterType<IEmployeeRepository, EmployeeRepository>(new TransientLifetimeManager());
container.RegisterType<IRouteListRepository, RouteListRepository>(new TransientLifetimeManager());
container.RegisterType<IGoToServiceRepository, GoToServiceRepository>(new TransientLifetimeManager());
container.RegisterType<IStartingShiftRepository, StartingShiftRepository>(new TransientLifetimeManager());
return container;
} }
} }
} }

View File

@ -8,4 +8,23 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Unity" Version="5.11.10" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ProjectTransportation.Properties {
using System;
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectTransportation.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap _1 {
get {
object obj = ResourceManager.GetObject("1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap i {
get {
object obj = ResourceManager.GetObject("i", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap minus {
get {
object obj = ResourceManager.GetObject("minus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap plus {
get {
object obj = ResourceManager.GetObject("plus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap plus1 {
get {
object obj = ResourceManager.GetObject("plus1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap plus2 {
get {
object obj = ResourceManager.GetObject("plus2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="minus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="plus1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\plus.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\1.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="i" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\i.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\plus.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="plus2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\plus.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,21 @@
using ProjectTransportation.Entities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Repositories;
public interface IBusRepository
{
IEnumerable<Bus> ReadBuses();
Bus ReadBusById(int busId);
void CreateBus(Bus bus);
void UpdateBus(Bus bus);
void DeleteBus(int id);
}

View File

@ -0,0 +1,20 @@
using ProjectTransportation.Entities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Repositories;
public interface IEmployeeRepository
{
IEnumerable<Employee> ReadEmployees();
Employee ReadEmployeeById(int employeeId);
void CreateEmployee(Employee employee);
void UpdateEmployee(Employee employee);
void DeleteEmployee(int id);
}

View File

@ -0,0 +1,14 @@
using ProjectTransportation.Entities.Enums;
using ProjectTransportation.Entities;
namespace ProjectTransportation.Repositories;
public interface IGoToServiceRepository
{
IEnumerable<GoToService> ReadServices(DateTime? dateFrom = null, DateTime? dateTo = null,
BrokenElements BrokenElements = BrokenElements.None, int? price = null, int? busId = null);
void DeleteGoToService(int id);
void CreateGoToService(GoToService goToService);
}

View File

@ -0,0 +1,20 @@
using ProjectTransportation.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Repositories;
public interface IRouteListRepository
{
IEnumerable<RouteList> ReadRouteLists();
RouteList ReadRouteListById(int routeListId);
void CreateRouteList(RouteList routeList);
void UpdateRouteList(RouteList routeList);
void DeleteRouteList(int id);
}

View File

@ -0,0 +1,15 @@
using ProjectTransportation.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Repositories;
public interface IStartingShiftRepository
{
IEnumerable<StartingShift> ReadShifts(DateTime? dateFrom = null, DateTime? dateTo = null, int? routeListId = null,
int? employeeId = null, int? busId = null);
void CreateStartingShift(StartingShift startingShift);
}

View File

@ -0,0 +1,33 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Entities.Enums;
namespace ProjectTransportation.Repositories.Implementations;
public class BusRepository : IBusRepository
{
public void CreateBus(Bus bus)
{
}
public void DeleteBus(int id)
{
}
public Bus ReadBusById(int busId)
{
return Bus.CreateEntity(0, string.Empty, string.Empty);
}
public IEnumerable<Bus> ReadBuses()
{
return [];
}
public void UpdateBus(Bus bus)
{
}
}

View File

@ -0,0 +1,32 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Entities.Enums;
namespace ProjectTransportation.Repositories.Implementations;
public class EmployeeRepository : IEmployeeRepository
{
public void CreateEmployee(Employee employee)
{
}
public void DeleteEmployee(int id)
{
}
public Employee ReadEmployeeById(int employeeId)
{
return Employee.CreateEntity(0, string.Empty, string.Empty, EmployeePost.None);
}
public IEnumerable<Employee> ReadEmployees()
{
return [];
}
public void UpdateEmployee(Employee employee)
{
}
}

View File

@ -0,0 +1,21 @@
using ProjectTransportation.Entities;
using ProjectTransportation.Entities.Enums;
namespace ProjectTransportation.Repositories.Implementations;
public class GoToServiceRepository : IGoToServiceRepository
{
public void CreateGoToService(GoToService goToService)
{
}
public void DeleteGoToService(int id)
{
}
public IEnumerable<GoToService> ReadServices(DateTime? dateFrom = null, DateTime? dateTo = null, BrokenElements BrokenElements = BrokenElements.None, int? price = null, int? busId = null)
{
return [];
}
}

View File

@ -0,0 +1,30 @@
using ProjectTransportation.Entities;
namespace ProjectTransportation.Repositories.Implementations;
public class RouteListRepository : IRouteListRepository
{
public void CreateRouteList(RouteList routeList)
{
}
public void DeleteRouteList(int id)
{
}
public RouteList ReadRouteListById(int routeListId)
{
return RouteList.CreateEntity(0, new TimeOnly(0, 0), new TimeOnly(0, 0));
}
public IEnumerable<RouteList> ReadRouteLists()
{
return [];
}
public void UpdateRouteList(RouteList routeList)
{
}
}

View File

@ -0,0 +1,21 @@
using ProjectTransportation.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTransportation.Repositories.Implementations;
public class StartingShiftRepository : IStartingShiftRepository
{
public void CreateStartingShift(StartingShift startingShift)
{
}
public IEnumerable<StartingShift> ReadShifts(DateTime? dateFrom = null, DateTime? dateTo = null,
int? routeListId = null, int? employeeId = null, int? busId = null)
{
return [];
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB