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