This commit is contained in:
antoc0der 2024-03-14 21:28:58 +04:00
parent 643830cf28
commit 964a2996b6
22 changed files with 1324 additions and 86 deletions

View File

@ -4,6 +4,7 @@ using FlowerShopContracts.SearchModels;
using FlowerShopContracts.StoragesContracts;
using FlowerShopContracts.ViewModels;
using FlowerShopDataModels.Enums;
using FlowerShopDataModels.Models;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
@ -17,11 +18,17 @@ namespace FlowerShopBusinessLogic.BusinessLogic
{
private readonly ILogger _logger;
private readonly IOrderStorage _orderStorage;
private readonly IShopStorage _shopStorage;
private readonly IShopLogic _shopLogic;
private readonly IFlowerStorage _flowerStorage;
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage)
public OrderLogic(IOrderStorage orderStorage, IShopStorage shopStorage, IShopLogic shopLogic, IFlowerStorage flowerStorage, ILogger<OrderLogic> logger)
{
_logger = logger;
_orderStorage = orderStorage;
_shopStorage = shopStorage;
_logger = logger;
_shopLogic = shopLogic;
_flowerStorage = flowerStorage;
}
public List<OrderViewModel>? ReadList(OrderSearchModel? model)
@ -65,6 +72,20 @@ namespace FlowerShopBusinessLogic.BusinessLogic
_logger.LogWarning("Status change operation failed");
throw new InvalidOperationException("Текущий статус заказа не может быть переведен в выбранный");
}
if (element.Status == OrderStatus.Готов)
{
var flower = _flowerStorage.GetElement(new FlowerSearchModel() { Id = model.FlowerId });
if (flower == null)
{
_logger.LogWarning("Status update to " + status.ToString() + " operation failed. Document not found.");
return false;
}
if (CheckSupply(flower, model.Count) == false)
{
_logger.LogWarning("Status update to " + status.ToString() + " operation failed. Shop supply error.");
return false;
}
}
model.Status = status;
if (model.Status == OrderStatus.Выдан) model.DateImplement = DateTime.Now;
_orderStorage.Update(model);
@ -106,5 +127,65 @@ namespace FlowerShopBusinessLogic.BusinessLogic
}
_logger.LogInformation("Order. Sum:{ Cost}. Id: { Id}", model.Sum, model.Id);
}
public bool CheckSupply(IFlowerModel flower, int count)
{
if (count <= 0)
{
_logger.LogWarning("Check then supply operation error. IceCream count < 0.");
return false;
}
int sumCapacity = 0;
int sumCount = 0;
sumCapacity = _shopStorage.GetFullList().Select(x => x.MaxCapacity).Sum();
sumCount = _shopStorage.GetFullList().Select(x => x.ShopFlowers.Select(y => y.Value.Item2).Sum()).Sum();
int freeSpace = sumCapacity - sumCount;
if (freeSpace - count < 0)
{
_logger.LogWarning("Check then supply operation error. There's no place for new IceCream in shops.");
return false;
}
foreach (var shop in _shopStorage.GetFullList())
{
freeSpace = shop.MaxCapacity;
foreach (var doc in shop.ShopFlowers)
{
freeSpace -= doc.Value.Item2;
}
if (freeSpace == 0)
{
continue;
}
if (freeSpace - count >= 0)
{
if (_shopLogic.MakeSupply(new() { Id = shop.Id }, flower, count))
count = 0;
else
{
_logger.LogWarning("Supply error");
return false;
}
}
if (freeSpace - count < 0)
{
if (_shopLogic.MakeSupply(new() { Id = shop.Id }, flower, freeSpace))
count -= freeSpace;
else
{
_logger.LogWarning("Supply error");
return false;
}
}
if (count <= 0)
{
return true;
}
}
return false;
}
}
}

View File

@ -51,22 +51,35 @@ namespace FlowerShopBusinessLogic
var curModel = _shopStorage.GetElement(model);
if (curModel == null)
throw new ArgumentNullException(nameof(curModel));
if (curModel.ShopFlowers.TryGetValue(flower.Id, out var pair))
var countItems = curModel.ShopFlowers.Select(x => x.Value.Item2).Sum();
if (curModel.MaxCapacity - countItems >= count)
{
curModel.ShopFlowers[flower.Id] = (pair.Item1, pair.Item2 + count);
if (curModel.ShopFlowers.TryGetValue(flower.Id, out var sameDocument))
{
curModel.ShopFlowers[flower.Id] = (flower, sameDocument.Item2 + count);
_logger.LogInformation("Same flower found by supply. Added {0} of {1} in {2} shop", count, flower.FlowerName, curModel.ShopName);
}
else
{
curModel.ShopFlowers[flower.Id] = (flower, count);
_logger.LogInformation("New flower added by supply. Added {0} of {1} in {2} shop", count, flower.FlowerName, curModel.ShopName);
}
_shopStorage.Update(new()
{
Id = curModel.Id,
ShopName = curModel.ShopName,
Address = curModel.Address,
DateOpen = curModel.DateOpen,
ShopFlowers = curModel.ShopFlowers,
MaxCapacity = curModel.MaxCapacity
});
}
else
{
curModel.ShopFlowers.Add(flower.Id, (flower, count));
_logger.LogWarning("Required shop is overflowed");
return false;
}
Update(new()
{
Id = curModel.Id,
ShopName = curModel.ShopName,
DateOpen = curModel.DateOpen,
Address = curModel.Address,
ShopFlowers = curModel.ShopFlowers,
});
return true;
}
@ -155,5 +168,11 @@ namespace FlowerShopBusinessLogic
throw new InvalidOperationException("Магазин с таким названием уже есть");
}
}
public bool MakeSell(IFlowerModel flower, int count)
{
return _shopStorage.SellFlowers(flower, count);
}
}
}

View File

@ -13,6 +13,7 @@ namespace FlowerShopContracts.BindingModels
public string ShopName { get; set; }
public string Address { get; set; }
public DateTime DateOpen { get; set; }
public int MaxCapacity { get; set; }
public Dictionary<int, (IFlowerModel, int)> ShopFlowers { get; set; } = new();
}
}

View File

@ -18,5 +18,6 @@ namespace FlowerShopContracts.BusinessLogicsContracts
bool Update(ShopBindingModel model);
bool Delete(ShopBindingModel model);
bool MakeSupply(ShopSearchModel model, IFlowerModel flower, int count);
bool MakeSell(IFlowerModel flower, int count);
}
}

View File

@ -18,5 +18,6 @@ namespace FlowerShopContracts.StoragesContracts
ShopViewModel? Insert(ShopBindingModel model);
ShopViewModel? Update(ShopBindingModel model);
ShopViewModel? Delete(ShopBindingModel model);
public bool SellFlowers(IFlowerModel model, int count);
}
}

View File

@ -17,6 +17,8 @@ namespace FlowerShopContracts.ViewModels
public string Address { get; set; }
[DisplayName("Дата открытия")]
public DateTime DateOpen { get; set; }
[DisplayName("Вместимость")]
public int MaxCapacity { get; set; }
public Dictionary<int, (IFlowerModel, int)> ShopFlowers { get; set; } = new();
}
}

View File

@ -11,6 +11,7 @@ namespace FlowerShopDataModels.Models
string ShopName { get; }
string Address { get; }
DateTime DateOpen { get; }
int MaxCapacity { get; }
Dictionary<int, (IFlowerModel, int)> ShopFlowers { get; }
}
}

View File

@ -9,9 +9,11 @@ internal class DataFileSingleton
private readonly string ComponentFileName = "Component.xml";
private readonly string OrderFileName = "Order.xml";
private readonly string FlowerFileName = "Product.xml";
private readonly string ShopFileName = "Shops.xml";
public List<Component> Components { get; private set; }
public List<Order> Orders { get; private set; }
public List<Flower> Flowers { get; private set; }
public List<Shop> Shops { get; private set; }
public static DataFileSingleton GetInstance()
{
if (instance == null)
@ -26,11 +28,14 @@ internal class DataFileSingleton
"Flowers", x => x.GetXElement);
public void SaveOrders() => SaveData(Orders, OrderFileName,
"Orders", x => x.GetXElement);
private DataFileSingleton()
public void SaveShops() => SaveData(Shops, ShopFileName,
"Shops", x => x.GetXElement);
private DataFileSingleton()
{
Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!;
Flowers = LoadData(FlowerFileName, "Flower", x => Flower.Create(x)!)!;
Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!;
Shops = LoadData(ShopFileName, "Shop", x => Shop.Create(x)!)!;
}
private static List<T>? LoadData<T>(string filename, string xmlNodeName, Func<XElement, T> selectFunction)
{

View File

@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using System.Xml.Linq;
using FlowerShopContracts.BindingModels;
using FlowerShopContracts.ViewModels;
using FlowerShopDataModels.Models;
using FlowerShopFileImplement;
using FlowerShopFileImplement.Implements;
namespace FlowerShopFileImplement.Models
{
public class Shop : IShopModel
{
public int Id { get; private set; }
public string ShopName { get; private set; }
public string Address { get; private set; }
public DateTime DateOpen { get; private set; }
public Dictionary<int, int> Flowers { get; private set; } = new();
private Dictionary<int, (IFlowerModel, int)>? _shopFlowers = null;
public Dictionary<int, (IFlowerModel, int)> ShopFlowers
{
get
{
if (_shopFlowers == null)
{
var source = DataFileSingleton.GetInstance();
_shopFlowers = Flowers.ToDictionary(x => x.Key, y =>
((source.Flowers.FirstOrDefault(z => z.Id == y.Key) as IFlowerModel)!,
y.Value));
}
return _shopFlowers;
}
}
public int MaxCapacity { get; private set; }
public static Shop? Create(ShopBindingModel model)
{
if (model == null)
return null;
return new Shop()
{
Id = model.Id,
ShopName = model.ShopName,
Address = model.Address,
DateOpen = model.DateOpen,
MaxCapacity = model.MaxCapacity,
Flowers = model.ShopFlowers.ToDictionary(x => x.Key, x => x.Value.Item2)
};
}
public static Shop? Create(XElement element)
{
if (element == null)
{
return null;
}
return new Shop()
{
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
ShopName = element.Element("ShopName")!.Value,
Address = element.Element("Address")!.Value,
MaxCapacity = Convert.ToInt32(element.Element("MaxCapacity")!.Value),
DateOpen = Convert.ToDateTime(element.Element("DateOpen")!.Value),
Flowers =
element.Element("ShopFlowers")!.Elements("ShopFlower")
.ToDictionary(x =>
Convert.ToInt32(x.Element("Key")?.Value), x =>
Convert.ToInt32(x.Element("Value")?.Value))
};
}
public void Update(ShopBindingModel model)
{
if (model == null)
{
return;
}
ShopName = model.ShopName;
Address = model.Address;
DateOpen = model.DateOpen;
MaxCapacity = model.MaxCapacity;
if (model.ShopFlowers.Count > 0)
{
Flowers = model.ShopFlowers.ToDictionary(x => x.Key, x => x.Value.Item2);
_shopFlowers = null;
}
}
public ShopViewModel GetViewModel => new()
{
Id = Id,
ShopName = ShopName,
Address = Address,
DateOpen = DateOpen,
MaxCapacity = MaxCapacity,
ShopFlowers = ShopFlowers
};
public XElement GetXElement => new("Shop",
new XAttribute("Id", Id),
new XElement("ShopName", ShopName),
new XElement("Address", Address),
new XElement("DateOpen", DateOpen),
new XElement("MaxCapacity", MaxCapacity),
new XElement("ShopFlowers", Flowers
.Select(x => new XElement("ShopFlower",
new XElement("Key", x.Key),
new XElement("Value", x.Value))
).ToArray()));
}
}

View File

@ -0,0 +1,133 @@
using FlowerShopContracts.BindingModels;
using FlowerShopContracts.SearchModels;
using FlowerShopContracts.StoragesContracts;
using FlowerShopContracts.ViewModels;
using FlowerShopDataModels.Models;
using FlowerShopFileImplement.Implements;
using FlowerShopFileImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FlowerShopFileImplement.Implements
{
public class ShopStorage : IShopStorage
{
private readonly DataFileSingleton _source;
public ShopStorage()
{
_source = DataFileSingleton.GetInstance();
}
public List<ShopViewModel> GetFullList()
{
return _source.Shops
.Select(x => x.GetViewModel)
.ToList();
}
public List<ShopViewModel> GetFilteredList(ShopSearchModel
model)
{
if (string.IsNullOrEmpty(model.Name))
{
return new();
}
return _source.Shops
.Where(x => x.ShopName.Contains(model.Name))
.Select(x => x.GetViewModel)
.ToList(); ;
}
public ShopViewModel? GetElement(ShopSearchModel model)
{
if (string.IsNullOrEmpty(model.Name) && !model.Id.HasValue)
{
return null;
}
return _source.Shops
.FirstOrDefault(x =>
(!string.IsNullOrEmpty(model.Name) && x.ShopName == model.Name) ||
(model.Id.HasValue && x.Id == model.Id))
?.GetViewModel;
}
public ShopViewModel? Insert(ShopBindingModel model)
{
model.Id = _source.Shops.Count > 0 ? _source.Shops.Max(x => x.Id) + 1 : 1;
var newShop = Shop.Create(model);
if (newShop == null)
{
return null;
}
_source.Shops.Add(newShop);
_source.SaveShops();
return newShop.GetViewModel;
}
public ShopViewModel? Update(ShopBindingModel model)
{
var component = _source.Shops.FirstOrDefault(x => x.Id == model.Id);
if (component == null)
{
return null;
}
component.Update(model);
_source.SaveShops();
return component.GetViewModel;
}
public ShopViewModel? Delete(ShopBindingModel model)
{
var element = _source.Shops.FirstOrDefault(x => x.Id == model.Id);
if (element != null)
{
_source.Shops.Remove(element);
_source.SaveShops();
return element.GetViewModel;
}
return null;
}
//проверка наполненности магазинов
public bool CheckAvailability(int flowerId, int count)
{
count -= _source.Shops.Select(x => x.ShopFlowers.Select(y => (y.Value.Item1.Id == flowerId ? y.Value.Item2 : 0)).Sum()).Sum();
return count <= 0;
}
//логика продажи
public bool SellFlowers(IFlowerModel model, int count)
{
var flower = _source.Flowers.FirstOrDefault(x => x.Id == model.Id);
if (flower == null || !CheckAvailability(flower.Id, count))
{
return false;
}
for (int i = 0; i < _source.Shops.Count; i++)
{
var shop = _source.Shops[i];
var flowers = shop.ShopFlowers;
foreach (var flowerr in flowers.Where(x => x.Value.Item1.Id == flower.Id))
{
var min = Math.Min(flowerr.Value.Item2, count);
flowers[flowerr.Value.Item1.Id] = (flowerr.Value.Item1, flowerr.Value.Item2 - min);
count -= min;
if (count <= 0)
{
break;
}
}
shop.Update(new ShopBindingModel
{
Id = shop.Id,
ShopName = shop.ShopName,
Address = shop.Address,
DateOpen = shop.DateOpen,
MaxCapacity = shop.MaxCapacity,
ShopFlowers = flowers
});
}
_source.SaveShops();
return true;
}
}
}

View File

@ -15,6 +15,7 @@ namespace FlowerShopListImplement.Models
public string ShopName { get; private set; }
public string Address { get; private set; }
public DateTime DateOpen { get; private set; }
public int MaxCapacity { get; private set; }
public Dictionary<int, (IFlowerModel, int)> ShopFlowers { get; private set; } = new();
public static Shop? Create(ShopBindingModel model)

View File

@ -106,5 +106,51 @@ namespace FlowerShopListImplement.Implements
return null;
}
public bool CheckAvailability(int flowerId, int count)
{
int minus = _source.Shops.Select(x => x.ShopFlowers.Select(y => (y.Value.Item1.Id == flowerId ? y.Value.Item2 : 0)).Sum()).Sum();
count -= minus;
return count <= 0;
}
public bool SellFlowers(IFlowerModel model, int count)
{
var flower = _source.Flowers.FirstOrDefault(x => x.Id == model.Id);
if (flower == null || !CheckAvailability(flower.Id, count))
{
return false;
}
for (int i = 0; i < _source.Shops.Count; i++)
{
var shop = _source.Shops[i];
var flowers = shop.ShopFlowers;
foreach (var flowerr in flowers.Where(x => x.Value.Item1.Id == flower.Id))
{
var min = Math.Min(flowerr.Value.Item2, count);
flowers[flowerr.Value.Item1.Id] = (flowerr.Value.Item1, flowerr.Value.Item2 - min);
count -= min;
if (count <= 0)
{
break;
}
}
shop.Update(new ShopBindingModel
{
Id = shop.Id,
ShopName = shop.ShopName,
Address = shop.Address,
DateOpen = shop.DateOpen,
MaxCapacity = shop.MaxCapacity,
ShopFlowers = flowers
});
}
return true;
}
}
}

View File

@ -40,6 +40,7 @@
ReadyButton = new Button();
IssuedButton = new Button();
RefreshButton = new Button();
продажиToolStripMenuItem = new ToolStripMenuItem();
menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)DataGridView).BeginInit();
SuspendLayout();
@ -56,7 +57,7 @@
//
// ToolStripMenu
//
ToolStripMenu.DropDownItems.AddRange(new ToolStripItem[] { КомпонентыStripMenuItem, ЦветыStripMenuItem, магазиныToolStripMenuItem, поставкиToolStripMenuItem });
ToolStripMenu.DropDownItems.AddRange(new ToolStripItem[] { КомпонентыStripMenuItem, ЦветыStripMenuItem, магазиныToolStripMenuItem, поставкиToolStripMenuItem, продажиToolStripMenuItem });
ToolStripMenu.Name = "ToolStripMenu";
ToolStripMenu.Size = new Size(117, 24);
ToolStripMenu.Text = "Справочники";
@ -148,6 +149,13 @@
RefreshButton.UseVisualStyleBackColor = true;
RefreshButton.Click += RefreshButton_Click;
//
// продажиToolStripMenuItem
//
продажиToolStripMenuItem.Name = "продажиToolStripMenuItem";
продажиToolStripMenuItem.Size = new Size(224, 26);
продажиToolStripMenuItem.Text = "Продажи";
продажиToolStripMenuItem.Click += продажиToolStripMenuItem_Click;
//
// MainForm
//
AutoScaleDimensions = new SizeF(8F, 20F);
@ -185,5 +193,6 @@
private Button RefreshButton;
private ToolStripMenuItem магазиныToolStripMenuItem;
private ToolStripMenuItem поставкиToolStripMenuItem;
private ToolStripMenuItem продажиToolStripMenuItem;
}
}

View File

@ -198,5 +198,14 @@ namespace ProjectFlowerShop
form.ShowDialog();
}
}
private void продажиToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(SellForm));
if (service is SellForm form)
{
form.ShowDialog();
}
}
}
}

View File

@ -53,6 +53,7 @@ namespace ProjectFlowerShop
services.AddTransient<ShopForm>();
services.AddTransient<ShopsForm>();
services.AddTransient<SupplyForm>();
services.AddTransient<SellForm>();
}
}

118
ProjectFlowerShop/SellForm.Designer.cs generated Normal file
View File

@ -0,0 +1,118 @@
namespace ProjectFlowerShop
{
partial class SellForm
{
/// <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()
{
labelFlower = new Label();
labelCount = new Label();
comboBoxFlower = new ComboBox();
textBoxCount = new TextBox();
buttonCancel = new Button();
buttonSave = new Button();
SuspendLayout();
//
// labelFlower
//
labelFlower.AutoSize = true;
labelFlower.Location = new Point(12, 9);
labelFlower.Name = "labelFlower";
labelFlower.Size = new Size(53, 20);
labelFlower.TabIndex = 0;
labelFlower.Text = "Цветы";
//
// labelCount
//
labelCount.AutoSize = true;
labelCount.Location = new Point(12, 87);
labelCount.Name = "labelCount";
labelCount.Size = new Size(90, 20);
labelCount.TabIndex = 1;
labelCount.Text = "Количество";
//
// comboBoxFlower
//
comboBoxFlower.FormattingEnabled = true;
comboBoxFlower.Location = new Point(12, 32);
comboBoxFlower.Name = "comboBoxFlower";
comboBoxFlower.Size = new Size(151, 28);
comboBoxFlower.TabIndex = 2;
//
// textBoxCount
//
textBoxCount.Location = new Point(12, 110);
textBoxCount.Name = "textBoxCount";
textBoxCount.Size = new Size(151, 27);
textBoxCount.TabIndex = 3;
//
// buttonCancel
//
buttonCancel.Location = new Point(277, 153);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.TabIndex = 4;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += buttonCancel_Click;
//
// buttonSave
//
buttonSave.Location = new Point(180, 153);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(94, 29);
buttonSave.TabIndex = 5;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += buttonSave_Click;
//
// SellForm
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(383, 198);
Controls.Add(buttonSave);
Controls.Add(buttonCancel);
Controls.Add(textBoxCount);
Controls.Add(comboBoxFlower);
Controls.Add(labelCount);
Controls.Add(labelFlower);
Name = "SellForm";
Text = "Продажи";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelFlower;
private Label labelCount;
private ComboBox comboBoxFlower;
private TextBox textBoxCount;
private Button buttonCancel;
private Button buttonSave;
}
}

View File

@ -0,0 +1,122 @@
using FlowerShopContracts.BusinessLogicsContracts;
using FlowerShopContracts.SearchModels;
using FlowerShopContracts.ViewModels;
using FlowerShopDataModels.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 ProjectFlowerShop
{
public partial class SellForm : Form
{
private readonly List<FlowerViewModel>? _flowerList;
IShopLogic _shopLogic;
IFlowerLogic _flowerLogic;
public SellForm(IFlowerLogic flowerLogic, IShopLogic shopLogic)
{
InitializeComponent();
_shopLogic = shopLogic;
_flowerLogic = flowerLogic;
_flowerList = flowerLogic.ReadList(null);
if (_flowerList != null)
{
comboBoxFlower.DisplayMember = "FlowerName";
comboBoxFlower.ValueMember = "Id";
comboBoxFlower.DataSource = _flowerList;
comboBoxFlower.SelectedItem = null;
}
}
public int FlowerId
{
get
{
return Convert.ToInt32(comboBoxFlower.SelectedValue);
}
set
{
comboBoxFlower.SelectedValue = value;
}
}
public IFlowerModel? FlowerModel
{
get
{
if (_flowerList == null)
{
return null;
}
foreach (var elem in _flowerList)
{
if (elem.Id == FlowerId)
{
return elem;
}
}
return null;
}
}
public int Count
{
get { return Convert.ToInt32(textBoxCount.Text); }
set
{ textBoxCount.Text = value.ToString(); }
}
private void buttonSave_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBoxCount.Text))
{
MessageBox.Show("Заполните поле Количество", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (comboBoxFlower.SelectedValue == null)
{
MessageBox.Show("Выберите цветы", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try
{
int count = Convert.ToInt32(textBoxCount.Text);
bool res = _shopLogic.MakeSell(
_flowerLogic.ReadElement(new() { Id = Convert.ToInt32(comboBoxFlower.SelectedValue) }),
count
);
if (!res)
{
throw new Exception("Ошибка при продаже.");
}
MessageBox.Show("Продажа прошла успешно");
DialogResult = DialogResult.OK;
Close();
}
catch (Exception err)
{
MessageBox.Show("Ошибка продажи");
return;
}
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}

View 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>

View File

@ -28,7 +28,12 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShopForm));
DataGridView = new DataGridView();
ColumnID = new DataGridViewTextBoxColumn();
Name = new DataGridViewTextBoxColumn();
Price = new DataGridViewTextBoxColumn();
Number = new DataGridViewTextBoxColumn();
buttonSave = new Button();
buttonCancel = new Button();
textBoxName = new TextBox();
@ -37,126 +42,100 @@
labelAddress = new Label();
DateTimePicker = new DateTimePicker();
labelDate = new Label();
ColumnID = new DataGridViewTextBoxColumn();
Name = new DataGridViewTextBoxColumn();
Price = new DataGridViewTextBoxColumn();
Number = new DataGridViewTextBoxColumn();
CapacityUpDown = new NumericUpDown();
labelCapacity = new Label();
((System.ComponentModel.ISupportInitialize)DataGridView).BeginInit();
((System.ComponentModel.ISupportInitialize)CapacityUpDown).BeginInit();
SuspendLayout();
//
// DataGridView
//
DataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
DataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnID, Name, Price, Number });
DataGridView.Location = new Point(21, 12);
resources.ApplyResources(DataGridView, "DataGridView");
DataGridView.Name = "DataGridView";
DataGridView.RowHeadersWidth = 51;
DataGridView.RowTemplate.Height = 29;
DataGridView.Size = new Size(397, 305);
DataGridView.TabIndex = 0;
//
// ColumnID
//
resources.ApplyResources(ColumnID, "ColumnID");
ColumnID.Name = "ColumnID";
//
// Name
//
resources.ApplyResources(Name, "Name");
Name.Name = "Name";
//
// Price
//
resources.ApplyResources(Price, "Price");
Price.Name = "Price";
//
// Number
//
resources.ApplyResources(Number, "Number");
Number.Name = "Number";
//
// buttonSave
//
buttonSave.Location = new Point(424, 288);
resources.ApplyResources(buttonSave, "buttonSave");
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(123, 29);
buttonSave.TabIndex = 1;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += buttonSave_Click;
//
// buttonCancel
//
buttonCancel.Location = new Point(553, 288);
resources.ApplyResources(buttonCancel, "buttonCancel");
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(116, 29);
buttonCancel.TabIndex = 2;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += buttonCancel_Click;
//
// textBoxName
//
textBoxName.Location = new Point(424, 34);
resources.ApplyResources(textBoxName, "textBoxName");
textBoxName.Name = "textBoxName";
textBoxName.Size = new Size(245, 27);
textBoxName.TabIndex = 3;
//
// textBoxAddress
//
textBoxAddress.Location = new Point(424, 95);
resources.ApplyResources(textBoxAddress, "textBoxAddress");
textBoxAddress.Name = "textBoxAddress";
textBoxAddress.Size = new Size(245, 27);
textBoxAddress.TabIndex = 4;
//
// labelName
//
labelName.AutoSize = true;
labelName.Location = new Point(424, 12);
resources.ApplyResources(labelName, "labelName");
labelName.Name = "labelName";
labelName.Size = new Size(77, 20);
labelName.TabIndex = 5;
labelName.Text = "Название";
//
// labelAddress
//
labelAddress.AutoSize = true;
labelAddress.Location = new Point(424, 72);
resources.ApplyResources(labelAddress, "labelAddress");
labelAddress.Name = "labelAddress";
labelAddress.Size = new Size(51, 20);
labelAddress.TabIndex = 6;
labelAddress.Text = "Адрес";
//
// DateTimePicker
//
DateTimePicker.Location = new Point(424, 148);
resources.ApplyResources(DateTimePicker, "DateTimePicker");
DateTimePicker.Name = "DateTimePicker";
DateTimePicker.Size = new Size(245, 27);
DateTimePicker.TabIndex = 7;
//
// labelDate
//
labelDate.AutoSize = true;
labelDate.Location = new Point(424, 125);
resources.ApplyResources(labelDate, "labelDate");
labelDate.Name = "labelDate";
labelDate.Size = new Size(41, 20);
labelDate.TabIndex = 8;
labelDate.Text = "Дата";
//
// ColumnID
// CapacityUpDown
//
ColumnID.HeaderText = "ColumnID";
ColumnID.MinimumWidth = 6;
ColumnID.Name = "ColumnID";
ColumnID.Visible = false;
ColumnID.Width = 125;
resources.ApplyResources(CapacityUpDown, "CapacityUpDown");
CapacityUpDown.Name = "CapacityUpDown";
//
// Name
// labelCapacity
//
Name.HeaderText = "Название";
Name.MinimumWidth = 6;
Name.Name = "Name";
Name.Width = 125;
//
// Price
//
Price.HeaderText = "Цена";
Price.MinimumWidth = 6;
Price.Name = "Price";
Price.Width = 125;
//
// Number
//
Number.HeaderText = "Количество";
Number.MinimumWidth = 6;
Number.Name = "Number";
Number.Width = 125;
resources.ApplyResources(labelCapacity, "labelCapacity");
labelCapacity.Name = "labelCapacity";
//
// ShopForm
//
AutoScaleDimensions = new SizeF(8F, 20F);
resources.ApplyResources(this, "$this");
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(681, 329);
Controls.Add(labelCapacity);
Controls.Add(CapacityUpDown);
Controls.Add(labelDate);
Controls.Add(DateTimePicker);
Controls.Add(labelAddress);
@ -166,10 +145,9 @@
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(DataGridView);
//Name = "ShopForm";
Text = "ShopForm";
Load += ShopForm_Load;
((System.ComponentModel.ISupportInitialize)DataGridView).EndInit();
((System.ComponentModel.ISupportInitialize)CapacityUpDown).EndInit();
ResumeLayout(false);
PerformLayout();
}
@ -189,5 +167,7 @@
private DataGridViewTextBoxColumn Name;
private DataGridViewTextBoxColumn Price;
private DataGridViewTextBoxColumn Number;
private NumericUpDown CapacityUpDown;
private Label labelCapacity;
}
}

View 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>

View File

@ -71,7 +71,7 @@ namespace ProjectFlowerShop
ShopName = textBoxName.Text,
Address = textBoxAddress.Text,
DateOpen = DateTimePicker.Value.Date,
ShopFlowers = _flowers
MaxCapacity = Convert.ToInt32(CapacityUpDown.Value),
};
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
if (!operationResult)
@ -108,7 +108,8 @@ namespace ProjectFlowerShop
textBoxName.Text = shop.ShopName;
textBoxAddress.Text = shop.Address;
DateTimePicker.Text = shop.DateOpen.ToString();
_flowers = shop.ShopFlowers;
CapacityUpDown.Value = shop.MaxCapacity;
_flowers = shop.ShopFlowers ?? new Dictionary<int, (IFlowerModel, int)>();
}
LoadData();
}

View File

@ -120,13 +120,360 @@
<metadata name="ColumnID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="ColumnID.HeaderText" xml:space="preserve">
<value>ColumnID</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="ColumnID.MinimumWidth" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="ColumnID.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="ColumnID.Width" type="System.Int32, mscorlib">
<value>125</value>
</data>
<metadata name="Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="Name.HeaderText" xml:space="preserve">
<value>Название</value>
</data>
<data name="Name.MinimumWidth" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="Name.Width" type="System.Int32, mscorlib">
<value>125</value>
</data>
<metadata name="Price.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="Price.HeaderText" xml:space="preserve">
<value>Цена</value>
</data>
<data name="Price.MinimumWidth" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="Price.Width" type="System.Int32, mscorlib">
<value>125</value>
</data>
<metadata name="Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="Number.HeaderText" xml:space="preserve">
<value>Количество</value>
</data>
<data name="Number.MinimumWidth" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="Number.Width" type="System.Int32, mscorlib">
<value>125</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="DataGridView.Location" type="System.Drawing.Point, System.Drawing">
<value>21, 12</value>
</data>
<data name="DataGridView.RowHeadersWidth" type="System.Int32, mscorlib">
<value>51</value>
</data>
<data name="DataGridView.Size" type="System.Drawing.Size, System.Drawing">
<value>397, 305</value>
</data>
<data name="DataGridView.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;DataGridView.Name" xml:space="preserve">
<value>DataGridView</value>
</data>
<data name="&gt;&gt;DataGridView.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridView, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;DataGridView.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;DataGridView.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="buttonSave.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 288</value>
</data>
<data name="buttonSave.Size" type="System.Drawing.Size, System.Drawing">
<value>123, 29</value>
</data>
<data name="buttonSave.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="buttonSave.Text" xml:space="preserve">
<value>Сохранить</value>
</data>
<data name="&gt;&gt;buttonSave.Name" xml:space="preserve">
<value>buttonSave</value>
</data>
<data name="&gt;&gt;buttonSave.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonSave.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonSave.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="buttonCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>553, 288</value>
</data>
<data name="buttonCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>116, 29</value>
</data>
<data name="buttonCancel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="buttonCancel.Text" xml:space="preserve">
<value>Отмена</value>
</data>
<data name="&gt;&gt;buttonCancel.Name" xml:space="preserve">
<value>buttonCancel</value>
</data>
<data name="&gt;&gt;buttonCancel.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonCancel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonCancel.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="textBoxName.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 34</value>
</data>
<data name="textBoxName.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 27</value>
</data>
<data name="textBoxName.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;textBoxName.Name" xml:space="preserve">
<value>textBoxName</value>
</data>
<data name="&gt;&gt;textBoxName.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxName.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;textBoxName.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="textBoxAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 95</value>
</data>
<data name="textBoxAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 27</value>
</data>
<data name="textBoxAddress.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;textBoxAddress.Name" xml:space="preserve">
<value>textBoxAddress</value>
</data>
<data name="&gt;&gt;textBoxAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxAddress.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;textBoxAddress.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="labelName.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelName.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 12</value>
</data>
<data name="labelName.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 20</value>
</data>
<data name="labelName.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="labelName.Text" xml:space="preserve">
<value>Название</value>
</data>
<data name="&gt;&gt;labelName.Name" xml:space="preserve">
<value>labelName</value>
</data>
<data name="&gt;&gt;labelName.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelName.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;labelName.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="labelAddress.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 72</value>
</data>
<data name="labelAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>51, 20</value>
</data>
<data name="labelAddress.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="labelAddress.Text" xml:space="preserve">
<value>Адрес</value>
</data>
<data name="&gt;&gt;labelAddress.Name" xml:space="preserve">
<value>labelAddress</value>
</data>
<data name="&gt;&gt;labelAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelAddress.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;labelAddress.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="DateTimePicker.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 148</value>
</data>
<data name="DateTimePicker.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 27</value>
</data>
<data name="DateTimePicker.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;DateTimePicker.Name" xml:space="preserve">
<value>DateTimePicker</value>
</data>
<data name="&gt;&gt;DateTimePicker.Type" xml:space="preserve">
<value>System.Windows.Forms.DateTimePicker, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;DateTimePicker.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;DateTimePicker.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="labelDate.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelDate.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 125</value>
</data>
<data name="labelDate.Size" type="System.Drawing.Size, System.Drawing">
<value>41, 20</value>
</data>
<data name="labelDate.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="labelDate.Text" xml:space="preserve">
<value>Дата</value>
</data>
<data name="&gt;&gt;labelDate.Name" xml:space="preserve">
<value>labelDate</value>
</data>
<data name="&gt;&gt;labelDate.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelDate.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;labelDate.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="CapacityUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 207</value>
</data>
<data name="CapacityUpDown.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 27</value>
</data>
<data name="CapacityUpDown.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="&gt;&gt;CapacityUpDown.Name" xml:space="preserve">
<value>CapacityUpDown</value>
</data>
<data name="&gt;&gt;CapacityUpDown.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;CapacityUpDown.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;CapacityUpDown.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="labelCapacity.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelCapacity.Location" type="System.Drawing.Point, System.Drawing">
<value>424, 184</value>
</data>
<data name="labelCapacity.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 20</value>
</data>
<data name="labelCapacity.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="labelCapacity.Text" xml:space="preserve">
<value>Вместимость</value>
</data>
<data name="&gt;&gt;labelCapacity.Name" xml:space="preserve">
<value>labelCapacity</value>
</data>
<data name="&gt;&gt;labelCapacity.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelCapacity.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;labelCapacity.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>8, 20</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>681, 329</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Магазин</value>
</data>
<data name="&gt;&gt;ColumnID.Name" xml:space="preserve">
<value>ColumnID</value>
</data>
<data name="&gt;&gt;ColumnID.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;Name.Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="&gt;&gt;Name.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;Price.Name" xml:space="preserve">
<value>Price</value>
</data>
<data name="&gt;&gt;Price.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;Number.Name" xml:space="preserve">
<value>Number</value>
</data>
<data name="&gt;&gt;Number.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>ShopForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>