обновил формы

This commit is contained in:
Андрей Байгулов 2024-05-03 23:12:06 +04:00
parent 2fb30acd26
commit a2d340d325
4 changed files with 255 additions and 218 deletions

View File

@ -36,12 +36,14 @@
textBoxSum = new TextBox();
ButtonSave = new Button();
ButtonCancel = new Button();
comboBoxUser = new ComboBox();
labelUser = new Label();
SuspendLayout();
//
// labelSushi
//
labelSushi.AutoSize = true;
labelSushi.Location = new Point(42, 27);
labelSushi.Location = new Point(33, 66);
labelSushi.Name = "labelSushi";
labelSushi.Size = new Size(42, 15);
labelSushi.TabIndex = 0;
@ -50,7 +52,7 @@
// labelCount
//
labelCount.AutoSize = true;
labelCount.Location = new Point(42, 56);
labelCount.Location = new Point(33, 95);
labelCount.Name = "labelCount";
labelCount.Size = new Size(75, 15);
labelCount.TabIndex = 1;
@ -59,7 +61,7 @@
// labelSum
//
labelSum.AutoSize = true;
labelSum.Location = new Point(42, 84);
labelSum.Location = new Point(33, 124);
labelSum.Name = "labelSum";
labelSum.Size = new Size(48, 15);
labelSum.TabIndex = 2;
@ -67,16 +69,16 @@
//
// textBoxCount
//
textBoxCount.Location = new Point(123, 53);
textBoxCount.Location = new Point(123, 95);
textBoxCount.Name = "textBoxCount";
textBoxCount.Size = new Size(276, 23);
textBoxCount.TabIndex = 3;
this.textBoxCount.TextChanged += new System.EventHandler(this.textBoxCost_TextChanged);
textBoxCount.TextChanged += textBoxCost_TextChanged;
//
// comboBoxSushi
//
comboBoxSushi.FormattingEnabled = true;
comboBoxSushi.Location = new Point(123, 24);
comboBoxSushi.Location = new Point(123, 66);
comboBoxSushi.Name = "comboBoxSushi";
comboBoxSushi.Size = new Size(276, 23);
comboBoxSushi.TabIndex = 4;
@ -84,7 +86,7 @@
//
// textBoxSum
//
textBoxSum.Location = new Point(123, 84);
textBoxSum.Location = new Point(123, 124);
textBoxSum.Name = "textBoxSum";
textBoxSum.ReadOnly = true;
textBoxSum.Size = new Size(276, 23);
@ -92,7 +94,7 @@
//
// ButtonSave
//
ButtonSave.Location = new Point(192, 124);
ButtonSave.Location = new Point(197, 168);
ButtonSave.Name = "ButtonSave";
ButtonSave.Size = new Size(98, 41);
ButtonSave.TabIndex = 6;
@ -102,7 +104,7 @@
//
// ButtonCancel
//
ButtonCancel.Location = new Point(296, 124);
ButtonCancel.Location = new Point(301, 168);
ButtonCancel.Name = "ButtonCancel";
ButtonCancel.Size = new Size(98, 41);
ButtonCancel.TabIndex = 7;
@ -110,11 +112,30 @@
ButtonCancel.UseVisualStyleBackColor = true;
ButtonCancel.Click += ButtonCancel_Click;
//
// comboBoxUser
//
comboBoxUser.FormattingEnabled = true;
comboBoxUser.Location = new Point(123, 37);
comboBoxUser.Name = "comboBoxUser";
comboBoxUser.Size = new Size(276, 23);
comboBoxUser.TabIndex = 8;
//
// labelUser
//
labelUser.AutoSize = true;
labelUser.Location = new Point(33, 40);
labelUser.Name = "labelUser";
labelUser.Size = new Size(87, 15);
labelUser.TabIndex = 9;
labelUser.Text = "Пользователь:";
//
// FormCreateOrder
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(411, 177);
ClientSize = new Size(411, 217);
Controls.Add(labelUser);
Controls.Add(comboBoxUser);
Controls.Add(ButtonCancel);
Controls.Add(ButtonSave);
Controls.Add(textBoxSum);
@ -140,5 +161,7 @@
private TextBox textBoxSum;
private Button ButtonSave;
private Button ButtonCancel;
private ComboBox comboBoxUser;
private Label labelUser;
}
}

View File

@ -21,14 +21,17 @@ namespace SushiBarView
private readonly ILogger _logger;
private readonly ISushiLogic _logicP;
private readonly IOrderLogic _logicO;
private readonly IClientLogic _logicC;
private List<SushiViewModel>? _list;
private List<ClientViewModel>? _listClients;
public FormCreateOrder(ILogger<FormCreateOrder> logger, ISushiLogic logicP, IOrderLogic logicO)
public FormCreateOrder(ILogger<FormCreateOrder> logger, ISushiLogic logicP, IOrderLogic logicO, IClientLogic logicC)
{
InitializeComponent();
_logger = logger;
_logicP = logicP;
_logicO = logicO;
_logicC = logicC;
}
private void FormCreateOrder_Load(object sender, EventArgs e)
{
@ -42,6 +45,16 @@ namespace SushiBarView
comboBoxSushi.SelectedItem = null;
_logger.LogInformation("Загрузка суши для заказа");
}
_listClients = _logicC.ReadList(null);
if (_listClients != null)
{
comboBoxUser.DisplayMember = "ClientFIO";
comboBoxUser.ValueMember = "Id";
comboBoxUser.DataSource = _listClients;
comboBoxUser.SelectedItem = null;
_logger.LogInformation("Загрузка клиентов для заказа");
}
}
private void ButtonSave_Click(object sender, EventArgs e)
{

View File

@ -169,7 +169,7 @@
clientToolStripMenuItem.Name = "clientToolStripMenuItem";
clientToolStripMenuItem.Size = new Size(180, 22);
clientToolStripMenuItem.Text = "Клиент";
clientToolStripMenuItem.Click += клиентToolStripMenuItem_Click;
clientToolStripMenuItem.Click += clientToolStripMenuItem_Click;
//
// FormMain
//

View File

@ -51,6 +51,7 @@ namespace SushiBarView
services.AddTransient<FormSushi>();
services.AddTransient<FormReportOrders>();
services.AddTransient<FormReportSushiComponents>();
services.AddTransient<FormClients>();
services.AddTransient<IReportLogic, ReportLogic>();
services.AddTransient<AbstractSaveToWord, SaveToWord>();