Правки
This commit is contained in:
parent
5a0e120e05
commit
dae7a15976
@ -1,5 +1,4 @@
|
|||||||
using BlacksmithWorkshopDatabaseImplement.Models;
|
using FurnitureAssemblyDatabaseImplement.Models;
|
||||||
using FurnitureAssemblyDatabaseImplement.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using BlacksmithWorkshopDatabaseImplement.Models;
|
using FurnitureAssemblyDatabaseImplement.Models;
|
||||||
using FurnitureAssemblyContracts.BindingModels;
|
using FurnitureAssemblyContracts.BindingModels;
|
||||||
using FurnitureAssemblyContracts.SearchModels;
|
using FurnitureAssemblyContracts.SearchModels;
|
||||||
using FurnitureAssemblyContracts.StoragesContracts;
|
using FurnitureAssemblyContracts.StoragesContracts;
|
||||||
|
@ -101,13 +101,13 @@ namespace FurnitureAssemblyDatabaseImplement.Models
|
|||||||
|
|
||||||
var furniture = context.Furnitures.First(x => x.Id == Id);
|
var furniture = context.Furnitures.First(x => x.Id == Id);
|
||||||
|
|
||||||
foreach(var mwp in model.FurnitureWorkPieces)
|
foreach(var fwp in model.FurnitureWorkPieces)
|
||||||
{
|
{
|
||||||
context.FurnitureWorkPieces.Add(new FurnitureWorkPiece
|
context.FurnitureWorkPieces.Add(new FurnitureWorkPiece
|
||||||
{
|
{
|
||||||
Furniture = furniture,
|
Furniture = furniture,
|
||||||
WorkPiece = context.WorkPieces.First(x => x.Id == mwp.Key),
|
WorkPiece = context.WorkPieces.First(x => x.Id == fwp.Key),
|
||||||
Count = mwp.Value.Item2
|
Count = fwp.Value.Item2
|
||||||
});
|
});
|
||||||
|
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
@ -11,7 +11,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BlacksmithWorkshopDatabaseImplement.Models
|
namespace FurnitureAssemblyDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
public class Shop : IShopModel
|
public class Shop : IShopModel
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using BlacksmithWorkshopDatabaseImplement.Models;
|
using FurnitureAssemblyDatabaseImplement.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
@ -25,14 +25,14 @@ namespace FurnitureAssemblyView
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if(_list == null)
|
if (_list == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(var elem in _list)
|
foreach (var elem in _list)
|
||||||
{
|
{
|
||||||
if(elem.Id == Id)
|
if (elem.Id == Id)
|
||||||
{
|
{
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
buttonAdd = new Button();
|
buttonAdd = new Button();
|
||||||
buttonUpdate = new Button();
|
buttonUpdate = new Button();
|
||||||
buttonDelete = new Button();
|
buttonDelete = new Button();
|
||||||
buttonRef = new Button();
|
buttonRefresh = new Button();
|
||||||
dataGridView = new DataGridView();
|
dataGridView = new DataGridView();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
@ -66,15 +66,15 @@
|
|||||||
buttonDelete.UseVisualStyleBackColor = true;
|
buttonDelete.UseVisualStyleBackColor = true;
|
||||||
buttonDelete.Click += ButtonDelete_Click;
|
buttonDelete.Click += ButtonDelete_Click;
|
||||||
//
|
//
|
||||||
// buttonRef
|
// buttonRefresh
|
||||||
//
|
//
|
||||||
buttonRef.Location = new Point(640, 245);
|
buttonRefresh.Location = new Point(640, 245);
|
||||||
buttonRef.Name = "buttonRef";
|
buttonRefresh.Name = "buttonRef";
|
||||||
buttonRef.Size = new Size(116, 50);
|
buttonRefresh.Size = new Size(116, 50);
|
||||||
buttonRef.TabIndex = 3;
|
buttonRefresh.TabIndex = 3;
|
||||||
buttonRef.Text = "Обновить";
|
buttonRefresh.Text = "Обновить";
|
||||||
buttonRef.UseVisualStyleBackColor = true;
|
buttonRefresh.UseVisualStyleBackColor = true;
|
||||||
buttonRef.Click += ButtonRef_Click;
|
buttonRefresh.Click += ButtonRefresh_Click;
|
||||||
//
|
//
|
||||||
// dataGridView
|
// dataGridView
|
||||||
//
|
//
|
||||||
@ -92,7 +92,7 @@
|
|||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(781, 450);
|
ClientSize = new Size(781, 450);
|
||||||
Controls.Add(dataGridView);
|
Controls.Add(dataGridView);
|
||||||
Controls.Add(buttonRef);
|
Controls.Add(buttonRefresh);
|
||||||
Controls.Add(buttonDelete);
|
Controls.Add(buttonDelete);
|
||||||
Controls.Add(buttonUpdate);
|
Controls.Add(buttonUpdate);
|
||||||
Controls.Add(buttonAdd);
|
Controls.Add(buttonAdd);
|
||||||
@ -108,7 +108,7 @@
|
|||||||
private Button buttonAdd;
|
private Button buttonAdd;
|
||||||
private Button buttonUpdate;
|
private Button buttonUpdate;
|
||||||
private Button buttonDelete;
|
private Button buttonDelete;
|
||||||
private Button buttonRef;
|
private Button buttonRefresh;
|
||||||
private DataGridView dataGridView;
|
private DataGridView dataGridView;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -118,7 +118,7 @@ namespace FurnitureAssemblyView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonRef_Click(object sender, EventArgs e)
|
private void ButtonRefresh_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ namespace FurnitureAssemblyView
|
|||||||
{
|
{
|
||||||
dataGridView.DataSource = list;
|
dataGridView.DataSource = list;
|
||||||
dataGridView.Columns["FurnitureId"].Visible = false;
|
dataGridView.Columns["FurnitureId"].Visible = false;
|
||||||
|
dataGridView.Columns["FurnitureName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("Загрузка заказов");
|
_logger.LogInformation("Загрузка заказов");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user