помогите
This commit is contained in:
parent
a42202f627
commit
f1417ad554
@ -7,6 +7,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -115,7 +116,14 @@ namespace DatabaseImplement.Implements
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
context.Supplies.Add(newProduct);
|
context.Supplies.Add(newProduct);
|
||||||
|
try
|
||||||
|
{
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine(ex);
|
||||||
|
}
|
||||||
return newProduct.GetViewModel;
|
return newProduct.GetViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ namespace DatabaseImplement.Models
|
|||||||
}
|
}
|
||||||
public void UpdateProducts(Database context, SupplierBindingModel model)
|
public void UpdateProducts(Database context, SupplierBindingModel model)
|
||||||
{
|
{
|
||||||
|
var test = context.SupplierProducts.ToList();
|
||||||
var supplierProducts = context.SupplierProducts.Where(rec => rec.SupplierId == model.Id).ToList();
|
var supplierProducts = context.SupplierProducts.Where(rec => rec.SupplierId == model.Id).ToList();
|
||||||
if (supplierProducts != null && supplierProducts.Count > model.AvailibleProducts.Count)
|
if (supplierProducts != null && supplierProducts.Count > model.AvailibleProducts.Count)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,8 @@ namespace DatabaseImplement.Models
|
|||||||
{
|
{
|
||||||
Product = context.Products.First(y => y.Id == x.Key),
|
Product = context.Products.First(y => y.Id == x.Key),
|
||||||
Count = x.Value.Item2
|
Count = x.Value.Item2
|
||||||
}).ToList()
|
}).ToList(),
|
||||||
|
Status = SupplyStatus.Pending,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public void Update(SupplyBindingModel model)
|
public void Update(SupplyBindingModel model)
|
||||||
|
3
WinFormsApp/FormMain.Designer.cs
generated
3
WinFormsApp/FormMain.Designer.cs
generated
@ -48,12 +48,13 @@
|
|||||||
//
|
//
|
||||||
// buttonCreateSupply
|
// buttonCreateSupply
|
||||||
//
|
//
|
||||||
buttonCreateSupply.Location = new Point(706, 12);
|
buttonCreateSupply.Location = new Point(706, 24);
|
||||||
buttonCreateSupply.Name = "buttonCreateSupply";
|
buttonCreateSupply.Name = "buttonCreateSupply";
|
||||||
buttonCreateSupply.Size = new Size(154, 23);
|
buttonCreateSupply.Size = new Size(154, 23);
|
||||||
buttonCreateSupply.TabIndex = 1;
|
buttonCreateSupply.TabIndex = 1;
|
||||||
buttonCreateSupply.Text = "Оформить поставку";
|
buttonCreateSupply.Text = "Оформить поставку";
|
||||||
buttonCreateSupply.UseVisualStyleBackColor = true;
|
buttonCreateSupply.UseVisualStyleBackColor = true;
|
||||||
|
buttonCreateSupply.Click += buttonCreateSupply_Click;
|
||||||
//
|
//
|
||||||
// menuStrip1
|
// menuStrip1
|
||||||
//
|
//
|
||||||
|
@ -68,5 +68,14 @@ namespace WinFormsApp
|
|||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buttonCreateSupply_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var service = Program.ServiceProvider?.GetService(typeof(FormSupply));
|
||||||
|
if (service is FormSupply form)
|
||||||
|
{
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ namespace WinFormsApp
|
|||||||
dataGridViewProducts.Rows.Clear();
|
dataGridViewProducts.Rows.Clear();
|
||||||
foreach (var pc in _supplierProducts)
|
foreach (var pc in _supplierProducts)
|
||||||
{
|
{
|
||||||
dataGridViewProducts.Rows.Add(new object[] { pc.Key, pc.Value.Item1.Name, pc.Value.Item2 });
|
dataGridViewProducts.Rows.Add(new object[] { pc.Value.Item1.Id, pc.Value.Item1.Name, pc.Value.Item2 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
210
WinFormsApp/FormSupply.Designer.cs
generated
Normal file
210
WinFormsApp/FormSupply.Designer.cs
generated
Normal file
@ -0,0 +1,210 @@
|
|||||||
|
namespace WinFormsApp
|
||||||
|
{
|
||||||
|
partial class FormSupply
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#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()
|
||||||
|
{
|
||||||
|
textBoxName = new TextBox();
|
||||||
|
dataGridView = new DataGridView();
|
||||||
|
ProductId = new DataGridViewTextBoxColumn();
|
||||||
|
ProductName = new DataGridViewTextBoxColumn();
|
||||||
|
ProductAmount = new DataGridViewTextBoxColumn();
|
||||||
|
groupBoxProducts = new GroupBox();
|
||||||
|
buttonDeleteProduct = new Button();
|
||||||
|
buttonUpdateProduct = new Button();
|
||||||
|
buttonAddProduct = new Button();
|
||||||
|
label1 = new Label();
|
||||||
|
buttonSave = new Button();
|
||||||
|
buttonCancel = new Button();
|
||||||
|
textBoxPrice = new TextBox();
|
||||||
|
comboBoxSupplier = new ComboBox();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
|
groupBoxProducts.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// textBoxName
|
||||||
|
//
|
||||||
|
textBoxName.Location = new Point(18, 41);
|
||||||
|
textBoxName.Multiline = true;
|
||||||
|
textBoxName.Name = "textBoxName";
|
||||||
|
textBoxName.Size = new Size(434, 103);
|
||||||
|
textBoxName.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// dataGridView
|
||||||
|
//
|
||||||
|
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridView.Columns.AddRange(new DataGridViewColumn[] { ProductId, ProductName, ProductAmount });
|
||||||
|
dataGridView.Location = new Point(6, 22);
|
||||||
|
dataGridView.Name = "dataGridView";
|
||||||
|
dataGridView.Size = new Size(423, 241);
|
||||||
|
dataGridView.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// ProductId
|
||||||
|
//
|
||||||
|
ProductId.HeaderText = "Id";
|
||||||
|
ProductId.Name = "ProductId";
|
||||||
|
ProductId.ReadOnly = true;
|
||||||
|
ProductId.Visible = false;
|
||||||
|
//
|
||||||
|
// ProductName
|
||||||
|
//
|
||||||
|
ProductName.HeaderText = "Название";
|
||||||
|
ProductName.Name = "ProductName";
|
||||||
|
ProductName.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// ProductAmount
|
||||||
|
//
|
||||||
|
ProductAmount.HeaderText = "Количество";
|
||||||
|
ProductAmount.Name = "ProductAmount";
|
||||||
|
ProductAmount.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// groupBoxProducts
|
||||||
|
//
|
||||||
|
groupBoxProducts.Controls.Add(buttonDeleteProduct);
|
||||||
|
groupBoxProducts.Controls.Add(buttonUpdateProduct);
|
||||||
|
groupBoxProducts.Controls.Add(buttonAddProduct);
|
||||||
|
groupBoxProducts.Controls.Add(dataGridView);
|
||||||
|
groupBoxProducts.Location = new Point(12, 150);
|
||||||
|
groupBoxProducts.Name = "groupBoxProducts";
|
||||||
|
groupBoxProducts.Size = new Size(776, 288);
|
||||||
|
groupBoxProducts.TabIndex = 2;
|
||||||
|
groupBoxProducts.TabStop = false;
|
||||||
|
groupBoxProducts.Text = "Товары";
|
||||||
|
//
|
||||||
|
// buttonDeleteProduct
|
||||||
|
//
|
||||||
|
buttonDeleteProduct.Location = new Point(435, 132);
|
||||||
|
buttonDeleteProduct.Name = "buttonDeleteProduct";
|
||||||
|
buttonDeleteProduct.Size = new Size(126, 49);
|
||||||
|
buttonDeleteProduct.TabIndex = 4;
|
||||||
|
buttonDeleteProduct.Text = "Удалить";
|
||||||
|
buttonDeleteProduct.UseVisualStyleBackColor = true;
|
||||||
|
buttonDeleteProduct.Click += buttonDeleteProduct_Click;
|
||||||
|
//
|
||||||
|
// buttonUpdateProduct
|
||||||
|
//
|
||||||
|
buttonUpdateProduct.Location = new Point(435, 77);
|
||||||
|
buttonUpdateProduct.Name = "buttonUpdateProduct";
|
||||||
|
buttonUpdateProduct.Size = new Size(126, 49);
|
||||||
|
buttonUpdateProduct.TabIndex = 3;
|
||||||
|
buttonUpdateProduct.Text = "Изменить";
|
||||||
|
buttonUpdateProduct.UseVisualStyleBackColor = true;
|
||||||
|
buttonUpdateProduct.Click += buttonUpdateProduct_Click;
|
||||||
|
//
|
||||||
|
// buttonAddProduct
|
||||||
|
//
|
||||||
|
buttonAddProduct.Location = new Point(435, 22);
|
||||||
|
buttonAddProduct.Name = "buttonAddProduct";
|
||||||
|
buttonAddProduct.Size = new Size(126, 49);
|
||||||
|
buttonAddProduct.TabIndex = 2;
|
||||||
|
buttonAddProduct.Text = "Добавить";
|
||||||
|
buttonAddProduct.UseVisualStyleBackColor = true;
|
||||||
|
buttonAddProduct.Click += buttonAddProduct_Click;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(18, 23);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(100, 15);
|
||||||
|
label1.TabIndex = 3;
|
||||||
|
label1.Text = "Общие сведения";
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
buttonSave.Location = new Point(654, 40);
|
||||||
|
buttonSave.Name = "buttonSave";
|
||||||
|
buttonSave.Size = new Size(75, 23);
|
||||||
|
buttonSave.TabIndex = 4;
|
||||||
|
buttonSave.Text = "Сохранить";
|
||||||
|
buttonSave.UseVisualStyleBackColor = true;
|
||||||
|
buttonSave.Click += buttonSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.Location = new Point(654, 88);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(75, 23);
|
||||||
|
buttonCancel.TabIndex = 5;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// textBoxPrice
|
||||||
|
//
|
||||||
|
textBoxPrice.Enabled = false;
|
||||||
|
textBoxPrice.Location = new Point(473, 88);
|
||||||
|
textBoxPrice.Name = "textBoxPrice";
|
||||||
|
textBoxPrice.Size = new Size(100, 23);
|
||||||
|
textBoxPrice.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// comboBoxSupplier
|
||||||
|
//
|
||||||
|
comboBoxSupplier.FormattingEnabled = true;
|
||||||
|
comboBoxSupplier.Location = new Point(473, 41);
|
||||||
|
comboBoxSupplier.Name = "comboBoxSupplier";
|
||||||
|
comboBoxSupplier.Size = new Size(121, 23);
|
||||||
|
comboBoxSupplier.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// FormSupply
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(comboBoxSupplier);
|
||||||
|
Controls.Add(textBoxPrice);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(label1);
|
||||||
|
Controls.Add(groupBoxProducts);
|
||||||
|
Controls.Add(textBoxName);
|
||||||
|
Name = "FormSupply";
|
||||||
|
Text = "FormSupply";
|
||||||
|
Load += FormSupply_Load;
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
|
groupBoxProducts.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private TextBox textBoxName;
|
||||||
|
private DataGridView dataGridView;
|
||||||
|
private DataGridViewTextBoxColumn ProductId;
|
||||||
|
private DataGridViewTextBoxColumn ProductName;
|
||||||
|
private DataGridViewTextBoxColumn ProductAmount;
|
||||||
|
private GroupBox groupBoxProducts;
|
||||||
|
private Button buttonAddProduct;
|
||||||
|
private Label label1;
|
||||||
|
private Button buttonUpdateProduct;
|
||||||
|
private Button buttonDeleteProduct;
|
||||||
|
private Button buttonSave;
|
||||||
|
private Button buttonCancel;
|
||||||
|
private TextBox textBoxPrice;
|
||||||
|
private ComboBox comboBoxSupplier;
|
||||||
|
}
|
||||||
|
}
|
222
WinFormsApp/FormSupply.cs
Normal file
222
WinFormsApp/FormSupply.cs
Normal file
@ -0,0 +1,222 @@
|
|||||||
|
using Contracts.BindingModels;
|
||||||
|
using Contracts.BusinessLogicContracts;
|
||||||
|
using Contracts.SearchModels;
|
||||||
|
using DataModels.Models;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace WinFormsApp
|
||||||
|
{
|
||||||
|
public partial class FormSupply : Form
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
private readonly ISupplyLogic _logic;
|
||||||
|
private readonly ISupplierLogic _supplierLogic;
|
||||||
|
private Guid? _id;
|
||||||
|
private Dictionary<Guid, (IProduct, int)> _supplyProducts;
|
||||||
|
public Guid Id { set { _id = value; } }
|
||||||
|
public FormSupply(ILogger<FormSupply> logger, ISupplyLogic logic, ISupplierLogic supplierLogic)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_logger = logger;
|
||||||
|
_logic = logic;
|
||||||
|
_supplyProducts = new Dictionary<Guid, (IProduct, int)>();
|
||||||
|
_supplierLogic = supplierLogic;
|
||||||
|
}
|
||||||
|
private void FormSupply_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (_id.HasValue)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Загрузка изделия");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var view = _logic.ReadElement(new SupplySearchModel
|
||||||
|
{
|
||||||
|
Id = _id.Value
|
||||||
|
});
|
||||||
|
if (view != null)
|
||||||
|
{
|
||||||
|
textBoxName.Text = view.Name;
|
||||||
|
_supplyProducts = view.Products ?? new Dictionary<Guid, (IProduct, int)>();
|
||||||
|
LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка загрузки изделия");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var list = _supplierLogic.ReadList(null);
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
comboBoxSupplier.DisplayMember = "Name";
|
||||||
|
comboBoxSupplier.ValueMember = "Id";
|
||||||
|
comboBoxSupplier.DataSource = list;
|
||||||
|
comboBoxSupplier.SelectedItem = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка загрузки списка клиентов");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadData()
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Загрузка компонент изделия");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_supplyProducts != null)
|
||||||
|
{
|
||||||
|
dataGridView.Rows.Clear();
|
||||||
|
foreach (var pc in _supplyProducts)
|
||||||
|
{
|
||||||
|
dataGridView.Rows.Add(new object[] { pc.Key, pc.Value.Item1.Name, pc.Value.Item2 });
|
||||||
|
}
|
||||||
|
textBoxPrice.Text = CalcPrice().ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка загрузки компонент изделия");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
|
||||||
|
MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonAddProduct_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var service = Program.ServiceProvider?.GetService(typeof(FormSupplyProduct));
|
||||||
|
if (service is FormSupplyProduct form)
|
||||||
|
{
|
||||||
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
if (form.ProductModel == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_logger.LogInformation("Добавление нового компонента");
|
||||||
|
if (_supplyProducts.ContainsKey(form.Id))
|
||||||
|
{
|
||||||
|
_supplyProducts[form.Id] = (form.ProductModel, form.Count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_supplyProducts.Add(form.Id, (form.ProductModel, form.Count));
|
||||||
|
}
|
||||||
|
LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonUpdateProduct_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
|
{
|
||||||
|
var service =
|
||||||
|
Program.ServiceProvider?.GetService(typeof(FormSupplyProduct));
|
||||||
|
if (service is FormSupplyProduct form)
|
||||||
|
{
|
||||||
|
Guid id = (Guid)dataGridView.SelectedRows[0].Cells[0].Value;
|
||||||
|
form.Id = id;
|
||||||
|
form.Count = _supplyProducts[id].Item2;
|
||||||
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
if (form.ProductModel == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_logger.LogInformation("Изменение компонента");
|
||||||
|
_supplyProducts[form.Id] = (form.ProductModel, form.Count);
|
||||||
|
LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonDeleteProduct_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("Удалить запись?", "Вопрос",
|
||||||
|
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Удаление компонента");
|
||||||
|
_supplyProducts?.Remove((Guid)dataGridView.SelectedRows[0].Cells[0].Value);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(textBoxName.Text))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Заполните информацию", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_supplyProducts == null || _supplyProducts.Count == 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Заполните товары", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_logger.LogInformation("Сохранение изделия");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var model = new SupplyBindingModel
|
||||||
|
{
|
||||||
|
Id = _id ?? Guid.NewGuid(),
|
||||||
|
Name = textBoxName.Text,
|
||||||
|
Date = DateTime.UtcNow,
|
||||||
|
Price = Convert.ToDouble(textBoxPrice.Text),
|
||||||
|
SupplierId = (Guid)comboBoxSupplier.SelectedValue,
|
||||||
|
SupplyProducts = _supplyProducts,
|
||||||
|
|
||||||
|
};
|
||||||
|
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
||||||
|
if (!operationResult)
|
||||||
|
{
|
||||||
|
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
||||||
|
}
|
||||||
|
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка сохранения изделия"); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private double CalcPrice()
|
||||||
|
{
|
||||||
|
double price = 0;
|
||||||
|
foreach (var elem in _supplyProducts)
|
||||||
|
{
|
||||||
|
price += ((elem.Value.Item1?.Price ?? 0) * elem.Value.Item2);
|
||||||
|
}
|
||||||
|
return Math.Round(price * 1.1, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
129
WinFormsApp/FormSupply.resx
Normal file
129
WinFormsApp/FormSupply.resx
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="ProductId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ProductName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ProductAmount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
94
WinFormsApp/FormSupplyProduct.Designer.cs
generated
Normal file
94
WinFormsApp/FormSupplyProduct.Designer.cs
generated
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
namespace WinFormsApp
|
||||||
|
{
|
||||||
|
partial class FormSupplyProduct
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#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()
|
||||||
|
{
|
||||||
|
numericUpDownCount = new NumericUpDown();
|
||||||
|
comboBoxProduct = new ComboBox();
|
||||||
|
buttonSave = new Button();
|
||||||
|
buttonCancel = new Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownCount).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// numericUpDownCount
|
||||||
|
//
|
||||||
|
numericUpDownCount.Location = new Point(26, 76);
|
||||||
|
numericUpDownCount.Name = "numericUpDownCount";
|
||||||
|
numericUpDownCount.Size = new Size(120, 23);
|
||||||
|
numericUpDownCount.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// comboBoxProduct
|
||||||
|
//
|
||||||
|
comboBoxProduct.FormattingEnabled = true;
|
||||||
|
comboBoxProduct.Location = new Point(25, 33);
|
||||||
|
comboBoxProduct.Name = "comboBoxProduct";
|
||||||
|
comboBoxProduct.Size = new Size(121, 23);
|
||||||
|
comboBoxProduct.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
buttonSave.Location = new Point(192, 74);
|
||||||
|
buttonSave.Name = "buttonSave";
|
||||||
|
buttonSave.Size = new Size(75, 23);
|
||||||
|
buttonSave.TabIndex = 3;
|
||||||
|
buttonSave.Text = "Сохранить";
|
||||||
|
buttonSave.UseVisualStyleBackColor = true;
|
||||||
|
buttonSave.Click += ButtonSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.Location = new Point(192, 98);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(75, 23);
|
||||||
|
buttonCancel.TabIndex = 4;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
buttonCancel.Click += ButtonCancel_Click;
|
||||||
|
//
|
||||||
|
// FormSupplyProduct
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(287, 138);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(comboBoxProduct);
|
||||||
|
Controls.Add(numericUpDownCount);
|
||||||
|
Name = "FormSupplyProduct";
|
||||||
|
Text = "FormSupplyProduct";
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownCount).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private NumericUpDown numericUpDownCount;
|
||||||
|
private ComboBox comboBoxProduct;
|
||||||
|
private Button buttonSave;
|
||||||
|
private Button buttonCancel;
|
||||||
|
}
|
||||||
|
}
|
88
WinFormsApp/FormSupplyProduct.cs
Normal file
88
WinFormsApp/FormSupplyProduct.cs
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
using Contracts.BusinessLogicContracts;
|
||||||
|
using Contracts.ViewModels;
|
||||||
|
using DataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace WinFormsApp
|
||||||
|
{
|
||||||
|
public partial class FormSupplyProduct : Form
|
||||||
|
{
|
||||||
|
private readonly List<ProductViewModel>? _list;
|
||||||
|
public Guid Id
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (Guid)comboBoxProduct.SelectedValue;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
comboBoxProduct.SelectedValue = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public IProduct? ProductModel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_list == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
foreach (var elem in _list)
|
||||||
|
{
|
||||||
|
if (elem.Id == Id)
|
||||||
|
{
|
||||||
|
return elem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Count
|
||||||
|
{
|
||||||
|
get { return Convert.ToInt32(numericUpDownCount.Value); }
|
||||||
|
set { numericUpDownCount.Value = value; }
|
||||||
|
}
|
||||||
|
public FormSupplyProduct(IProductLogic logic)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_list = logic.ReadList(null);
|
||||||
|
if (_list != null)
|
||||||
|
{
|
||||||
|
comboBoxProduct.DisplayMember = "Name";
|
||||||
|
comboBoxProduct.ValueMember = "Id";
|
||||||
|
comboBoxProduct.DataSource = _list;
|
||||||
|
comboBoxProduct.SelectedItem = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (numericUpDownCount.Value == null || numericUpDownCount.Value <= 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Кол-во товаров должно иметь значение больше 0", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (comboBoxProduct.SelectedValue == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите товар", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
private void ButtonCancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = DialogResult.Cancel;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
WinFormsApp/FormSupplyProduct.resx
Normal file
120
WinFormsApp/FormSupplyProduct.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -47,6 +47,8 @@ namespace WinFormsApp
|
|||||||
services.AddTransient<FormMain>();
|
services.AddTransient<FormMain>();
|
||||||
services.AddTransient<FormProducts>();
|
services.AddTransient<FormProducts>();
|
||||||
services.AddTransient<FormSuppliers>();
|
services.AddTransient<FormSuppliers>();
|
||||||
|
services.AddTransient<FormSupply>();
|
||||||
|
services.AddTransient<FormSupplyProduct>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user