visual studio momento

This commit is contained in:
DavidMakarov 2024-06-21 16:01:34 +04:00
parent 18a0b79d79
commit 6cf160b0b2
10 changed files with 240 additions and 522 deletions

View File

@ -22,178 +22,6 @@
#region Windows Form Designer generated code #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();
Цветы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();
dataGridView = new DataGridView();
buttonCreateOrder = new Button();
buttonIssuedOrder = new Button();
buttonRef = new Button();
menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// menuStrip1
//
menuStrip1.ImageScalingSize = new Size(20, 20);
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчётыToolStripMenuItem, запускToolStripMenuItem });
menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Padding = new Padding(7, 3, 0, 3);
menuStrip1.Size = new Size(1102, 30);
menuStrip1.TabIndex = 0;
menuStrip1.Text = "menuStrip1";
//
// справочникиToolStripMenuItem
//
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ЦветыToolStripMenuItem, КомпонентыToolStripMenuItem, клиентыToolStripMenuItem, исполнителиToolStripMenuItem });
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
справочникиToolStripMenuItem.Size = new Size(117, 24);
справочникиToolStripMenuItem.Text = "Справочники";
//
// ЦветыToolStripMenuItem
//
ЦветыToolStripMenuItem.Name = "ЦветыToolStripMenuItem";
ЦветыToolStripMenuItem.Size = new Size(185, 26);
ЦветыToolStripMenuItem.Text = "Цветы";
ЦветыToolStripMenuItem.Click += ЦветыToolStripMenuItem_Click;
//
// КомпонентыToolStripMenuItem
//
КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem";
КомпонентыToolStripMenuItem.Size = new Size(185, 26);
КомпонентыToolStripMenuItem.Text = "Компоненты";
КомпонентыToolStripMenuItem.Click += КомпонентыToolStripMenuItem_Click;
//
// клиентыToolStripMenuItem
//
клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem";
клиентыToolStripMenuItem.Size = new Size(185, 26);
клиентыToolStripMenuItem.Text = "Клиенты";
клиентыToolStripMenuItem.Click += клиентыToolStripMenuItem_Click;
//
// исполнителиToolStripMenuItem
//
исполнителиToolStripMenuItem.Name = сполнителиToolStripMenuItem";
исполнителиToolStripMenuItem.Size = new Size(185, 26);
исполнителиToolStripMenuItem.Text = "Исполнители";
исполнителиToolStripMenuItem.Click += исполнителиToolStripMenuItem_Click;
//
// отчётыToolStripMenuItem
//
отчётыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокЦветковToolStripMenuItem, компонентыПоЦветамToolStripMenuItem, списокЗаказовToolStripMenuItem });
отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem";
отчётыToolStripMenuItem.Size = new Size(73, 24);
отчётыToolStripMenuItem.Text = "Отчёты";
//
// списокЦветковToolStripMenuItem
//
списокЦветковToolStripMenuItem.Name = "списокЦветковToolStripMenuItem";
списокЦветковToolStripMenuItem.Size = new Size(258, 26);
списокЦветковToolStripMenuItem.Text = "Список цветков";
списокЦветковToolStripMenuItem.Click += списокЦветковToolStripMenuItem_Click;
//
// компонентыПоЦветамToolStripMenuItem
//
компонентыПоЦветамToolStripMenuItem.Name = омпонентыПоЦветамToolStripMenuItem";
компонентыПоЦветамToolStripMenuItem.Size = new Size(258, 26);
компонентыПоЦветамToolStripMenuItem.Text = "Компоненты по цветам";
компонентыПоЦветамToolStripMenuItem.Click += компонентыПоЦветамToolStripMenuItem_Click;
//
// списокЗаказовToolStripMenuItem
//
списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
списокЗаказовToolStripMenuItem.Size = new Size(258, 26);
списокЗаказовToolStripMenuItem.Text = "Список заказов";
списокЗаказовToolStripMenuItem.Click += списокЗаказовToolStripMenuItem_Click;
//
// запускToolStripMenuItem
//
запускToolStripMenuItem.Name = апускToolStripMenuItem";
запускToolStripMenuItem.Size = new Size(114, 24);
запускToolStripMenuItem.Text = "Запуск работ";
запускToolStripMenuItem.Click += запускToolStripMenuItem_Click;
//
// dataGridView
//
dataGridView.BackgroundColor = Color.White;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Location = new Point(14, 36);
dataGridView.Margin = new Padding(3, 4, 3, 4);
dataGridView.Name = "dataGridView";
dataGridView.RowHeadersWidth = 51;
dataGridView.RowTemplate.Height = 25;
dataGridView.Size = new Size(845, 548);
dataGridView.TabIndex = 1;
//
// buttonCreateOrder
//
buttonCreateOrder.Location = new Point(886, 73);
buttonCreateOrder.Margin = new Padding(3, 4, 3, 4);
buttonCreateOrder.Name = "buttonCreateOrder";
buttonCreateOrder.Size = new Size(181, 43);
buttonCreateOrder.TabIndex = 2;
buttonCreateOrder.Text = "Создать заказ";
buttonCreateOrder.UseVisualStyleBackColor = true;
buttonCreateOrder.Click += ButtonCreateOrder_Click;
//
// buttonIssuedOrder
//
buttonIssuedOrder.Location = new Point(886, 147);
buttonIssuedOrder.Margin = new Padding(3, 4, 3, 4);
buttonIssuedOrder.Name = "buttonIssuedOrder";
buttonIssuedOrder.Size = new Size(181, 43);
buttonIssuedOrder.TabIndex = 3;
buttonIssuedOrder.Text = "Заказ выдан";
buttonIssuedOrder.UseVisualStyleBackColor = true;
buttonIssuedOrder.Click += ButtonIssuedOrder_Click;
//
// buttonRef
//
buttonRef.Location = new Point(886, 220);
buttonRef.Margin = new Padding(3, 4, 3, 4);
buttonRef.Name = "buttonRef";
buttonRef.Size = new Size(181, 43);
buttonRef.TabIndex = 6;
buttonRef.Text = "Обновить список";
buttonRef.UseVisualStyleBackColor = true;
buttonRef.Click += ButtonRef_Click;
//
// FormMain
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1102, 600);
Controls.Add(buttonRef);
Controls.Add(buttonIssuedOrder);
Controls.Add(buttonCreateOrder);
Controls.Add(dataGridView);
Controls.Add(menuStrip1);
MainMenuStrip = menuStrip1;
Margin = new Padding(3, 4, 3, 4);
Name = "FormMain";
Text = "Цветочный магазин";
Load += FormMain_Load;
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
PerformLayout();
}
/// <summary> /// <summary>
/// Required method for Designer support - do not modify /// Required method for Designer support - do not modify
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
@ -206,6 +34,7 @@
КомпонентыToolStripMenuItem = new ToolStripMenuItem(); КомпонентыToolStripMenuItem = new ToolStripMenuItem();
магазиныToolStripMenuItem = new ToolStripMenuItem(); магазиныToolStripMenuItem = new ToolStripMenuItem();
клиентыToolStripMenuItem = new ToolStripMenuItem(); клиентыToolStripMenuItem = new ToolStripMenuItem();
исполнителиToolStripMenuItem1 = new ToolStripMenuItem();
отчётыToolStripMenuItem = new ToolStripMenuItem(); отчётыToolStripMenuItem = new ToolStripMenuItem();
списокЦветковToolStripMenuItem = new ToolStripMenuItem(); списокЦветковToolStripMenuItem = new ToolStripMenuItem();
компонентыПоЦветамToolStripMenuItem = new ToolStripMenuItem(); компонентыПоЦветамToolStripMenuItem = new ToolStripMenuItem();
@ -213,14 +42,13 @@
списокМагазиновToolStripMenuItem = new ToolStripMenuItem(); списокМагазиновToolStripMenuItem = new ToolStripMenuItem();
загруженностьМагазиновToolStripMenuItem = new ToolStripMenuItem(); загруженностьМагазиновToolStripMenuItem = new ToolStripMenuItem();
заказыПоДатамToolStripMenuItem = new ToolStripMenuItem(); заказыПоДатамToolStripMenuItem = new ToolStripMenuItem();
dataGridView = new DataGridView();
buttonCreateOrder = new Button();
buttonTakeOrderInWork = new Button();
buttonOrderReady = new Button();
buttonIssuedOrder = new Button();
buttonRef = new Button();
пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem(); пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem();
продажаЦветовToolStripMenuItem = new ToolStripMenuItem(); продажаЦветовToolStripMenuItem = new ToolStripMenuItem();
запускРаботToolStripMenuItem = new ToolStripMenuItem();
dataGridView = new DataGridView();
buttonCreateOrder = new Button();
buttonIssuedOrder = new Button();
buttonRef = new Button();
menuStrip1.SuspendLayout(); menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout(); SuspendLayout();
@ -228,7 +56,7 @@
// menuStrip1 // menuStrip1
// //
menuStrip1.ImageScalingSize = new Size(20, 20); menuStrip1.ImageScalingSize = new Size(20, 20);
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчётыToolStripMenuItem, пополнениеМагазинаToolStripMenuItem, продажаЦветовToolStripMenuItem }); menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчётыToolStripMenuItem, пополнениеМагазинаToolStripMenuItem, продажаЦветовToolStripMenuItem, запускРаботToolStripMenuItem });
menuStrip1.Location = new Point(0, 0); menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1"; menuStrip1.Name = "menuStrip1";
menuStrip1.Padding = new Padding(7, 3, 0, 3); menuStrip1.Padding = new Padding(7, 3, 0, 3);
@ -238,7 +66,7 @@
// //
// справочникиToolStripMenuItem // справочникиToolStripMenuItem
// //
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ЦветыToolStripMenuItem, КомпонентыToolStripMenuItem, магазиныToolStripMenuItem, клиентыToolStripMenuItem }); справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ЦветыToolStripMenuItem, КомпонентыToolStripMenuItem, магазиныToolStripMenuItem, клиентыToolStripMenuItem, исполнителиToolStripMenuItem1 });
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
справочникиToolStripMenuItem.Size = new Size(117, 24); справочникиToolStripMenuItem.Size = new Size(117, 24);
справочникиToolStripMenuItem.Text = "Справочники"; справочникиToolStripMenuItem.Text = "Справочники";
@ -246,31 +74,38 @@
// ЦветыToolStripMenuItem // ЦветыToolStripMenuItem
// //
ЦветыToolStripMenuItem.Name = "ЦветыToolStripMenuItem"; ЦветыToolStripMenuItem.Name = "ЦветыToolStripMenuItem";
ЦветыToolStripMenuItem.Size = new Size(182, 26); ЦветыToolStripMenuItem.Size = new Size(224, 26);
ЦветыToolStripMenuItem.Text = "Цветы"; ЦветыToolStripMenuItem.Text = "Цветы";
ЦветыToolStripMenuItem.Click += ЦветыToolStripMenuItem_Click; ЦветыToolStripMenuItem.Click += ЦветыToolStripMenuItem_Click;
// //
// КомпонентыToolStripMenuItem // КомпонентыToolStripMenuItem
// //
КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem"; КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem";
КомпонентыToolStripMenuItem.Size = new Size(182, 26); КомпонентыToolStripMenuItem.Size = new Size(224, 26);
КомпонентыToolStripMenuItem.Text = "Компоненты"; КомпонентыToolStripMenuItem.Text = "Компоненты";
КомпонентыToolStripMenuItem.Click += КомпонентыToolStripMenuItem_Click; КомпонентыToolStripMenuItem.Click += КомпонентыToolStripMenuItem_Click;
// //
// магазиныToolStripMenuItem // магазиныToolStripMenuItem
// //
магазиныToolStripMenuItem.Name = агазиныToolStripMenuItem"; магазиныToolStripMenuItem.Name = агазиныToolStripMenuItem";
магазиныToolStripMenuItem.Size = new Size(182, 26); магазиныToolStripMenuItem.Size = new Size(224, 26);
магазиныToolStripMenuItem.Text = "Магазины"; магазиныToolStripMenuItem.Text = "Магазины";
магазиныToolStripMenuItem.Click += магазиныToolStripMenuItem_Click; магазиныToolStripMenuItem.Click += магазиныToolStripMenuItem_Click;
// //
// клиентыToolStripMenuItem // клиентыToolStripMenuItem
// //
клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem"; клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem";
клиентыToolStripMenuItem.Size = new Size(182, 26); клиентыToolStripMenuItem.Size = new Size(224, 26);
клиентыToolStripMenuItem.Text = "Клиенты"; клиентыToolStripMenuItem.Text = "Клиенты";
клиентыToolStripMenuItem.Click += клиентыToolStripMenuItem_Click; клиентыToolStripMenuItem.Click += клиентыToolStripMenuItem_Click;
// //
// исполнителиToolStripMenuItem1
//
исполнителиToolStripMenuItem1.Name = сполнителиToolStripMenuItem1";
исполнителиToolStripMenuItem1.Size = new Size(224, 26);
исполнителиToolStripMenuItem1.Text = "Исполнители";
исполнителиToolStripMenuItem1.Click += исполнителиToolStripMenuItem1_Click;
//
// отчётыToolStripMenuItem // отчётыToolStripMenuItem
// //
отчётыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокЦветковToolStripMenuItem, компонентыПоЦветамToolStripMenuItem, списокЗаказовToolStripMenuItem, списокМагазиновToolStripMenuItem, загруженностьМагазиновToolStripMenuItem, заказыПоДатамToolStripMenuItem }); отчётыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокЦветковToolStripMenuItem, компонентыПоЦветамToolStripMenuItem, списокЗаказовToolStripMenuItem, списокМагазиновToolStripMenuItem, загруженностьМагазиновToolStripMenuItem, заказыПоДатамToolStripMenuItem });
@ -320,6 +155,27 @@
заказыПоДатамToolStripMenuItem.Text = "Заказы по датам"; заказыПоДатамToolStripMenuItem.Text = "Заказы по датам";
заказыПоДатамToolStripMenuItem.Click += заказыПоДатамToolStripMenuItem_Click; заказыПоДатамToolStripMenuItem.Click += заказыПоДатамToolStripMenuItem_Click;
// //
// пополнениеМагазинаToolStripMenuItem
//
пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem";
пополнениеМагазинаToolStripMenuItem.Size = new Size(182, 24);
пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина";
пополнениеМагазинаToolStripMenuItem.Click += пополнениеМагазинаToolStripMenuItem_Click;
//
// продажаЦветовToolStripMenuItem
//
продажаЦветовToolStripMenuItem.Name = "продажаЦветовToolStripMenuItem";
продажаЦветовToolStripMenuItem.Size = new Size(139, 24);
продажаЦветовToolStripMenuItem.Text = "Продажа цветов";
продажаЦветовToolStripMenuItem.Click += продажаЦветовToolStripMenuItem_Click;
//
// запускРаботToolStripMenuItem
//
запускРаботToolStripMenuItem.Name = апускРаботToolStripMenuItem";
запускРаботToolStripMenuItem.Size = new Size(114, 24);
запускРаботToolStripMenuItem.Text = "Запуск работ";
запускРаботToolStripMenuItem.Click += запускРаботToolStripMenuItem_Click;
//
// dataGridView // dataGridView
// //
dataGridView.BackgroundColor = Color.White; dataGridView.BackgroundColor = Color.White;
@ -343,31 +199,9 @@
buttonCreateOrder.UseVisualStyleBackColor = true; buttonCreateOrder.UseVisualStyleBackColor = true;
buttonCreateOrder.Click += ButtonCreateOrder_Click; buttonCreateOrder.Click += ButtonCreateOrder_Click;
// //
// buttonTakeOrderInWork
//
buttonTakeOrderInWork.Location = new Point(886, 147);
buttonTakeOrderInWork.Margin = new Padding(3, 4, 3, 4);
buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
buttonTakeOrderInWork.Size = new Size(181, 45);
buttonTakeOrderInWork.TabIndex = 3;
buttonTakeOrderInWork.Text = "Отдать на выполнение";
buttonTakeOrderInWork.UseVisualStyleBackColor = true;
buttonTakeOrderInWork.Click += ButtonTakeOrderInWork_Click;
//
// buttonOrderReady
//
buttonOrderReady.Location = new Point(886, 224);
buttonOrderReady.Margin = new Padding(3, 4, 3, 4);
buttonOrderReady.Name = "buttonOrderReady";
buttonOrderReady.Size = new Size(181, 45);
buttonOrderReady.TabIndex = 4;
buttonOrderReady.Text = "Заказ готов";
buttonOrderReady.UseVisualStyleBackColor = true;
buttonOrderReady.Click += ButtonOrderReady_Click;
//
// buttonIssuedOrder // buttonIssuedOrder
// //
buttonIssuedOrder.Location = new Point(886, 307); buttonIssuedOrder.Location = new Point(886, 146);
buttonIssuedOrder.Margin = new Padding(3, 4, 3, 4); buttonIssuedOrder.Margin = new Padding(3, 4, 3, 4);
buttonIssuedOrder.Name = "buttonIssuedOrder"; buttonIssuedOrder.Name = "buttonIssuedOrder";
buttonIssuedOrder.Size = new Size(181, 45); buttonIssuedOrder.Size = new Size(181, 45);
@ -378,7 +212,7 @@
// //
// buttonRef // buttonRef
// //
buttonRef.Location = new Point(886, 385); buttonRef.Location = new Point(886, 224);
buttonRef.Margin = new Padding(3, 4, 3, 4); buttonRef.Margin = new Padding(3, 4, 3, 4);
buttonRef.Name = "buttonRef"; buttonRef.Name = "buttonRef";
buttonRef.Size = new Size(181, 45); buttonRef.Size = new Size(181, 45);
@ -387,20 +221,6 @@
buttonRef.UseVisualStyleBackColor = true; buttonRef.UseVisualStyleBackColor = true;
buttonRef.Click += ButtonRef_Click; buttonRef.Click += ButtonRef_Click;
// //
// пополнениеМагазинаToolStripMenuItem
//
пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem";
пополнениеМагазинаToolStripMenuItem.Size = new Size(182, 24);
пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина";
пополнениеМагазинаToolStripMenuItem.Click += пополнениеМагазинаToolStripMenuItem_Click;
//
// продажаЦветовToolStripMenuItem
//
продажаЦветовToolStripMenuItem.Name = "продажаЦветовToolStripMenuItem";
продажаЦветовToolStripMenuItem.Size = new Size(139, 24);
продажаЦветовToolStripMenuItem.Text = "Продажа цветов";
продажаЦветовToolStripMenuItem.Click += продажаЦветовToolStripMenuItem_Click;
//
// FormMain // FormMain
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
@ -408,8 +228,6 @@
ClientSize = new Size(1102, 600); ClientSize = new Size(1102, 600);
Controls.Add(buttonRef); Controls.Add(buttonRef);
Controls.Add(buttonIssuedOrder); Controls.Add(buttonIssuedOrder);
Controls.Add(buttonOrderReady);
Controls.Add(buttonTakeOrderInWork);
Controls.Add(buttonCreateOrder); Controls.Add(buttonCreateOrder);
Controls.Add(dataGridView); Controls.Add(dataGridView);
Controls.Add(menuStrip1); Controls.Add(menuStrip1);
@ -425,22 +243,12 @@
PerformLayout(); PerformLayout();
} }
#endregion
private void ПродажаЦветовToolStripMenuItem_Click(object sender, EventArgs e)
{
throw new NotImplementedException();
}
#endregion #endregion
private MenuStrip menuStrip1; private MenuStrip menuStrip1;
private ToolStripMenuItem справочникиToolStripMenuItem; private ToolStripMenuItem справочникиToolStripMenuItem;
private ToolStripMenuItem ЦветыToolStripMenuItem; private ToolStripMenuItem ЦветыToolStripMenuItem;
private ToolStripMenuItem КомпонентыToolStripMenuItem; private ToolStripMenuItem КомпонентыToolStripMenuItem;
private MenuStrip menuStrip1;
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;
@ -449,25 +257,14 @@
private Button buttonCreateOrder; private Button buttonCreateOrder;
private Button buttonIssuedOrder; private Button buttonIssuedOrder;
private Button buttonRef; private Button buttonRef;
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 Button buttonCreateOrder;
private Button buttonTakeOrderInWork;
private Button buttonOrderReady;
private Button buttonIssuedOrder;
private Button buttonRef;
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;
private ToolStripMenuItem пополнениеМагазинаToolStripMenuItem; private ToolStripMenuItem пополнениеМагазинаToolStripMenuItem;
private ToolStripMenuItem продажаЦветовToolStripMenuItem; private ToolStripMenuItem продажаЦветовToolStripMenuItem;
private ToolStripMenuItem исполнителиToolStripMenuItem1;
private ToolStripMenuItem запускРаботToolStripMenuItem;
} }
} }

View File

@ -4,109 +4,19 @@ using Microsoft.Extensions.Logging;
namespace FlowerShopView namespace FlowerShopView
{ {
public partial class FormMain : Form
{
private readonly ILogger _logger;
private readonly IOrderLogic _orderLogic;
private readonly IReportLogic _reportLogic;
private readonly IWorkProcess _workProcess;
public FormMain(ILogger<FormMain> logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess)
{
InitializeComponent();
_logger = logger;
_orderLogic = orderLogic;
_reportLogic = reportLogic;
_workProcess = workProcess;
}
private void FormMain_Load(object sender, EventArgs e)
{
LoadData();
}
private void LoadData()
{
_logger.LogInformation("Загрузка заказов");
try
{
var list = _orderLogic.ReadList(null);
if (list != null)
{
dataGridView.DataSource = list;
dataGridView.Columns["FlowerId"].Visible = false;
dataGridView.Columns["ClientId"].Visible = false;
dataGridView.Columns["ImplementerId"].Visible = false;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки заказов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void КомпонентыToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormComponents));
if (service is FormComponents form)
{
form.ShowDialog();
}
}
private void ЦветыToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormFlowers));
if (service is FormFlowers form)
{
form.ShowDialog();
}
}
private void ButtonCreateOrder_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder));
if (service is FormCreateOrder form)
{
form.ShowDialog();
LoadData();
}
}
private void ButtonIssuedOrder_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 1)
{
int id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Заказ №{id}. Меняется статус на 'Выдан'", id);
try
{
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel { Id = id });
if (!operationResult)
{
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
}
_logger.LogInformation("Заказ №{id} выдан", id);
LoadData();
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка отметки о выдачи заказа");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
}
private void ButtonRef_Click(object sender, EventArgs e)
{
LoadData();
}
public partial class FormMain : Form public partial class FormMain : Form
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IOrderLogic _orderLogic; private readonly IOrderLogic _orderLogic;
private readonly IReportLogic _reportLogic; private readonly IReportLogic _reportLogic;
public FormMain(ILogger<FormMain> logger, IOrderLogic orderLogic, IReportLogic reportLogic) private readonly IWorkProcess _workProcess;
public FormMain(ILogger<FormMain> logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess)
{ {
InitializeComponent(); InitializeComponent();
_logger = logger; _logger = logger;
_orderLogic = orderLogic; _orderLogic = orderLogic;
_reportLogic = reportLogic; _reportLogic = reportLogic;
_workProcess = workProcess;
} }
private void FormMain_Load(object sender, EventArgs e) private void FormMain_Load(object sender, EventArgs e)
{ {
@ -123,6 +33,7 @@ namespace FlowerShopView
dataGridView.DataSource = list; dataGridView.DataSource = list;
dataGridView.Columns["FlowerId"].Visible = false; dataGridView.Columns["FlowerId"].Visible = false;
dataGridView.Columns["ClientId"].Visible = false; dataGridView.Columns["ClientId"].Visible = false;
dataGridView.Columns["ImplementerId"].Visible = false;
} }
} }
catch (Exception ex) catch (Exception ex)
@ -156,55 +67,6 @@ namespace FlowerShopView
LoadData(); LoadData();
} }
} }
private void ButtonTakeOrderInWork_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 1)
{
int id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id);
try
{
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { Id = id });
if (!operationResult)
{
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
}
LoadData();
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка передачи заказа в работу");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void ButtonOrderReady_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 1)
{
int id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'",
id);
try
{
var operationResult = _orderLogic.FinishOrder(new
OrderBindingModel
{ Id = id });
if (!operationResult)
{
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
}
LoadData();
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка отметки о готовности заказа");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void ButtonIssuedOrder_Click(object sender, EventArgs e) private void ButtonIssuedOrder_Click(object sender, EventArgs e)
{ {
if (dataGridView.SelectedRows.Count == 1) if (dataGridView.SelectedRows.Count == 1)
@ -285,30 +147,15 @@ namespace FlowerShopView
} }
} }
private void клиентыToolStripMenuItem_Click(object sender, EventArgs e) private void клиентыToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormClients)); var service = Program.ServiceProvider?.GetService(typeof(FormClients));
if (service is FormClients form) if (service is FormClients form)
{ {
form.ShowDialog(); form.ShowDialog();
} }
} }
private void исполнителиToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormImplementers));
if (service is FormImplementers form)
{
form.ShowDialog();
}
}
private void запускToolStripMenuItem_Click(object sender, EventArgs e)
{
_workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!, _orderLogic);
MessageBox.Show("Процесс обработки запущен", "Сообщение",MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void заказыПоДатамToolStripMenuItem_Click(object sender, EventArgs e) private void заказыПоДатамToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders)); var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders));
@ -327,14 +174,6 @@ namespace FlowerShopView
} }
} }
private void клиентыToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormClients));
if (service is FormClients form)
{
form.ShowDialog();
}
}
private void пополнениеМагазинаToolStripMenuItem_Click(object sender, EventArgs e) private void пополнениеМагазинаToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormMakeSupply)); var service = Program.ServiceProvider?.GetService(typeof(FormMakeSupply));
@ -352,5 +191,20 @@ namespace FlowerShopView
form.ShowDialog(); form.ShowDialog();
} }
} }
private void исполнителиToolStripMenuItem1_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormImplementers));
if (service is FormImplementers form)
{
form.ShowDialog();
}
}
private void запускРаботToolStripMenuItem_Click(object sender, EventArgs e)
{
_workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!, _orderLogic);
MessageBox.Show("Процесс обработки запущен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
} }
} }

View File

@ -32,6 +32,7 @@ namespace FlowerShopView
dataGridView.DataSource = list; dataGridView.DataSource = list;
dataGridView.Columns["Id"].Visible = false; dataGridView.Columns["Id"].Visible = false;
dataGridView.Columns["ShopName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView.Columns["ShopName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
dataGridView.Columns["ViewFlowers"].Visible = false;
dataGridView.Columns["ShopFlowers"].Visible = false; dataGridView.Columns["ShopFlowers"].Visible = false;
} }
_logger.LogInformation("Shops loading"); _logger.LogInformation("Shops loading");

View File

@ -13,12 +13,11 @@ namespace FlowerShopBusinessLogic.BusinessLogics
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IOrderStorage _orderStorage; private readonly IOrderStorage _orderStorage;
static readonly object _locker = new object();
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage)
private readonly IFlowerStorage _flowerStorage; private readonly IFlowerStorage _flowerStorage;
private readonly IShopStorage _shopStorage; private readonly IShopStorage _shopStorage;
private readonly IShopLogic _shopLogic; private readonly IShopLogic _shopLogic;
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage, IFlowerStorage flowerStorage, IShopStorage shopStorage, IShopLogic shopLogic) static readonly object _locker = new object();
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage, IFlowerStorage flowerStorage, IShopStorage shopStorage, IShopLogic shopLogic)
{ {
_logger = logger; _logger = logger;
_orderStorage = orderStorage; _orderStorage = orderStorage;
@ -110,9 +109,10 @@ namespace FlowerShopBusinessLogic.BusinessLogics
model.Count = element.Count; model.Count = element.Count;
model.Sum = element.Sum; model.Sum = element.Sum;
if (model.Status != orderStatus - 1) if ((model.Status + 1 != orderStatus && model.Status != OrderStatus.Ожидание)
|| (model.Status == OrderStatus.Ожидание && orderStatus != OrderStatus.Выдан))
{ {
_logger.LogWarning("Status update to " + orderStatus + " operation failed"); _logger.LogWarning("Change status operation failed");
return false; return false;
} }
if (orderStatus == OrderStatus.Выдан) if (orderStatus == OrderStatus.Выдан)
@ -124,12 +124,17 @@ namespace FlowerShopBusinessLogic.BusinessLogics
} }
if (!SupplyFlowers(flower, model.Count)) if (!SupplyFlowers(flower, model.Count))
{ {
_logger.LogWarning("Change status operation failed. Flowers delivery operation failed"); _logger.LogWarning("Change status operation failed. Ice creams delivery operation failed");
return false; model.Status = OrderStatus.Ожидание;
} if (_orderStorage.Update(model) == null)
{
_logger.LogWarning("Update operation failed");
}
return false;
}
} }
model.Status = orderStatus; model.Status = orderStatus;
if (model.Status == OrderStatus.Готов) if (model.Status == OrderStatus.Выдан)
{ {
model.DateImplement = DateTime.Now; model.DateImplement = DateTime.Now;
} }

View File

@ -19,84 +19,86 @@ namespace FlowerShopBusinessLogic.BusinessLogics
_rnd = new Random(1000); _rnd = new Random(1000);
} }
public void DoWork(IImplementerLogic ImplementerLogic, IOrderLogic OrderLogic) public void DoWork(IImplementerLogic implementerLogic, IOrderLogic orderLogic)
{ {
_orderLogic = OrderLogic; _orderLogic = orderLogic;
var implementers = implementerLogic.ReadList(null);
var Implementers = ImplementerLogic.ReadList(null); if (implementers == null)
if (Implementers == null)
{ {
_logger.LogWarning("DoWork. Implementers is null"); _logger.LogWarning("DoWork. Implementers is null");
return; return;
} }
List<OrderViewModel>? orders = new();
var Orders = _orderLogic.ReadList(new OrderSearchModel { Status = OrderStatus.Принят }); orders.AddRange(_orderLogic.ReadList(new() { Status = OrderStatus.Принят }) ?? new());
var BeingProcessedOrders = _orderLogic.ReadList(new OrderSearchModel { Status = OrderStatus.Выполняется }); orders.AddRange(_orderLogic.ReadList(new() { Status = OrderStatus.Выполняется }) ?? new());
orders.AddRange(_orderLogic.ReadList(new() { Status = OrderStatus.Ожидание }) ?? new());
if (Orders == null || BeingProcessedOrders == null || (Orders.Count == 0 && BeingProcessedOrders.Count == 0)) if (orders.Count == 0)
{ {
_logger.LogWarning("DoWork. Orders is null or empty"); _logger.LogWarning("DoWork. Orders is empty");
return; return;
} }
_logger.LogDebug("DoWork for {Count} orders", orders.Count);
_logger.LogDebug("DoWork for {Count} orders", Orders.Count); foreach (var implementer in implementers)
foreach (var Implementer in Implementers)
{ {
Task.Run(() => WorkerWorkAsync(Implementer, Orders)); Task.Run(() => WorkerWorkAsync(implementer, orders));
} }
} }
private async Task WorkerWorkAsync(ImplementerViewModel Implementer, List<OrderViewModel> Orders) private async Task WorkerWorkAsync(ImplementerViewModel implementer, List<OrderViewModel> orders)
{ {
if (_orderLogic == null || Implementer == null) if (_orderLogic == null || implementer == null)
{ {
return; return;
} }
await RunOrderInWork(Implementer); await RunWaitingOrders(implementer);
await RunOrderInWork(implementer);
await Task.Run(() => await Task.Run(() =>
{ {
foreach (var Order in Orders) foreach (var order in orders)
{ {
try try
{ {
_logger.LogDebug("WorkerWorkAsync. Worker {Id} try get order {Order}", Implementer.Id, Order.Id); _logger.LogDebug("DoWork. Worker {Id} try get order {Order}", implementer.Id, order.Id);
bool AcquireResult = _orderLogic.TakeOrderInWork(new OrderBindingModel bool AcquireResult = _orderLogic.TakeOrderInWork(new OrderBindingModel
{ {
Id = Order.Id, Id = order.Id,
ImplementerId = Implementer.Id ImplementerId = implementer.Id
}); });
if (!AcquireResult) if (!AcquireResult)
{ {
_logger.LogDebug("WorkerWorkAsync. Worker {Id} tried to get order {Order} but it's already acquired by other worker", Implementer.Id, Order.Id); _logger.LogDebug("WorkerWorkAsync. Worker {Id} tried to get order {Order} but it's already acquired by other worker", implementer.Id, order.Id);
continue; continue;
} }
// делаем работу
Thread.Sleep(Implementer.WorkExperience * _rnd.Next(100, 1000) * Order.Count); Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 1000) * order.Count);
_logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, order.Id);
_logger.LogDebug("WorkerWorkAsync. Worker {Id} finish order {Order}", Implementer.Id, Order.Id);
_orderLogic.FinishOrder(new OrderBindingModel _orderLogic.FinishOrder(new OrderBindingModel
{ {
Id = Order.Id Id = order.Id
}); });
Thread.Sleep(Implementer.Qualification * _rnd.Next(10, 100)); _logger.LogDebug("DoWork. Order {Order} delivery", order.Id);
} _orderLogic.DeliveryOrder(new OrderBindingModel
{
Id = order.Id
});
// отдыхаем
Thread.Sleep(implementer.Qualification * _rnd.Next(10, 100));
}
// кто-то мог уже перехватить заказ, игнорируем ошибку
catch (InvalidOperationException ex) catch (InvalidOperationException ex)
{ {
_logger.LogWarning(ex, "Error try get work"); _logger.LogWarning(ex, "Error try get work");
} }
// заканчиваем выполнение имитации в случае иной ошибки
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error while do work"); _logger.LogError(ex, "Error while do work");
throw; throw;
} }
} }
}); });
} }
@ -127,7 +129,11 @@ namespace FlowerShopBusinessLogic.BusinessLogics
{ {
Id = RunOrder.Id Id = RunOrder.Id
}); });
_logger.LogDebug("DoWork. Order {Order} delivery", RunOrder.Id);
_orderLogic.DeliveryOrder(new OrderBindingModel
{
Id = RunOrder.Id
});
Thread.Sleep(Implementer.Qualification * _rnd.Next(10, 100)); Thread.Sleep(Implementer.Qualification * _rnd.Next(10, 100));
} }
@ -142,5 +148,48 @@ namespace FlowerShopBusinessLogic.BusinessLogics
throw; throw;
} }
} }
private async Task RunWaitingOrders(ImplementerViewModel implementer)
{
if (_orderLogic == null || implementer == null)
{
return;
}
var waitingOrders = await Task.Run(() => _orderLogic.ReadList(new OrderSearchModel
{
ImplementerId = implementer.Id,
Status = OrderStatus.Ожидание
}));
if (waitingOrders == null || waitingOrders.Count == 0)
{
return;
}
_logger.LogDebug("RunWaitingOrders for {Count} orders. Implementer: {id}.", waitingOrders.Count, implementer.Id);
foreach (var waitingOrder in waitingOrders)
{
try
{
_logger.LogInformation("RunWaitingOrders. Order {Order} delivery", waitingOrder.Id);
_orderLogic.DeliveryOrder(new OrderBindingModel
{
Id = waitingOrder.Id
});
_logger.LogDebug("DoWork. Order {Order} delivery", waitingOrder.Id);
_orderLogic.DeliveryOrder(new OrderBindingModel
{
Id = waitingOrder.Id
});
}
catch (InvalidOperationException ex)
{
_logger.LogWarning(ex, "Error try get work");
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while do work");
throw;
}
}
}
} }
} }

View File

@ -6,6 +6,7 @@
Принят = 0, Принят = 0,
Выполняется = 1, Выполняется = 1,
Готов = 2, Готов = 2,
Выдан = 3 Выдан = 3,
Ожидание = 4
} }
} }

View File

@ -12,11 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace FlowerShopDatabaseImplement.Migrations namespace FlowerShopDatabaseImplement.Migrations
{ {
[DbContext(typeof(FlowerShopDatabase))] [DbContext(typeof(FlowerShopDatabase))]
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.Designer.cs [Migration("20240617101659_InitCreate")]
[Migration("20240517110214_InitCreate")]
========
[Migration("20240422161656_InitCreate")]
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.Designer.cs
partial class InitCreate partial class InitCreate
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -264,11 +260,7 @@ namespace FlowerShopDatabaseImplement.Migrations
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b =>
{ {
b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client") b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client")
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.Designer.cs
.WithMany("Orders") .WithMany("Orders")
========
.WithMany()
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.Designer.cs
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
@ -279,10 +271,15 @@ namespace FlowerShopDatabaseImplement.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.Designer.cs b.HasOne("FlowerShopDatabaseImplement.Models.Implementer", "Implementer")
.WithMany("Order")
.HasForeignKey("ImplementerId");
b.Navigation("Client"); b.Navigation("Client");
b.Navigation("Flower"); b.Navigation("Flower");
b.Navigation("Implementer");
}); });
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.ShopFlower", b => modelBuilder.Entity("FlowerShopDatabaseImplement.Models.ShopFlower", b =>
@ -307,17 +304,6 @@ namespace FlowerShopDatabaseImplement.Migrations
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Client", b => modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Client", b =>
{ {
b.Navigation("Orders"); b.Navigation("Orders");
========
b.HasOne("FlowerShopDatabaseImplement.Models.Implementer", "Implementer")
.WithMany("Order")
.HasForeignKey("ImplementerId");
b.Navigation("Client");
b.Navigation("Flower");
b.Navigation("Implementer");
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.Designer.cs
}); });
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Component", b => modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Component", b =>
@ -332,15 +318,14 @@ namespace FlowerShopDatabaseImplement.Migrations
b.Navigation("Orders"); b.Navigation("Orders");
}); });
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.Designer.cs
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Shop", b =>
{
b.Navigation("Flowers");
========
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Implementer", b => modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Implementer", b =>
{ {
b.Navigation("Order"); b.Navigation("Order");
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.Designer.cs });
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Shop", b =>
{
b.Navigation("Flowers");
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }

View File

@ -54,25 +54,11 @@ namespace FlowerShopDatabaseImplement.Migrations
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.cs
name: "Shops",
========
name: "Implementers", name: "Implementers",
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.cs
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.cs
ShopName = table.Column<string>(type: "text", nullable: false),
Address = table.Column<string>(type: "text", nullable: false),
DateOpening = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
MaximumFlowers = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Shops", x => x.Id);
========
ImplementerFIO = table.Column<string>(type: "text", nullable: false), ImplementerFIO = table.Column<string>(type: "text", nullable: false),
Password = table.Column<string>(type: "text", nullable: false), Password = table.Column<string>(type: "text", nullable: false),
WorkExperience = table.Column<int>(type: "integer", nullable: false), WorkExperience = table.Column<int>(type: "integer", nullable: false),
@ -81,7 +67,22 @@ namespace FlowerShopDatabaseImplement.Migrations
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_Implementers", x => x.Id); table.PrimaryKey("PK_Implementers", x => x.Id);
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.cs });
migrationBuilder.CreateTable(
name: "Shops",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ShopName = table.Column<string>(type: "text", nullable: false),
Address = table.Column<string>(type: "text", nullable: false),
DateOpening = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
MaximumFlowers = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Shops", x => x.Id);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
@ -196,7 +197,11 @@ namespace FlowerShopDatabaseImplement.Migrations
column: "FlowerId"); column: "FlowerId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.cs name: "IX_Orders_ImplementerId",
table: "Orders",
column: "ImplementerId");
migrationBuilder.CreateIndex(
name: "IX_ShopFlowers_FlowerId", name: "IX_ShopFlowers_FlowerId",
table: "ShopFlowers", table: "ShopFlowers",
column: "FlowerId"); column: "FlowerId");
@ -205,11 +210,6 @@ namespace FlowerShopDatabaseImplement.Migrations
name: "IX_ShopFlowers_ShopId", name: "IX_ShopFlowers_ShopId",
table: "ShopFlowers", table: "ShopFlowers",
column: "ShopId"); column: "ShopId");
========
name: "IX_Orders_ImplementerId",
table: "Orders",
column: "ImplementerId");
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.cs
} }
protected override void Down(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder)
@ -229,15 +229,14 @@ namespace FlowerShopDatabaseImplement.Migrations
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Clients"); name: "Clients");
migrationBuilder.DropTable(
name: "Implementers");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Flowers"); name: "Flowers");
migrationBuilder.DropTable( migrationBuilder.DropTable(
<<<<<<<< HEAD:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240517110214_InitCreate.cs
name: "Shops"); name: "Shops");
========
name: "Implementers");
>>>>>>>> origin/lab6:FlowerShop/FlowerShopDatabaseImplement/Migrations/20240422161656_InitCreate.cs
} }
} }
} }

View File

@ -258,7 +258,7 @@ namespace FlowerShopDatabaseImplement.Migrations
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b =>
{ {
b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client") b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client")
.WithMany() .WithMany("Orders")
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
@ -280,6 +280,30 @@ namespace FlowerShopDatabaseImplement.Migrations
b.Navigation("Implementer"); b.Navigation("Implementer");
}); });
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.ShopFlower", b =>
{
b.HasOne("FlowerShopDatabaseImplement.Models.Flower", "Flower")
.WithMany()
.HasForeignKey("FlowerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FlowerShopDatabaseImplement.Models.Shop", "Shop")
.WithMany("Flowers")
.HasForeignKey("ShopId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Flower");
b.Navigation("Shop");
});
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Client", b =>
{
b.Navigation("Orders");
});
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Component", b => modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Component", b =>
{ {
b.Navigation("FlowerComponents"); b.Navigation("FlowerComponents");
@ -296,6 +320,11 @@ namespace FlowerShopDatabaseImplement.Migrations
{ {
b.Navigation("Order"); b.Navigation("Order");
}); });
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Shop", b =>
{
b.Navigation("Flowers");
});
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }

View File

@ -10,15 +10,13 @@ namespace FlowerShopDatabaseImplement.Models
{ {
public int Id { get; private set; } public int Id { get; private set; }
[Required] [Required]
public virtual Flower Flower { get; set; }
public int FlowerId { get; private set; } public int FlowerId { get; private set; }
public virtual Flower Flower { get; set; }
public virtual Flower Flower { get; set; }
[Required] [Required]
public int ClientId { get; private set; } public int ClientId { get; private set; }
public virtual Client Client { get; set; } public virtual Client Client { get; set; }
public int? ImplementerId { get; private set; } public int? ImplementerId { get; private set; }
public virtual Implementer? Implementer { get; set; } public virtual Implementer? Implementer { get; set; }
public virtual Client Client { get; set; }
[Required] [Required]
public int Count { get; set; } public int Count { get; set; }
[Required] [Required]