полнейшее пипяу
This commit is contained in:
parent
e6defea462
commit
735cb575f9
26
ProjectAirline/Entities/PraparatoryWorkPlane.cs
Normal file
26
ProjectAirline/Entities/PraparatoryWorkPlane.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectAirline.Entities;
|
||||
|
||||
public class PreparatoryWorkPlane
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public int PreparatoryWorkId { get; private set; }
|
||||
public int PlaneId { get; private set; }
|
||||
public int Count { get; private set; }
|
||||
|
||||
public static PreparatoryWorkPlane CreateElement(int id, int preparatoryWorkId, int planeId, int count)
|
||||
{
|
||||
return new PreparatoryWorkPlane
|
||||
{
|
||||
Id = id,
|
||||
PreparatoryWorkId = preparatoryWorkId,
|
||||
PlaneId = planeId,
|
||||
Count = count
|
||||
};
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using ProjectAirline.Entities.Enums;
|
||||
using ProjectAirline.Forms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -10,27 +11,22 @@ namespace ProjectAirline.Entities;
|
||||
public class PreparatoryWork
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public int FlightId { get; private set; }
|
||||
|
||||
public int PlaneId { get; private set; }
|
||||
|
||||
public DateTime StartDate { get; private set; }
|
||||
|
||||
public DateTime EndDate { get; private set; }
|
||||
|
||||
public PreparatoryWorkStatus Status { get; private set; }
|
||||
public IEnumerable<PreparatoryWorkPlane> PreparatoryWorkPlanes { get; private set; } = Enumerable.Empty<PreparatoryWorkPlane>();
|
||||
|
||||
public static PreparatoryWork CreatePrerapatoryWork(int id, int FlightId, int PlaneId, DateTime StartDate, DateTime EndDate, PreparatoryWorkStatus Status)
|
||||
public static PreparatoryWork CreatePreparatoryWork(int id, int flightId, DateTime startDate, DateTime endDate, PreparatoryWorkStatus status, IEnumerable<PreparatoryWorkPlane> preparatoryWorkPlanes)
|
||||
{
|
||||
return new PreparatoryWork
|
||||
{
|
||||
Id = id,
|
||||
FlightId = FlightId,
|
||||
PlaneId = PlaneId,
|
||||
StartDate = StartDate,
|
||||
EndDate = EndDate,
|
||||
Status = Status
|
||||
FlightId = flightId,
|
||||
StartDate = startDate,
|
||||
EndDate = endDate,
|
||||
Status = status,
|
||||
PreparatoryWorkPlanes = preparatoryWorkPlanes
|
||||
};
|
||||
}
|
||||
}
|
||||
|
69
ProjectAirline/FormAirline.Designer.cs
generated
69
ProjectAirline/FormAirline.Designer.cs
generated
@ -30,13 +30,13 @@
|
||||
{
|
||||
menuStrip = new MenuStrip();
|
||||
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||
полетToolStripMenuItem = new ToolStripMenuItem();
|
||||
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
пассажирыToolStripMenuItem = new ToolStripMenuItem();
|
||||
самолетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
билетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||
подготовительныеРаботыToolStripMenuItem = new ToolStripMenuItem();
|
||||
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
полетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
menuStrip.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
@ -51,53 +51,58 @@
|
||||
//
|
||||
// справочникиToolStripMenuItem
|
||||
//
|
||||
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { полетToolStripMenuItem, пассажирыToolStripMenuItem, самолетыToolStripMenuItem, билетыToolStripMenuItem });
|
||||
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { пассажирыToolStripMenuItem, самолетыToolStripMenuItem, билетыToolStripMenuItem });
|
||||
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||
справочникиToolStripMenuItem.Size = new Size(94, 20);
|
||||
справочникиToolStripMenuItem.Text = "Справочники";
|
||||
//
|
||||
// полетToolStripMenuItem
|
||||
// пассажирыToolStripMenuItem
|
||||
//
|
||||
полетToolStripMenuItem.Name = "полетToolStripMenuItem";
|
||||
полетToolStripMenuItem.Size = new Size(180, 22);
|
||||
полетToolStripMenuItem.Text = "Полеты";
|
||||
пассажирыToolStripMenuItem.Name = "пассажирыToolStripMenuItem";
|
||||
пассажирыToolStripMenuItem.Size = new Size(180, 22);
|
||||
пассажирыToolStripMenuItem.Text = "Пассажиры";
|
||||
пассажирыToolStripMenuItem.Click += PassangersToolStripMenuItem_Click;
|
||||
//
|
||||
// самолетыToolStripMenuItem
|
||||
//
|
||||
самолетыToolStripMenuItem.Name = "самолетыToolStripMenuItem";
|
||||
самолетыToolStripMenuItem.Size = new Size(180, 22);
|
||||
самолетыToolStripMenuItem.Text = "Самолеты";
|
||||
самолетыToolStripMenuItem.Click += PlanesToolStripMenuItem_Click;
|
||||
//
|
||||
// билетыToolStripMenuItem
|
||||
//
|
||||
билетыToolStripMenuItem.Name = "билетыToolStripMenuItem";
|
||||
билетыToolStripMenuItem.Size = new Size(180, 22);
|
||||
билетыToolStripMenuItem.Text = "Билеты";
|
||||
билетыToolStripMenuItem.Click += TicketsToolStripMenuItem_Click;
|
||||
//
|
||||
// операцииToolStripMenuItem
|
||||
//
|
||||
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { подготовительныеРаботыToolStripMenuItem });
|
||||
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { подготовительныеРаботыToolStripMenuItem, полетыToolStripMenuItem });
|
||||
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||
операцииToolStripMenuItem.Size = new Size(75, 20);
|
||||
операцииToolStripMenuItem.Text = "Операции";
|
||||
//
|
||||
// подготовительныеРаботыToolStripMenuItem
|
||||
//
|
||||
подготовительныеРаботыToolStripMenuItem.Name = "подготовительныеРаботыToolStripMenuItem";
|
||||
подготовительныеРаботыToolStripMenuItem.Size = new Size(223, 22);
|
||||
подготовительныеРаботыToolStripMenuItem.Text = "Подготовительные работы";
|
||||
подготовительныеРаботыToolStripMenuItem.Click += PreparatoryWorksToolStripMenuItem_Click;
|
||||
//
|
||||
// отчетыToolStripMenuItem
|
||||
//
|
||||
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||
отчетыToolStripMenuItem.Size = new Size(60, 20);
|
||||
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||
//
|
||||
// пассажирыToolStripMenuItem
|
||||
// полетыToolStripMenuItem
|
||||
//
|
||||
пассажирыToolStripMenuItem.Name = "пассажирыToolStripMenuItem";
|
||||
пассажирыToolStripMenuItem.Size = new Size(180, 22);
|
||||
пассажирыToolStripMenuItem.Text = "Пассажиры";
|
||||
//
|
||||
// самолетыToolStripMenuItem
|
||||
//
|
||||
самолетыToolStripMenuItem.Name = "самолетыToolStripMenuItem";
|
||||
самолетыToolStripMenuItem.Size = new Size(180, 22);
|
||||
самолетыToolStripMenuItem.Text = "Самолеты";
|
||||
//
|
||||
// билетыToolStripMenuItem
|
||||
//
|
||||
билетыToolStripMenuItem.Name = "билетыToolStripMenuItem";
|
||||
билетыToolStripMenuItem.Size = new Size(180, 22);
|
||||
билетыToolStripMenuItem.Text = "Билеты";
|
||||
//
|
||||
// подготовительныеРаботыToolStripMenuItem
|
||||
//
|
||||
подготовительныеРаботыToolStripMenuItem.Name = "подготовительныеРаботыToolStripMenuItem";
|
||||
подготовительныеРаботыToolStripMenuItem.Size = new Size(223, 22);
|
||||
подготовительныеРаботыToolStripMenuItem.Text = "Подготовительные работы";
|
||||
полетыToolStripMenuItem.Name = "полетыToolStripMenuItem";
|
||||
полетыToolStripMenuItem.Size = new Size(223, 22);
|
||||
полетыToolStripMenuItem.Text = "Полеты";
|
||||
полетыToolStripMenuItem.Click += FlightsToolStripMenuItem_Click;
|
||||
//
|
||||
// FormAirline
|
||||
//
|
||||
@ -121,12 +126,12 @@
|
||||
|
||||
private MenuStrip menuStrip;
|
||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||
private ToolStripMenuItem полетToolStripMenuItem;
|
||||
private ToolStripMenuItem операцииToolStripMenuItem;
|
||||
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||
private ToolStripMenuItem пассажирыToolStripMenuItem;
|
||||
private ToolStripMenuItem самолетыToolStripMenuItem;
|
||||
private ToolStripMenuItem билетыToolStripMenuItem;
|
||||
private ToolStripMenuItem подготовительныеРаботыToolStripMenuItem;
|
||||
private ToolStripMenuItem полетыToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,75 @@
|
||||
namespace ProjectAirline
|
||||
{
|
||||
using ProjectAirline.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectAirline;
|
||||
|
||||
public partial class FormAirline : Form
|
||||
{
|
||||
public FormAirline()
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
public FormAirline(IUnityContainer container)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||
}
|
||||
|
||||
private void FlightsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormFlights>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void PassangersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormPassangers>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void TicketsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormTickets>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void PlanesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormPlanes>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void PreparatoryWorksToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormPreparatoryWorks>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
ProjectAirline/Forms/FormPassanger.Designer.cs
generated
2
ProjectAirline/Forms/FormPassanger.Designer.cs
generated
@ -100,7 +100,7 @@
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Name = "FormPassanger";
|
||||
Text = "FormPassanger";
|
||||
Text = "Пассажир";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
@ -10,12 +10,15 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using ProjectAirline.Repositories.Implementations;
|
||||
|
||||
namespace ProjectAirline.Forms;
|
||||
|
||||
public partial class FormPreparatoryWork : Form
|
||||
{
|
||||
private readonly IPreparatoryWorkRepository _preparatoryWorkRepository;
|
||||
private readonly IFlightRepository _flightRepository;
|
||||
private readonly IPlaneRepository _planeRepository;
|
||||
private int? _preparatoryWorkId;
|
||||
|
||||
public int Id
|
||||
@ -30,7 +33,6 @@ public partial class FormPreparatoryWork : Form
|
||||
throw new InvalidDataException(nameof(preparatoryWork));
|
||||
}
|
||||
comboBoxFlightId.SelectedItem = preparatoryWork.FlightId;
|
||||
comboBoxPlaneId.SelectedItem = preparatoryWork.PlaneId;
|
||||
comboBoxStatus.SelectedItem = preparatoryWork.Status;
|
||||
_preparatoryWorkId = value;
|
||||
}
|
||||
@ -42,16 +44,15 @@ public partial class FormPreparatoryWork : Form
|
||||
}
|
||||
}
|
||||
|
||||
public FormPreparatoryWork(IPreparatoryWorkRepository preparatoryWorkRepository)
|
||||
public FormPreparatoryWork(IPreparatoryWorkRepository preparatoryWorkRepository, IFlightRepository flightRepository, IPlaneRepository planeRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_preparatoryWorkRepository = preparatoryWorkRepository ?? throw new ArgumentNullException(nameof(preparatoryWorkRepository));
|
||||
_flightRepository = flightRepository ?? throw new ArgumentNullException(nameof(_flightRepository));
|
||||
_planeRepository = planeRepository ?? throw new ArgumentNullException(nameof(_planeRepository));
|
||||
comboBoxFlightId.DataSource = _flightRepository.ReadFlights();
|
||||
comboBoxPlaneId.DataSource = _planeRepository.ReadPlanes();
|
||||
|
||||
// Заполнение comboBoxFlightId и comboBoxPlaneId данными из репозитория
|
||||
comboBoxFlightId.DataSource = _preparatoryWorkRepository.GetFlightIds();
|
||||
comboBoxPlaneId.DataSource = _preparatoryWorkRepository.GetPlaneIds();
|
||||
|
||||
// Заполнение comboBoxStatus данными из перечисления PreparatoryWorkStatus
|
||||
comboBoxStatus.DataSource = Enum.GetValues(typeof(PreparatoryWorkStatus));
|
||||
}
|
||||
|
||||
@ -88,10 +89,10 @@ public partial class FormPreparatoryWork : Form
|
||||
return PreparatoryWork.CreatePreparatoryWork(
|
||||
id,
|
||||
(int)comboBoxFlightId.SelectedItem,
|
||||
(int)comboBoxPlaneId.SelectedItem,
|
||||
DateTime.Now,
|
||||
DateTime.Now.AddHours(1),
|
||||
(PreparatoryWorkStatus)comboBoxStatus.SelectedItem
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -48,38 +48,38 @@
|
||||
panel.Size = new Size(200, 450);
|
||||
panel.TabIndex = 0;
|
||||
//
|
||||
// buttonUpd
|
||||
//
|
||||
buttonUpd.BackgroundImage = Properties.Resources.Antu_qtdesigner_svg;
|
||||
buttonUpd.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
buttonUpd.Location = new Point(51, 148);
|
||||
buttonUpd.Name = "buttonUpd";
|
||||
buttonUpd.Size = new Size(79, 65);
|
||||
buttonUpd.TabIndex = 2;
|
||||
buttonUpd.UseVisualStyleBackColor = true;
|
||||
buttonUpd.Click += ButtonUpd_Click;
|
||||
//
|
||||
// buttonDel
|
||||
//
|
||||
buttonDel.BackgroundImage = Properties.Resources.kisspng_computer_icons_download_5b218289889485_4804831415289227615594;
|
||||
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonDel.Location = new Point(51, 248);
|
||||
buttonDel.Name = "buttonDel";
|
||||
buttonDel.Size = new Size(79, 65);
|
||||
buttonDel.TabIndex = 1;
|
||||
buttonDel.UseVisualStyleBackColor = true;
|
||||
buttonDel.Click += ButtonDel_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImage = Properties.Resources.Fairytale_button_add_svg;
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
buttonAdd.Location = new Point(51, 44);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(79, 65);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += ButtonAdd_Click;
|
||||
//// buttonUpd
|
||||
////
|
||||
//buttonUpd.BackgroundImage = Properties.Resources.Antu_qtdesigner_svg;
|
||||
//buttonUpd.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
//buttonUpd.Location = new Point(51, 148);
|
||||
//buttonUpd.Name = "buttonUpd";
|
||||
//buttonUpd.Size = new Size(79, 65);
|
||||
//buttonUpd.TabIndex = 2;
|
||||
//buttonUpd.UseVisualStyleBackColor = true;
|
||||
//buttonUpd.Click += ButtonUpd_Click;
|
||||
////
|
||||
//// buttonDel
|
||||
////
|
||||
//buttonDel.BackgroundImage = Properties.Resources.kisspng_computer_icons_download_5b218289889485_4804831415289227615594;
|
||||
//buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
//buttonDel.Location = new Point(51, 248);
|
||||
//buttonDel.Name = "buttonDel";
|
||||
//buttonDel.Size = new Size(79, 65);
|
||||
//buttonDel.TabIndex = 1;
|
||||
//buttonDel.UseVisualStyleBackColor = true;
|
||||
//buttonDel.Click += ButtonDel_Click;
|
||||
////
|
||||
//// buttonAdd
|
||||
////
|
||||
//buttonAdd.BackgroundImage = Properties.Resources.Fairytale_button_add_svg;
|
||||
//buttonAdd.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
//buttonAdd.Location = new Point(51, 44);
|
||||
//buttonAdd.Name = "buttonAdd";
|
||||
//buttonAdd.Size = new Size(79, 65);
|
||||
//buttonAdd.TabIndex = 0;
|
||||
//buttonAdd.UseVisualStyleBackColor = true;
|
||||
//buttonAdd.Click += ButtonAdd_Click;
|
||||
//
|
||||
// dataGridViewData
|
||||
//
|
||||
@ -107,6 +107,7 @@
|
||||
Controls.Add(dataGridViewData);
|
||||
Controls.Add(panel);
|
||||
Name = "FormPreparatoryWorks";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "Подготовительные работы";
|
||||
Load += FormPreparatoryWorks_Load;
|
||||
panel.ResumeLayout(false);
|
||||
|
@ -1,4 +1,6 @@
|
||||
using ProjectAirline.Repositories;
|
||||
using ProjectAirline.Entities.Enums;
|
||||
using ProjectAirline.Entities;
|
||||
using ProjectAirline.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@ -12,94 +14,173 @@ using Unity;
|
||||
|
||||
namespace ProjectAirline.Forms;
|
||||
|
||||
//public partial class FormPreparatoryWorks : Form
|
||||
//{
|
||||
// private readonly IUnityContainer _container;
|
||||
// private readonly IPreparatoryWorkRepository _preparatoryWorkRepository;
|
||||
|
||||
// public FormPreparatoryWorks(IUnityContainer container, IPreparatoryWorkRepository preparatoryWorkRepository)
|
||||
// {
|
||||
// InitializeComponent();
|
||||
// _container = container ?? throw new ArgumentNullException(nameof(container));
|
||||
// _preparatoryWorkRepository = preparatoryWorkRepository ?? throw new ArgumentNullException(nameof(preparatoryWorkRepository));
|
||||
// }
|
||||
|
||||
// private void FormPreparatoryWorks_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<FormPreparatoryWork>().ShowDialog();
|
||||
// LoadList();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
// }
|
||||
// }
|
||||
|
||||
// private void ButtonUpd_Click(object sender, EventArgs e)
|
||||
// {
|
||||
// if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
// var form = _container.Resolve<FormPreparatoryWork>();
|
||||
// form.Id = findId;
|
||||
// form.ShowDialog();
|
||||
// LoadList();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
// }
|
||||
// }
|
||||
|
||||
// private void ButtonDel_Click(object sender, EventArgs e)
|
||||
// {
|
||||
// if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
// _preparatoryWorkRepository.DeletePreparatoryWork(findId);
|
||||
// LoadList();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
// }
|
||||
// }
|
||||
|
||||
// private void LoadList() => dataGridViewData.DataSource = _preparatoryWorkRepository.ReadPreparatoryWorks();
|
||||
|
||||
// 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;
|
||||
// }
|
||||
//}
|
||||
public partial class FormPreparatoryWorks : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
private readonly IPreparatoryWorkRepository _preparatoryWorkRepository;
|
||||
private readonly IPlaneRepository _planeRepository;
|
||||
|
||||
public FormPreparatoryWorks(IUnityContainer container, IPreparatoryWorkRepository preparatoryWorkRepository)
|
||||
public FormPreparatoryWorks(IPreparatoryWorkRepository preparatoryWorkRepository, IPlaneRepository planeRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||
_preparatoryWorkRepository = preparatoryWorkRepository ?? throw new ArgumentNullException(nameof(preparatoryWorkRepository));
|
||||
_planeRepository = planeRepository ?? throw new ArgumentNullException(nameof(planeRepository));
|
||||
|
||||
// Настройка DataGridView
|
||||
dataGridViewData.AutoGenerateColumns = false;
|
||||
dataGridViewData.Columns.Add(new DataGridViewComboBoxColumn
|
||||
{
|
||||
Name = "ColumnPlane",
|
||||
HeaderText = "Самолет",
|
||||
DataSource = _planeRepository.ReadPlanes(),
|
||||
DisplayMember = "Name",
|
||||
ValueMember = "Id",
|
||||
DataPropertyName = "PlaneId"
|
||||
});
|
||||
dataGridViewData.Columns.Add(new DataGridViewTextBoxColumn
|
||||
{
|
||||
Name = "ColumnCount",
|
||||
HeaderText = "Количество",
|
||||
DataPropertyName = "Count"
|
||||
});
|
||||
}
|
||||
|
||||
private void FormPreparatoryWorks_Load(object sender, EventArgs e)
|
||||
private void ButtonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadList();
|
||||
if (dataGridViewData.RowCount < 1)
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля");
|
||||
}
|
||||
|
||||
var preparatoryWorkPlanes = CreateListPreparatoryWorkPlanesFromDataGrid();
|
||||
|
||||
var preparatoryWork = PreparatoryWork.CreatePreparatoryWork(
|
||||
0, // ID будет присвоен при сохранении
|
||||
-1, // FlightId (если нужно, добавьте поле для ввода)
|
||||
DateTime.Now, // StartDate (если нужно, добавьте поле для ввода)
|
||||
DateTime.Now, // EndDate (если нужно, добавьте поле для ввода)
|
||||
PreparatoryWorkStatus.None, // Status (если нужно, добавьте поле для ввода)
|
||||
preparatoryWorkPlanes
|
||||
);
|
||||
|
||||
_preparatoryWorkRepository.CreatePreparatoryWork(preparatoryWork);
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private List<PreparatoryWorkPlane> CreateListPreparatoryWorkPlanesFromDataGrid()
|
||||
{
|
||||
try
|
||||
var list = new List<PreparatoryWorkPlane>();
|
||||
foreach (DataGridViewRow row in dataGridViewData.Rows)
|
||||
{
|
||||
_container.Resolve<FormPreparatoryWork>().ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
if (row.Cells["ColumnPlane"].Value == null || row.Cells["ColumnCount"].Value == null)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
private void ButtonUpd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormPreparatoryWork>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
var planeId = Convert.ToInt32(row.Cells["ColumnPlane"].Value);
|
||||
var count = Convert.ToInt32(row.Cells["ColumnCount"].Value);
|
||||
|
||||
private void ButtonDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
list.Add(PreparatoryWorkPlane.CreateElement(0, -1, planeId, count));
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_preparatoryWorkRepository.DeletePreparatoryWork(findId);
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadList() => dataGridViewData.DataSource = _preparatoryWorkRepository.ReadPreparatoryWorks();
|
||||
|
||||
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;
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
4
ProjectAirline/Forms/FormTicket.Designer.cs
generated
4
ProjectAirline/Forms/FormTicket.Designer.cs
generated
@ -60,7 +60,7 @@
|
||||
buttonSave.TabIndex = 3;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
buttonSave.Click += ButtonSave_Click;
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
@ -70,7 +70,7 @@
|
||||
buttonCancel.TabIndex = 4;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
buttonCancel.Click += ButtonCancel_Click;
|
||||
//
|
||||
// FormTicket
|
||||
//
|
||||
|
@ -10,20 +10,55 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.VisualBasic.FileIO;
|
||||
|
||||
namespace ProjectAirline.Forms;
|
||||
|
||||
public partial class FormTicket : Form
|
||||
{
|
||||
private readonly ITicketRepository _ticketRepository;
|
||||
private int? _ticketId;
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var ticket = _ticketRepository.ReadTicketById(value);
|
||||
if (ticket == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(ticket));
|
||||
}
|
||||
|
||||
foreach (TicketStatus elem in Enum.GetValues(typeof(TicketStatus)))
|
||||
{
|
||||
if ((elem & ticket.Status) != 0)
|
||||
{
|
||||
checkedListBoxStatus.SetItemChecked(checkedListBoxStatus.Items.IndexOf(elem), true);
|
||||
}
|
||||
}
|
||||
|
||||
_ticketId = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FormTicket(ITicketRepository ticketRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_ticketRepository = ticketRepository ?? throw new ArgumentNullException(nameof(ticketRepository));
|
||||
|
||||
//Тут нада чета делать но я пьяный уже пол 2 ночи пора спать
|
||||
//checkedListBoxStatus.Items.AddRange(Enum.GetValues(typeof(TicketStatus)).Cast<TicketStatus>().ToArray());
|
||||
foreach (var elem in Enum.GetValues(typeof(TicketStatus)))
|
||||
{
|
||||
checkedListBoxStatus.Items.Add(elem);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ButtonSave_Click(object sender, EventArgs e)
|
||||
@ -36,7 +71,15 @@ public partial class FormTicket : Form
|
||||
throw new Exception("Необходимо выбрать хотя бы один статус");
|
||||
}
|
||||
|
||||
_ticketRepository.CreateTicket(Ticket.CreateTicket(0, status));
|
||||
if (_ticketId.HasValue)
|
||||
{
|
||||
_ticketRepository.UpdateTicket(CreateTicket(_ticketId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_ticketRepository.CreateTicket(CreateTicket(0));
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -47,6 +90,12 @@ public partial class FormTicket : Form
|
||||
|
||||
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private Ticket CreateTicket(int id)
|
||||
{
|
||||
var status = GetTicketStatusFromCheckedListBox();
|
||||
return Ticket.CreateTicket(id, status);
|
||||
}
|
||||
|
||||
private TicketStatus GetTicketStatusFromCheckedListBox()
|
||||
{
|
||||
TicketStatus status = TicketStatus.None;
|
||||
|
125
ProjectAirline/Forms/FormTickets.Designer.cs
generated
Normal file
125
ProjectAirline/Forms/FormTickets.Designer.cs
generated
Normal file
@ -0,0 +1,125 @@
|
||||
namespace ProjectAirline.Forms
|
||||
{
|
||||
partial class FormTickets
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
panel = new Panel();
|
||||
dataGridViewData = new DataGridView();
|
||||
buttonAdd = new Button();
|
||||
buttonUpd = new Button();
|
||||
buttonDel = new Button();
|
||||
panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel
|
||||
//
|
||||
panel.Controls.Add(buttonDel);
|
||||
panel.Controls.Add(buttonUpd);
|
||||
panel.Controls.Add(buttonAdd);
|
||||
panel.Dock = DockStyle.Right;
|
||||
panel.Location = new Point(600, 0);
|
||||
panel.Name = "panel";
|
||||
panel.Size = new Size(200, 450);
|
||||
panel.TabIndex = 0;
|
||||
//
|
||||
// dataGridViewData
|
||||
//
|
||||
dataGridViewData.AllowUserToAddRows = false;
|
||||
dataGridViewData.AllowUserToDeleteRows = false;
|
||||
dataGridViewData.AllowUserToResizeColumns = false;
|
||||
dataGridViewData.AllowUserToResizeRows = false;
|
||||
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridViewData.ColumnHeadersVisible = false;
|
||||
dataGridViewData.Dock = DockStyle.Fill;
|
||||
dataGridViewData.Location = new Point(0, 0);
|
||||
dataGridViewData.MultiSelect = false;
|
||||
dataGridViewData.Name = "dataGridViewData";
|
||||
dataGridViewData.ReadOnly = true;
|
||||
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridViewData.Size = new Size(600, 450);
|
||||
dataGridViewData.TabIndex = 1;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImage = Properties.Resources.Fairytale_button_add_svg;
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
buttonAdd.Location = new Point(35, 70);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(69, 65);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += ButtonAdd_Click;
|
||||
//
|
||||
// buttonUpd
|
||||
//
|
||||
buttonUpd.BackgroundImage = Properties.Resources.Antu_qtdesigner_svg;
|
||||
buttonUpd.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
buttonUpd.Location = new Point(35, 166);
|
||||
buttonUpd.Name = "buttonUpd";
|
||||
buttonUpd.Size = new Size(69, 65);
|
||||
buttonUpd.TabIndex = 1;
|
||||
buttonUpd.UseVisualStyleBackColor = true;
|
||||
buttonUpd.Click += ButtonUpd_Click;
|
||||
//
|
||||
// buttonDel
|
||||
//
|
||||
buttonDel.BackgroundImage = Properties.Resources.kisspng_computer_icons_download_5b218289889485_4804831415289227615594;
|
||||
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonDel.Location = new Point(35, 264);
|
||||
buttonDel.Name = "buttonDel";
|
||||
buttonDel.Size = new Size(69, 65);
|
||||
buttonDel.TabIndex = 2;
|
||||
buttonDel.UseVisualStyleBackColor = true;
|
||||
buttonDel.Click += ButtonDel_Click;
|
||||
//
|
||||
// FormTickets
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(dataGridViewData);
|
||||
Controls.Add(panel);
|
||||
Name = "FormTickets";
|
||||
Text = "Билеты";
|
||||
Load += FormTickets_Load;
|
||||
panel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panel;
|
||||
private Button buttonDel;
|
||||
private Button buttonUpd;
|
||||
private Button buttonAdd;
|
||||
private DataGridView dataGridViewData;
|
||||
}
|
||||
}
|
105
ProjectAirline/Forms/FormTickets.cs
Normal file
105
ProjectAirline/Forms/FormTickets.cs
Normal file
@ -0,0 +1,105 @@
|
||||
using ProjectAirline.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectAirline.Forms;
|
||||
|
||||
public partial class FormTickets : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
private readonly ITicketRepository _ticketRepository;
|
||||
|
||||
public FormTickets(IUnityContainer container, ITicketRepository ticketRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||
_ticketRepository = ticketRepository ?? throw new ArgumentNullException(nameof(ticketRepository));
|
||||
}
|
||||
|
||||
private void FormTickets_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<FormTicket>().ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonUpd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormTicket>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_ticketRepository.DeleteTicket(findId);
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadList() => dataGridViewData.DataSource = _ticketRepository.ReadTickets();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
120
ProjectAirline/Forms/FormTickets.resx
Normal file
120
ProjectAirline/Forms/FormTickets.resx
Normal 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>
|
@ -15,6 +15,7 @@ public interface IPreparatoryWorkRepository
|
||||
void CreatePreparatoryWork(PreparatoryWork preparatoryWork);
|
||||
|
||||
void UpdatePreparatoryWork(PreparatoryWork preparatoryWork);
|
||||
|
||||
void DeletePreparatoryWork(int id);
|
||||
|
||||
PreparatoryWork ReadPreparatoryWorkById(int id);
|
||||
|
@ -21,13 +21,20 @@ public class PreparatoryWorkRepository : IPreparatoryWorkRepository
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
public PreparatoryWork ReadPreparatoryWorkById(int id)
|
||||
{
|
||||
return PreparatoryWork.CreatePrerapatoryWork(0, 0, 0, DateTime.Now, DateTime.Now, 0);
|
||||
return PreparatoryWork.CreatePreparatoryWork(0, 0, DateTime.Now, DateTime.Now, 0);
|
||||
}
|
||||
|
||||
public IEnumerable<PreparatoryWork> ReadPreparatoryWork(DateTime? dateFrom = null, int? planeId = null, int? flightId = null, DateTime? dateTo = null, int? preparatoryWorkId = null, PreparatoryWork? preparatoryWorkStatus = null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public IEnumerable<PreparatoryWork> ReadPreparatoryWorks()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user