для пул реквеста 5 лаба

This commit is contained in:
ekallin 2024-04-08 10:32:05 +03:00
parent bf68282103
commit 1d31ba7513
5 changed files with 14 additions and 9 deletions

View File

@ -43,6 +43,7 @@
dataGridView.Name = "dataGridView";
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(615, 450);
dataGridView.TabIndex = 0;
//

View File

@ -117,7 +117,8 @@
//
dataGridView.BackgroundColor = Color.White;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Location = new Point(0, 27);
dataGridView.Dock = DockStyle.Left;
dataGridView.Location = new Point(0, 28);
dataGridView.Name = "dataGridView";
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
@ -173,6 +174,7 @@
buttonRefreshOrders.TabIndex = 6;
buttonRefreshOrders.Text = "Обновить заказы";
buttonRefreshOrders.UseVisualStyleBackColor = true;
buttonRefreshOrders.Click += ButtonRef_Click;
//
// FormMain
//

View File

@ -111,7 +111,7 @@
ClientSize = new Size(1321, 450);
Controls.Add(panel);
Name = "FormReportOrders";
Text = "FormReportOrders";
Text = "Отчет по заказам";
panel.ResumeLayout(false);
panel.PerformLayout();
ResumeLayout(false);

View File

@ -16,8 +16,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
private static JustificationValues
GetJustificationValues(WordJustificationType type)
private static JustificationValues GetJustificationValues(WordJustificationType type)
{
return type switch
{

View File

@ -37,11 +37,14 @@ namespace SushiBarDatabaseImplement.Implements
public ClientViewModel? Delete(ClientBindingModel model)
{
using var context = new SushiBarDatabase();
var client = context.Clients.FirstOrDefault(x => x.Id == model.Id);
if (client == null) { return null; }
context.Clients.Remove(client);
var element = context.Clients.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.Clients.Remove(element);
context.SaveChanges();
return client.GetViewModel;
return element.GetViewModel;
}
return null;
}
public ClientViewModel? GetElement(ClientSearchModel model)