02Hard is done.

This commit is contained in:
Yuee Shiness 2023-06-01 01:58:22 +04:00
parent d1891a4b1b
commit 52b4de4084
28 changed files with 1049 additions and 690 deletions

View File

@ -121,38 +121,63 @@ namespace DressAtelierBusinessLogic.BusinessLogic
} }
} }
public bool AddDress(AtelierBindingModel atelierModel, DressBindingModel dressModel, int quantity) public (bool result,int quantity) AddDress(AtelierBindingModel? atelierModel, DressBindingModel dressModel, int quantity)
{ {
if(dressModel == null || atelierModel == null || quantity == 0)
if(dressModel == null || quantity == 0)
{ {
return false; return (false,-1);
} }
var dress = _dressStorage.GetElement(new DressSearchModel
{
ID = dressModel.ID
});
var atelier = _atelierStorage.GetElement(new AtelierSearchModel var atelier = _atelierStorage.GetElement(new AtelierSearchModel
{ {
ID = atelierModel.ID ID = atelierModel.ID
}); });
var dress = _dressStorage.GetElement(new DressSearchModel
if(atelier.CurrentQuantity >= atelier.MaxTotalOfDresses)
{ {
ID= dressModel.ID throw new Exception("Storage overflow");
});
if(atelier.DressesList.ContainsKey(dress.ID))
{
atelier.DressesList[dressModel.ID] = (dress, quantity + atelier.DressesList[dressModel.ID].Item2);
} }
else
if(!atelier.DressesList.ContainsKey(dress.ID))
{ {
atelier.DressesList.Add(dress.ID, (dress, quantity)); atelier.DressesList.Add(dress.ID, (dress, 1));
quantity--;
} }
while(atelier.DressesList.Sum(x => x.Value.Item2) < atelier.MaxTotalOfDresses && quantity != 0)
{
var qnt = atelier.DressesList[dressModel.ID];
qnt.Item2++;
atelier.DressesList[dressModel.ID] = qnt;
quantity--;
}
atelierModel.Name = atelier.Name; atelierModel.Name = atelier.Name;
atelierModel.Address = atelier.Address; atelierModel.Address = atelier.Address;
atelierModel.DressesList = atelier.DressesList; atelierModel.DressesList = atelier.DressesList;
atelierModel.OpeningDate = atelier.OpeningDate; atelierModel.OpeningDate = atelier.OpeningDate;
if(_atelierStorage.Update(atelierModel) == null || atelier.DressesList.Count > atelier.MaxTotalOfDresses) atelierModel.MaxTotalOfDresses = atelier.MaxTotalOfDresses;
if (_atelierStorage.Update(atelierModel) == null)
{ {
_logger.LogWarning("Restocking operation failed"); _logger.LogWarning("Restocking operation failed");
return false; throw new Exception("Something went wrong.");
} }
return true; return (true, quantity);
}
public bool SellDress(DressSearchModel model, int quantity)
{
if(_atelierStorage.SellDresses(model,quantity))
{
return true;
}
return false;
} }
} }

View File

@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Transactions;
namespace DressAtelierBusinessLogic.BusinessLogic namespace DressAtelierBusinessLogic.BusinessLogic
{ {
@ -18,11 +19,12 @@ namespace DressAtelierBusinessLogic.BusinessLogic
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IOrderStorage _orderStorage; private readonly IOrderStorage _orderStorage;
private readonly IAtelierLogic _atelierLogic;
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage) public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage, IAtelierLogic atelierLogic)
{ {
_logger = logger; _logger = logger;
_orderStorage = orderStorage; _orderStorage = orderStorage;
_atelierLogic = atelierLogic;
} }
public bool CreateOrder(OrderBindingModel model) public bool CreateOrder(OrderBindingModel model)
@ -53,6 +55,35 @@ namespace DressAtelierBusinessLogic.BusinessLogic
_logger.LogWarning("Update operation failed"); _logger.LogWarning("Update operation failed");
return false; return false;
} }
var ateliers = _atelierLogic.ReadList(null);
if (ateliers == null)
{
return false;
}
int quantity = model.Count;
using TransactionScope scope = new TransactionScope();
try
{
foreach (var atelier in ateliers)
{
quantity = _atelierLogic.AddDress(new AtelierBindingModel { ID = atelier.ID }, new DressBindingModel { ID = model.ID }, quantity).quantity;
}
if (quantity > 0)
{
throw new Exception("Shops' storages are full.");
}
}
catch (Exception ex)
{
throw new OverflowException("Shops' storages are full.");
}
scope.Complete();
model.Status = OrderStatus.Given; model.Status = OrderStatus.Given;
model.DateImplement = DateTime.Now; model.DateImplement = DateTime.Now;
_orderStorage.Update(model); _orderStorage.Update(model);
@ -69,6 +100,7 @@ namespace DressAtelierBusinessLogic.BusinessLogic
_logger.LogWarning("Update operation failed"); _logger.LogWarning("Update operation failed");
return false; return false;
} }
model.Status = OrderStatus.Ready; model.Status = OrderStatus.Ready;
_orderStorage.Update(model); _orderStorage.Update(model);

View File

@ -20,5 +20,7 @@ namespace DressAtelierContracts.BindingModels
public int ID { get; set; } public int ID { get; set; }
public int MaxTotalOfDresses { get; set; } public int MaxTotalOfDresses { get; set; }
public int CurrentQuantity { get; set; }
} }
} }

View File

@ -13,9 +13,10 @@ namespace DressAtelierContracts.BusinessLogicContracts
{ {
List<AtelierViewModel>? ReadList(AtelierSearchModel? model); List<AtelierViewModel>? ReadList(AtelierSearchModel? model);
AtelierViewModel? ReadElement(AtelierSearchModel model); AtelierViewModel? ReadElement(AtelierSearchModel model);
bool AddDress(AtelierBindingModel atelierModel, DressBindingModel dressModel, int quantity); (bool result, int quantity) AddDress(AtelierBindingModel atelierModel, DressBindingModel dressModel, int quantity);
bool Create(AtelierBindingModel model); bool Create(AtelierBindingModel model);
bool Update(AtelierBindingModel model); bool Update(AtelierBindingModel model);
bool Delete(AtelierBindingModel model); bool Delete(AtelierBindingModel model);
bool SellDress(DressSearchModel model, int quantity);
} }
} }

View File

@ -17,7 +17,7 @@ namespace DressAtelierContracts.StorageContracts
AtelierViewModel? Insert(AtelierBindingModel model); AtelierViewModel? Insert(AtelierBindingModel model);
AtelierViewModel? Update(AtelierBindingModel model); AtelierViewModel? Update(AtelierBindingModel model);
AtelierViewModel? Delete(AtelierBindingModel model); AtelierViewModel? Delete(AtelierBindingModel model);
AtelierViewModel? CheckDressesQuantity(DressBindingModel model, int quantity); AtelierViewModel? CheckDressesQuantity(DressSearchModel model, int quantity);
bool SellDresses(DressBindingModel model, int quantity); bool SellDresses(DressSearchModel model, int quantity);
} }
} }

View File

@ -21,5 +21,6 @@ namespace DressAtelierContracts.ViewModels
public Dictionary<int, (IDressModel, int)> DressesList { get; set; } = new(); public Dictionary<int, (IDressModel, int)> DressesList { get; set; } = new();
public int MaxTotalOfDresses { get; set; } public int MaxTotalOfDresses { get; set; }
public int CurrentQuantity { get; set; }
} }
} }

View File

@ -13,5 +13,6 @@ namespace DressAtelierDataModels.Models
DateTime OpeningDate { get; } DateTime OpeningDate { get; }
Dictionary<int,(IDressModel,int)> DressesList { get; } Dictionary<int,(IDressModel,int)> DressesList { get; }
int MaxTotalOfDresses { get; } int MaxTotalOfDresses { get; }
int CurrentQuantity { get; }
} }
} }

View File

@ -2,6 +2,7 @@
using DressAtelierContracts.SearchModels; using DressAtelierContracts.SearchModels;
using DressAtelierContracts.StorageContracts; using DressAtelierContracts.StorageContracts;
using DressAtelierContracts.ViewModels; using DressAtelierContracts.ViewModels;
using DressAtelierDataModels.Models;
using DressAtelierFileImplement.Models; using DressAtelierFileImplement.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -97,12 +98,12 @@ namespace DressAtelierFileImplement.Implements
return _source.Ateliers.Select(x => x.GetViewModel).ToList(); return _source.Ateliers.Select(x => x.GetViewModel).ToList();
} }
public AtelierViewModel? CheckDressesQuantity(DressBindingModel model, int quantity) public AtelierViewModel? CheckDressesQuantity(DressSearchModel model, int quantity)
{ {
var ateliers = GetFilteredList(new AtelierSearchModel { DressID = model.ID }); var ateliers = GetFilteredList(new AtelierSearchModel { DressID = model.ID });
foreach(var atelier in ateliers) foreach(var atelier in ateliers)
{ {
if (atelier.DressesList[model.ID].Item2 >= quantity) if (atelier.DressesList[model.ID.Value].Item2 >= quantity)
{ {
return atelier; return atelier;
} }
@ -110,10 +111,13 @@ namespace DressAtelierFileImplement.Implements
return null; return null;
} }
public bool SellDresses(DressBindingModel model, int quantity) public bool SellDresses(DressSearchModel model, int quantity)
{ {
(IDressModel, int) qnt = (null,0);
var specatelier = CheckDressesQuantity(model, quantity); var specatelier = CheckDressesQuantity(model, quantity);
if (specatelier == null) if (specatelier == null)
{ {
var ateliers = GetFilteredList(new AtelierSearchModel { DressID = model.ID }); var ateliers = GetFilteredList(new AtelierSearchModel { DressID = model.ID });
@ -124,15 +128,26 @@ namespace DressAtelierFileImplement.Implements
{ {
foreach (var atelier in ateliers) foreach (var atelier in ateliers)
{ {
if (atelier.DressesList[model.ID].Item2 >= requiredQuantity) if(requiredQuantity - atelier.DressesList[model.ID.Value].Item2 > 0)
{ {
atelier.DressesList.Remove(model.ID); requiredQuantity -= atelier.DressesList[model.ID.Value].Item2;
_source.SaveAteliers(); atelier.DressesList.Remove(model.ID.Value);
scope.Complete();
return true;
} }
requiredQuantity -= atelier.DressesList[model.ID].Item2; else
atelier.DressesList.Remove(model.ID); {
qnt = atelier.DressesList[model.ID.Value];
qnt.Item2 -= requiredQuantity;
atelier.DressesList[model.ID.Value] = qnt;
requiredQuantity = 0;
}
Update(new AtelierBindingModel
{
ID = atelier.ID,
DressesList = atelier.DressesList
});
} }
if (requiredQuantity > 0) if (requiredQuantity > 0)
@ -140,6 +155,7 @@ namespace DressAtelierFileImplement.Implements
throw new Exception("Not enough dresses in ateliers"); throw new Exception("Not enough dresses in ateliers");
} }
_source.SaveAteliers(); _source.SaveAteliers();
scope.Complete();
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
@ -148,8 +164,18 @@ namespace DressAtelierFileImplement.Implements
} }
} }
specatelier.DressesList.Remove(model.ID); qnt = specatelier.DressesList[model.ID.Value];
_source.SaveAteliers(); qnt.Item2 -= quantity;
specatelier.DressesList[model.ID.Value] = qnt;
specatelier.DressesList.Remove(model.ID.Value);
Update(new AtelierBindingModel
{
ID = specatelier.ID,
DressesList = specatelier.DressesList
});
return true; return true;
} }
} }

View File

@ -84,12 +84,9 @@ namespace DressAtelierFileImplement.Models
{ {
return; return;
} }
Name = atelier.Name;
Address = atelier.Address;
CurrentDresses = atelier.DressesList.ToDictionary(x => x.Key, x => x.Value.Item2); CurrentDresses = atelier.DressesList.ToDictionary(x => x.Key, x => x.Value.Item2);
DressesList.Clear(); CurrentQuantity = atelier.DressesList.Sum(x => x.Value.Item2);
OpeningDate = atelier.OpeningDate; DressesList = Dresses;
MaxTotalOfDresses = atelier.MaxTotalOfDresses;
} }
@ -99,15 +96,16 @@ namespace DressAtelierFileImplement.Models
Name = Name, Name = Name,
Address = Address, Address = Address,
OpeningDate = OpeningDate, OpeningDate = OpeningDate,
DressesList = DressesList, DressesList = Dresses,
MaxTotalOfDresses = MaxTotalOfDresses MaxTotalOfDresses = MaxTotalOfDresses,
CurrentQuantity = CurrentQuantity
}; };
public XElement GetXElement => new("Atelier", new XAttribute("ID", ID), public XElement GetXElement => new("Atelier", new XAttribute("ID", ID),
new XElement("Name", Name), new XElement("Name", Name),
new XElement("Address", Address), new XElement("Address", Address),
new XElement("OpeningDate", OpeningDate.ToString()), new XElement("OpeningDate", OpeningDate.ToString()),
new XElement("Dresses", DressesList), new XElement("Dresses", CurrentDresses.Select(x => new XElement("Dress", new XElement("Key",x.Key), new XElement("Value", x.Value))).ToArray()),
new XElement("MaxTotalOfDresses", MaxTotalOfDresses), new XElement("MaxTotalOfDresses", MaxTotalOfDresses),
new XElement("CurrentDressesQuantity", CurrentQuantity)); new XElement("CurrentDressesQuantity", CurrentQuantity));
} }

View File

@ -99,12 +99,12 @@ namespace DressAtelierListImplement.Implements
return null; return null;
} }
public AtelierViewModel? CheckDressesQuantity(DressBindingModel model, int quantity) public AtelierViewModel? CheckDressesQuantity(DressSearchModel model, int quantity)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool SellDresses(DressBindingModel model, int quantity) public bool SellDresses(DressSearchModel model, int quantity)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -15,7 +15,7 @@ namespace DressAtelierListImplement.Models
public string Name { get; private set; } = string.Empty; public string Name { get; private set; } = string.Empty;
public string Address { get; private set; } = string.Empty; public string Address { get; private set; } = string.Empty;
public int MaxTotalOfDresses { get; private set; } public int MaxTotalOfDresses { get; private set; }
public int CurrentDressesQuantity { get; private set; } public int CurrentQuantity { get; private set; }
public DateTime OpeningDate { get; private set; } = DateTime.Today; public DateTime OpeningDate { get; private set; } = DateTime.Today;
public Dictionary<int, (IDressModel, int)> DressesList { get; private set; } = new Dictionary<int, (IDressModel, int)>(); public Dictionary<int, (IDressModel, int)> DressesList { get; private set; } = new Dictionary<int, (IDressModel, int)>();
@ -33,7 +33,7 @@ namespace DressAtelierListImplement.Models
OpeningDate = atelier.OpeningDate, OpeningDate = atelier.OpeningDate,
DressesList = atelier.DressesList, DressesList = atelier.DressesList,
MaxTotalOfDresses = atelier.MaxTotalOfDresses, MaxTotalOfDresses = atelier.MaxTotalOfDresses,
CurrentDressesQuantity = 0 CurrentQuantity = 0
}; };
} }
@ -48,7 +48,7 @@ namespace DressAtelierListImplement.Models
DressesList = atelier.DressesList; DressesList = atelier.DressesList;
OpeningDate = atelier.OpeningDate; OpeningDate = atelier.OpeningDate;
MaxTotalOfDresses = atelier.MaxTotalOfDresses; MaxTotalOfDresses = atelier.MaxTotalOfDresses;
CurrentDressesQuantity = DressesList.Count(); CurrentQuantity = atelier.DressesList.Sum(x => x.Value.Item2);
} }
@ -59,7 +59,9 @@ namespace DressAtelierListImplement.Models
Address = Address, Address = Address,
OpeningDate = OpeningDate, OpeningDate = OpeningDate,
DressesList = DressesList, DressesList = DressesList,
MaxTotalOfDresses = MaxTotalOfDresses MaxTotalOfDresses = MaxTotalOfDresses,
CurrentQuantity = CurrentQuantity
}; };
} }
} }

View File

@ -123,7 +123,7 @@
Controls.Add(atelierAddressTextBox); Controls.Add(atelierAddressTextBox);
Controls.Add(atelierNameTextBox); Controls.Add(atelierNameTextBox);
Name = "FormAtelier"; Name = "FormAtelier";
Text = "FormAtelier"; Text = "Atelier creation";
Load += FormAtelier_Load; Load += FormAtelier_Load;
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();

View File

@ -28,110 +28,109 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.atelierComboBox = new System.Windows.Forms.ComboBox(); atelierComboBox = new ComboBox();
this.atelierLabel = new System.Windows.Forms.Label(); atelierLabel = new Label();
this.dressComboBox = new System.Windows.Forms.ComboBox(); dressComboBox = new ComboBox();
this.dressLabel = new System.Windows.Forms.Label(); dressLabel = new Label();
this.quantityTextBox = new System.Windows.Forms.TextBox(); quantityTextBox = new TextBox();
this.quantityLabel = new System.Windows.Forms.Label(); quantityLabel = new Label();
this.ButtonCancel = new System.Windows.Forms.Button(); ButtonCancel = new Button();
this.ButtonSave = new System.Windows.Forms.Button(); ButtonSave = new Button();
this.SuspendLayout(); SuspendLayout();
// //
// atelierComboBox // atelierComboBox
// //
this.atelierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; atelierComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.atelierComboBox.FormattingEnabled = true; atelierComboBox.FormattingEnabled = true;
this.atelierComboBox.Location = new System.Drawing.Point(114, 21); atelierComboBox.Location = new Point(114, 21);
this.atelierComboBox.Name = "atelierComboBox"; atelierComboBox.Name = "atelierComboBox";
this.atelierComboBox.Size = new System.Drawing.Size(293, 23); atelierComboBox.Size = new Size(293, 23);
this.atelierComboBox.TabIndex = 7; atelierComboBox.TabIndex = 7;
// //
// atelierLabel // atelierLabel
// //
this.atelierLabel.AutoSize = true; atelierLabel.AutoSize = true;
this.atelierLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); atelierLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.atelierLabel.Location = new System.Drawing.Point(12, 18); atelierLabel.Location = new Point(12, 18);
this.atelierLabel.Name = "atelierLabel"; atelierLabel.Name = "atelierLabel";
this.atelierLabel.Size = new System.Drawing.Size(71, 25); atelierLabel.Size = new Size(71, 25);
this.atelierLabel.TabIndex = 6; atelierLabel.TabIndex = 6;
this.atelierLabel.Text = "Atelier:"; atelierLabel.Text = "Atelier:";
// //
// dressComboBox // dressComboBox
// //
this.dressComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; dressComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.dressComboBox.FormattingEnabled = true; dressComboBox.FormattingEnabled = true;
this.dressComboBox.Location = new System.Drawing.Point(114, 69); dressComboBox.Location = new Point(114, 69);
this.dressComboBox.Name = "dressComboBox"; dressComboBox.Name = "dressComboBox";
this.dressComboBox.Size = new System.Drawing.Size(320, 23); dressComboBox.Size = new Size(320, 23);
this.dressComboBox.TabIndex = 9; dressComboBox.TabIndex = 9;
// //
// dressLabel // dressLabel
// //
this.dressLabel.AutoSize = true; dressLabel.AutoSize = true;
this.dressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); dressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.dressLabel.Location = new System.Drawing.Point(12, 66); dressLabel.Location = new Point(12, 66);
this.dressLabel.Name = "dressLabel"; dressLabel.Name = "dressLabel";
this.dressLabel.Size = new System.Drawing.Size(82, 25); dressLabel.Size = new Size(82, 25);
this.dressLabel.TabIndex = 8; dressLabel.TabIndex = 8;
this.dressLabel.Text = "Product:"; dressLabel.Text = "Product:";
// //
// quantityTextBox // quantityTextBox
// //
this.quantityTextBox.Location = new System.Drawing.Point(114, 113); quantityTextBox.Location = new Point(114, 113);
this.quantityTextBox.Name = "quantityTextBox"; quantityTextBox.Name = "quantityTextBox";
this.quantityTextBox.Size = new System.Drawing.Size(320, 23); quantityTextBox.Size = new Size(320, 23);
this.quantityTextBox.TabIndex = 11; quantityTextBox.TabIndex = 11;
// //
// quantityLabel // quantityLabel
// //
this.quantityLabel.AutoSize = true; quantityLabel.AutoSize = true;
this.quantityLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); quantityLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.quantityLabel.Location = new System.Drawing.Point(12, 111); quantityLabel.Location = new Point(12, 111);
this.quantityLabel.Name = "quantityLabel"; quantityLabel.Name = "quantityLabel";
this.quantityLabel.Size = new System.Drawing.Size(88, 25); quantityLabel.Size = new Size(88, 25);
this.quantityLabel.TabIndex = 10; quantityLabel.TabIndex = 10;
this.quantityLabel.Text = "Quantity:"; quantityLabel.Text = "Quantity:";
// //
// ButtonCancel // ButtonCancel
// //
this.ButtonCancel.Location = new System.Drawing.Point(336, 177); ButtonCancel.Location = new Point(336, 177);
this.ButtonCancel.Name = "ButtonCancel"; ButtonCancel.Name = "ButtonCancel";
this.ButtonCancel.Size = new System.Drawing.Size(100, 32); ButtonCancel.Size = new Size(100, 32);
this.ButtonCancel.TabIndex = 13; ButtonCancel.TabIndex = 13;
this.ButtonCancel.Text = "Cancel"; ButtonCancel.Text = "Cancel";
this.ButtonCancel.UseVisualStyleBackColor = true; ButtonCancel.UseVisualStyleBackColor = true;
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); ButtonCancel.Click += ButtonCancel_Click;
// //
// ButtonSave // ButtonSave
// //
this.ButtonSave.Location = new System.Drawing.Point(222, 177); ButtonSave.Location = new Point(222, 177);
this.ButtonSave.Name = "ButtonSave"; ButtonSave.Name = "ButtonSave";
this.ButtonSave.Size = new System.Drawing.Size(100, 32); ButtonSave.Size = new Size(100, 32);
this.ButtonSave.TabIndex = 12; ButtonSave.TabIndex = 12;
this.ButtonSave.Text = "Save"; ButtonSave.Text = "Save";
this.ButtonSave.UseVisualStyleBackColor = true; ButtonSave.UseVisualStyleBackColor = true;
this.ButtonSave.Click += new System.EventHandler(this.ButtonSave_Click); ButtonSave.Click += ButtonSave_Click;
// //
// FormAtelierRestocking // FormAtelierRestocking
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(448, 221); ClientSize = new Size(448, 221);
this.Controls.Add(this.ButtonCancel); Controls.Add(ButtonCancel);
this.Controls.Add(this.ButtonSave); Controls.Add(ButtonSave);
this.Controls.Add(this.quantityTextBox); Controls.Add(quantityTextBox);
this.Controls.Add(this.quantityLabel); Controls.Add(quantityLabel);
this.Controls.Add(this.dressComboBox); Controls.Add(dressComboBox);
this.Controls.Add(this.dressLabel); Controls.Add(dressLabel);
this.Controls.Add(this.atelierComboBox); Controls.Add(atelierComboBox);
this.Controls.Add(this.atelierLabel); Controls.Add(atelierLabel);
this.Name = "FormAtelierRestocking"; Name = "FormAtelierRestocking";
this.Text = "FormAtelierRestocking"; Text = "Atelier restocking";
this.Load += new System.EventHandler(this.FormAtelierRestocking_Load); Load += FormAtelierRestocking_Load;
this.ResumeLayout(false); ResumeLayout(false);
this.PerformLayout(); PerformLayout();
} }
#endregion #endregion

View File

@ -25,7 +25,7 @@ namespace SewingDresses
private Dictionary<int, (IDressModel, int)> _dressesList; private Dictionary<int, (IDressModel, int)> _dressesList;
public int ID { set { _id = value; } } public int ID { set { _id = value; } }
public FormAtelierRestocking(ILogger<FormAtelierRestocking> logger, IAtelierLogic logicA,IDressLogic logicD) public FormAtelierRestocking(ILogger<FormAtelierRestocking> logger, IAtelierLogic logicA, IDressLogic logicD)
{ {
InitializeComponent(); InitializeComponent();
_logicAtelier = logicA; _logicAtelier = logicA;
@ -120,7 +120,7 @@ namespace SewingDresses
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Restrocking of atelier error"); _logger.LogError(ex, "Restocking of atelier error");
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }

View File

@ -28,80 +28,79 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.atelierGridView = new System.Windows.Forms.DataGridView(); atelierGridView = new DataGridView();
this.ButtonDelete = new System.Windows.Forms.Button(); ButtonDelete = new Button();
this.ButtonChange = new System.Windows.Forms.Button(); ButtonChange = new Button();
this.ButtonAdd = new System.Windows.Forms.Button(); ButtonAdd = new Button();
this.buttonCheckDresses = new System.Windows.Forms.Button(); buttonCheckDresses = new Button();
((System.ComponentModel.ISupportInitialize)(this.atelierGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)atelierGridView).BeginInit();
this.SuspendLayout(); SuspendLayout();
// //
// atelierGridView // atelierGridView
// //
this.atelierGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight; atelierGridView.BackgroundColor = SystemColors.ControlLightLight;
this.atelierGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; atelierGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.atelierGridView.Location = new System.Drawing.Point(1, 2); atelierGridView.Location = new Point(1, 2);
this.atelierGridView.Name = "atelierGridView"; atelierGridView.Name = "atelierGridView";
this.atelierGridView.RowTemplate.Height = 25; atelierGridView.RowTemplate.Height = 25;
this.atelierGridView.Size = new System.Drawing.Size(598, 447); atelierGridView.Size = new Size(598, 447);
this.atelierGridView.TabIndex = 0; atelierGridView.TabIndex = 0;
// //
// ButtonDelete // ButtonDelete
// //
this.ButtonDelete.Location = new System.Drawing.Point(652, 148); ButtonDelete.Location = new Point(652, 148);
this.ButtonDelete.Name = "ButtonDelete"; ButtonDelete.Name = "ButtonDelete";
this.ButtonDelete.Size = new System.Drawing.Size(92, 35); ButtonDelete.Size = new Size(92, 35);
this.ButtonDelete.TabIndex = 6; ButtonDelete.TabIndex = 6;
this.ButtonDelete.Text = "Delete"; ButtonDelete.Text = "Delete";
this.ButtonDelete.UseVisualStyleBackColor = true; ButtonDelete.UseVisualStyleBackColor = true;
this.ButtonDelete.Click += new System.EventHandler(this.ButtonDelete_Click); ButtonDelete.Click += ButtonDelete_Click;
// //
// ButtonChange // ButtonChange
// //
this.ButtonChange.Location = new System.Drawing.Point(652, 91); ButtonChange.Location = new Point(652, 91);
this.ButtonChange.Name = "ButtonChange"; ButtonChange.Name = "ButtonChange";
this.ButtonChange.Size = new System.Drawing.Size(92, 35); ButtonChange.Size = new Size(92, 35);
this.ButtonChange.TabIndex = 5; ButtonChange.TabIndex = 5;
this.ButtonChange.Text = "Change"; ButtonChange.Text = "Change";
this.ButtonChange.UseVisualStyleBackColor = true; ButtonChange.UseVisualStyleBackColor = true;
this.ButtonChange.Click += new System.EventHandler(this.ButtonChange_Click); ButtonChange.Click += ButtonChange_Click;
// //
// ButtonAdd // ButtonAdd
// //
this.ButtonAdd.Location = new System.Drawing.Point(652, 36); ButtonAdd.Location = new Point(652, 36);
this.ButtonAdd.Name = "ButtonAdd"; ButtonAdd.Name = "ButtonAdd";
this.ButtonAdd.Size = new System.Drawing.Size(92, 35); ButtonAdd.Size = new Size(92, 35);
this.ButtonAdd.TabIndex = 4; ButtonAdd.TabIndex = 4;
this.ButtonAdd.Text = "Add"; ButtonAdd.Text = "Add";
this.ButtonAdd.UseVisualStyleBackColor = true; ButtonAdd.UseVisualStyleBackColor = true;
this.ButtonAdd.Click += new System.EventHandler(this.ButtonAdd_Click); ButtonAdd.Click += ButtonAdd_Click;
// //
// buttonCheckDresses // buttonCheckDresses
// //
this.buttonCheckDresses.Location = new System.Drawing.Point(652, 210); buttonCheckDresses.Location = new Point(652, 210);
this.buttonCheckDresses.Name = "buttonCheckDresses"; buttonCheckDresses.Name = "buttonCheckDresses";
this.buttonCheckDresses.Size = new System.Drawing.Size(92, 35); buttonCheckDresses.Size = new Size(92, 35);
this.buttonCheckDresses.TabIndex = 7; buttonCheckDresses.TabIndex = 7;
this.buttonCheckDresses.Text = "Dresses"; buttonCheckDresses.Text = "Dresses";
this.buttonCheckDresses.UseVisualStyleBackColor = true; buttonCheckDresses.UseVisualStyleBackColor = true;
this.buttonCheckDresses.Click += new System.EventHandler(this.buttonCheckDresses_Click); buttonCheckDresses.Click += buttonCheckDresses_Click;
// //
// FormAteliers // FormAteliers
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); ClientSize = new Size(800, 450);
this.Controls.Add(this.buttonCheckDresses); Controls.Add(buttonCheckDresses);
this.Controls.Add(this.ButtonDelete); Controls.Add(ButtonDelete);
this.Controls.Add(this.ButtonChange); Controls.Add(ButtonChange);
this.Controls.Add(this.ButtonAdd); Controls.Add(ButtonAdd);
this.Controls.Add(this.atelierGridView); Controls.Add(atelierGridView);
this.Name = "FormAteliers"; Name = "FormAteliers";
this.Text = "FormAteliers"; Text = "Ateliers";
this.Load += new System.EventHandler(this.FormAteliers_Load); Load += FormAteliers_Load;
((System.ComponentModel.ISupportInitialize)(this.atelierGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)atelierGridView).EndInit();
this.ResumeLayout(false); ResumeLayout(false);
} }
#endregion #endregion

View File

@ -43,7 +43,7 @@ namespace SewingDresses
} }
_logger.LogInformation("Loading atelier"); _logger.LogInformation("Loading atelier");
} }
catch(Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error loading atelier"); _logger.LogError(ex, "Error loading atelier");
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

View File

@ -28,82 +28,78 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.atelierComboBox = new System.Windows.Forms.ComboBox(); atelierComboBox = new ComboBox();
this.atelierLabel = new System.Windows.Forms.Label(); atelierLabel = new Label();
this.dressesGridView = new System.Windows.Forms.DataGridView(); dressesGridView = new DataGridView();
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); ID = new DataGridViewTextBoxColumn();
this.DressName = new System.Windows.Forms.DataGridViewTextBoxColumn(); DressName = new DataGridViewTextBoxColumn();
this.Quantity = new System.Windows.Forms.DataGridViewTextBoxColumn(); Quantity = new DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dressesGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)dressesGridView).BeginInit();
this.SuspendLayout(); SuspendLayout();
// //
// atelierComboBox // atelierComboBox
// //
this.atelierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; atelierComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.atelierComboBox.FormattingEnabled = true; atelierComboBox.FormattingEnabled = true;
this.atelierComboBox.Location = new System.Drawing.Point(106, 12); atelierComboBox.Location = new Point(106, 12);
this.atelierComboBox.Name = "atelierComboBox"; atelierComboBox.Name = "atelierComboBox";
this.atelierComboBox.Size = new System.Drawing.Size(293, 23); atelierComboBox.Size = new Size(293, 23);
this.atelierComboBox.TabIndex = 5; atelierComboBox.TabIndex = 5;
this.atelierComboBox.SelectedIndexChanged += new System.EventHandler(this.atelierComboBox_SelectedIndexChanged); atelierComboBox.SelectedIndexChanged += atelierComboBox_SelectedIndexChanged;
// //
// atelierLabel // atelierLabel
// //
this.atelierLabel.AutoSize = true; atelierLabel.AutoSize = true;
this.atelierLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); atelierLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.atelierLabel.Location = new System.Drawing.Point(4, 9); atelierLabel.Location = new Point(4, 9);
this.atelierLabel.Name = "atelierLabel"; atelierLabel.Name = "atelierLabel";
this.atelierLabel.Size = new System.Drawing.Size(71, 25); atelierLabel.Size = new Size(71, 25);
this.atelierLabel.TabIndex = 4; atelierLabel.TabIndex = 4;
this.atelierLabel.Text = "Atelier:"; atelierLabel.Text = "Atelier:";
// //
// dressesGridView // dressesGridView
// //
this.dressesGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight; dressesGridView.BackgroundColor = SystemColors.ControlLightLight;
this.dressesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dressesGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dressesGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { dressesGridView.Columns.AddRange(new DataGridViewColumn[] { ID, DressName, Quantity });
this.ID, dressesGridView.Location = new Point(4, 51);
this.DressName, dressesGridView.Name = "dressesGridView";
this.Quantity}); dressesGridView.RowTemplate.Height = 25;
this.dressesGridView.Location = new System.Drawing.Point(4, 51); dressesGridView.Size = new Size(404, 261);
this.dressesGridView.Name = "dressesGridView"; dressesGridView.TabIndex = 6;
this.dressesGridView.RowTemplate.Height = 25;
this.dressesGridView.Size = new System.Drawing.Size(404, 261);
this.dressesGridView.TabIndex = 6;
// //
// ID // ID
// //
this.ID.HeaderText = "ID"; ID.HeaderText = "ID";
this.ID.Name = "ID"; ID.Name = "ID";
this.ID.Visible = false; ID.Visible = false;
// //
// DressName // DressName
// //
this.DressName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; DressName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
this.DressName.HeaderText = "DressName"; DressName.HeaderText = "DressName";
this.DressName.Name = "DressName"; DressName.Name = "DressName";
// //
// Quantity // Quantity
// //
this.Quantity.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; Quantity.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
this.Quantity.HeaderText = "Quantity"; Quantity.HeaderText = "Quantity";
this.Quantity.Name = "Quantity"; Quantity.Name = "Quantity";
// //
// FormCheckDresses // FormCheckDresses
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(411, 314); ClientSize = new Size(411, 314);
this.Controls.Add(this.dressesGridView); Controls.Add(dressesGridView);
this.Controls.Add(this.atelierComboBox); Controls.Add(atelierComboBox);
this.Controls.Add(this.atelierLabel); Controls.Add(atelierLabel);
this.Name = "FormCheckDresses"; Name = "FormCheckDresses";
this.Text = "FormCheckDresses"; Text = "Check dresses";
this.Load += new System.EventHandler(this.FormCheckDresses_Load); Load += FormCheckDresses_Load;
((System.ComponentModel.ISupportInitialize)(this.dressesGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)dressesGridView).EndInit();
this.ResumeLayout(false); ResumeLayout(false);
this.PerformLayout(); PerformLayout();
} }
#endregion #endregion

View File

@ -28,185 +28,181 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.nameDressLabel = new System.Windows.Forms.Label(); nameDressLabel = new Label();
this.priceDressLabel = new System.Windows.Forms.Label(); priceDressLabel = new Label();
this.nameDressTextBox = new System.Windows.Forms.TextBox(); nameDressTextBox = new TextBox();
this.priceDressTextBox = new System.Windows.Forms.TextBox(); priceDressTextBox = new TextBox();
this.materialsGroupBox = new System.Windows.Forms.GroupBox(); materialsGroupBox = new GroupBox();
this.RefreshButton = new System.Windows.Forms.Button(); RefreshButton = new Button();
this.deleteButton = new System.Windows.Forms.Button(); deleteButton = new Button();
this.changeButton = new System.Windows.Forms.Button(); changeButton = new Button();
this.AddButton = new System.Windows.Forms.Button(); AddButton = new Button();
this.dressGridView = new System.Windows.Forms.DataGridView(); dressGridView = new DataGridView();
this.ColumnID = new System.Windows.Forms.DataGridViewTextBoxColumn(); ColumnID = new DataGridViewTextBoxColumn();
this.ColumnMaterial = new System.Windows.Forms.DataGridViewTextBoxColumn(); ColumnMaterial = new DataGridViewTextBoxColumn();
this.ColumnQuantity = new System.Windows.Forms.DataGridViewTextBoxColumn(); ColumnQuantity = new DataGridViewTextBoxColumn();
this.saveButton = new System.Windows.Forms.Button(); saveButton = new Button();
this.cancelButton = new System.Windows.Forms.Button(); cancelButton = new Button();
this.materialsGroupBox.SuspendLayout(); materialsGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)dressGridView).BeginInit();
this.SuspendLayout(); SuspendLayout();
// //
// nameDressLabel // nameDressLabel
// //
this.nameDressLabel.AutoSize = true; nameDressLabel.AutoSize = true;
this.nameDressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); nameDressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.nameDressLabel.Location = new System.Drawing.Point(12, 9); nameDressLabel.Location = new Point(12, 9);
this.nameDressLabel.Name = "nameDressLabel"; nameDressLabel.Name = "nameDressLabel";
this.nameDressLabel.Size = new System.Drawing.Size(66, 25); nameDressLabel.Size = new Size(66, 25);
this.nameDressLabel.TabIndex = 0; nameDressLabel.TabIndex = 0;
this.nameDressLabel.Text = "Name:"; nameDressLabel.Text = "Name:";
// //
// priceDressLabel // priceDressLabel
// //
this.priceDressLabel.AutoSize = true; priceDressLabel.AutoSize = true;
this.priceDressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); priceDressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.priceDressLabel.Location = new System.Drawing.Point(12, 46); priceDressLabel.Location = new Point(12, 46);
this.priceDressLabel.Name = "priceDressLabel"; priceDressLabel.Name = "priceDressLabel";
this.priceDressLabel.Size = new System.Drawing.Size(58, 25); priceDressLabel.Size = new Size(58, 25);
this.priceDressLabel.TabIndex = 1; priceDressLabel.TabIndex = 1;
this.priceDressLabel.Text = "Price:"; priceDressLabel.Text = "Price:";
// //
// nameDressTextBox // nameDressTextBox
// //
this.nameDressTextBox.Location = new System.Drawing.Point(84, 11); nameDressTextBox.Location = new Point(84, 11);
this.nameDressTextBox.Name = "nameDressTextBox"; nameDressTextBox.Name = "nameDressTextBox";
this.nameDressTextBox.Size = new System.Drawing.Size(287, 23); nameDressTextBox.Size = new Size(287, 23);
this.nameDressTextBox.TabIndex = 2; nameDressTextBox.TabIndex = 2;
// //
// priceDressTextBox // priceDressTextBox
// //
this.priceDressTextBox.Location = new System.Drawing.Point(84, 48); priceDressTextBox.Location = new Point(84, 48);
this.priceDressTextBox.Name = "priceDressTextBox"; priceDressTextBox.Name = "priceDressTextBox";
this.priceDressTextBox.ReadOnly = true; priceDressTextBox.ReadOnly = true;
this.priceDressTextBox.Size = new System.Drawing.Size(178, 23); priceDressTextBox.Size = new Size(178, 23);
this.priceDressTextBox.TabIndex = 3; priceDressTextBox.TabIndex = 3;
// //
// materialsGroupBox // materialsGroupBox
// //
this.materialsGroupBox.Controls.Add(this.RefreshButton); materialsGroupBox.Controls.Add(RefreshButton);
this.materialsGroupBox.Controls.Add(this.deleteButton); materialsGroupBox.Controls.Add(deleteButton);
this.materialsGroupBox.Controls.Add(this.changeButton); materialsGroupBox.Controls.Add(changeButton);
this.materialsGroupBox.Controls.Add(this.AddButton); materialsGroupBox.Controls.Add(AddButton);
this.materialsGroupBox.Controls.Add(this.dressGridView); materialsGroupBox.Controls.Add(dressGridView);
this.materialsGroupBox.Location = new System.Drawing.Point(16, 89); materialsGroupBox.Location = new Point(16, 89);
this.materialsGroupBox.Name = "materialsGroupBox"; materialsGroupBox.Name = "materialsGroupBox";
this.materialsGroupBox.Size = new System.Drawing.Size(770, 301); materialsGroupBox.Size = new Size(770, 301);
this.materialsGroupBox.TabIndex = 4; materialsGroupBox.TabIndex = 4;
this.materialsGroupBox.TabStop = false; materialsGroupBox.TabStop = false;
this.materialsGroupBox.Text = "Materials"; materialsGroupBox.Text = "Materials";
// //
// RefreshButton // RefreshButton
// //
this.RefreshButton.Location = new System.Drawing.Point(638, 225); RefreshButton.Location = new Point(638, 225);
this.RefreshButton.Name = "RefreshButton"; RefreshButton.Name = "RefreshButton";
this.RefreshButton.Size = new System.Drawing.Size(103, 36); RefreshButton.Size = new Size(103, 36);
this.RefreshButton.TabIndex = 4; RefreshButton.TabIndex = 4;
this.RefreshButton.Text = "Refresh"; RefreshButton.Text = "Refresh";
this.RefreshButton.UseVisualStyleBackColor = true; RefreshButton.UseVisualStyleBackColor = true;
this.RefreshButton.Click += new System.EventHandler(this.ButtonRefresh_Click); RefreshButton.Click += ButtonRefresh_Click;
// //
// deleteButton // deleteButton
// //
this.deleteButton.Location = new System.Drawing.Point(638, 168); deleteButton.Location = new Point(638, 168);
this.deleteButton.Name = "deleteButton"; deleteButton.Name = "deleteButton";
this.deleteButton.Size = new System.Drawing.Size(103, 36); deleteButton.Size = new Size(103, 36);
this.deleteButton.TabIndex = 3; deleteButton.TabIndex = 3;
this.deleteButton.Text = "Delete"; deleteButton.Text = "Delete";
this.deleteButton.UseVisualStyleBackColor = true; deleteButton.UseVisualStyleBackColor = true;
this.deleteButton.Click += new System.EventHandler(this.ButtonDelete_Click); deleteButton.Click += ButtonDelete_Click;
// //
// changeButton // changeButton
// //
this.changeButton.Location = new System.Drawing.Point(638, 110); changeButton.Location = new Point(638, 110);
this.changeButton.Name = "changeButton"; changeButton.Name = "changeButton";
this.changeButton.Size = new System.Drawing.Size(103, 36); changeButton.Size = new Size(103, 36);
this.changeButton.TabIndex = 2; changeButton.TabIndex = 2;
this.changeButton.Text = "Change"; changeButton.Text = "Change";
this.changeButton.UseVisualStyleBackColor = true; changeButton.UseVisualStyleBackColor = true;
this.changeButton.Click += new System.EventHandler(this.ButtonUpdate_Click); changeButton.Click += ButtonUpdate_Click;
// //
// AddButton // AddButton
// //
this.AddButton.Location = new System.Drawing.Point(638, 56); AddButton.Location = new Point(638, 56);
this.AddButton.Name = "AddButton"; AddButton.Name = "AddButton";
this.AddButton.Size = new System.Drawing.Size(103, 36); AddButton.Size = new Size(103, 36);
this.AddButton.TabIndex = 1; AddButton.TabIndex = 1;
this.AddButton.Text = "Add"; AddButton.Text = "Add";
this.AddButton.UseVisualStyleBackColor = true; AddButton.UseVisualStyleBackColor = true;
this.AddButton.Click += new System.EventHandler(this.ButtonAdd_Click); AddButton.Click += ButtonAdd_Click;
// //
// dressGridView // dressGridView
// //
this.dressGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dressGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dressGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { dressGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnID, ColumnMaterial, ColumnQuantity });
this.ColumnID, dressGridView.Location = new Point(6, 22);
this.ColumnMaterial, dressGridView.Name = "dressGridView";
this.ColumnQuantity}); dressGridView.RowTemplate.Height = 25;
this.dressGridView.Location = new System.Drawing.Point(6, 22); dressGridView.Size = new Size(588, 273);
this.dressGridView.Name = "dressGridView"; dressGridView.TabIndex = 0;
this.dressGridView.RowTemplate.Height = 25;
this.dressGridView.Size = new System.Drawing.Size(588, 273);
this.dressGridView.TabIndex = 0;
// //
// ColumnID // ColumnID
// //
this.ColumnID.HeaderText = "ID"; ColumnID.HeaderText = "ID";
this.ColumnID.Name = "ColumnID"; ColumnID.Name = "ColumnID";
this.ColumnID.Visible = false; ColumnID.Visible = false;
// //
// ColumnMaterial // ColumnMaterial
// //
this.ColumnMaterial.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; ColumnMaterial.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
this.ColumnMaterial.HeaderText = "Material"; ColumnMaterial.HeaderText = "Material";
this.ColumnMaterial.Name = "ColumnMaterial"; ColumnMaterial.Name = "ColumnMaterial";
// //
// ColumnQuantity // ColumnQuantity
// //
this.ColumnQuantity.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; ColumnQuantity.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
this.ColumnQuantity.HeaderText = "Quantity"; ColumnQuantity.HeaderText = "Quantity";
this.ColumnQuantity.Name = "ColumnQuantity"; ColumnQuantity.Name = "ColumnQuantity";
// //
// saveButton // saveButton
// //
this.saveButton.Location = new System.Drawing.Point(562, 407); saveButton.Location = new Point(562, 407);
this.saveButton.Name = "saveButton"; saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(89, 31); saveButton.Size = new Size(89, 31);
this.saveButton.TabIndex = 5; saveButton.TabIndex = 5;
this.saveButton.Text = "Save"; saveButton.Text = "Save";
this.saveButton.UseVisualStyleBackColor = true; saveButton.UseVisualStyleBackColor = true;
this.saveButton.Click += new System.EventHandler(this.ButtonSave_Click); saveButton.Click += ButtonSave_Click;
// //
// cancelButton // cancelButton
// //
this.cancelButton.Location = new System.Drawing.Point(657, 407); cancelButton.Location = new Point(657, 407);
this.cancelButton.Name = "cancelButton"; cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(89, 31); cancelButton.Size = new Size(89, 31);
this.cancelButton.TabIndex = 6; cancelButton.TabIndex = 6;
this.cancelButton.Text = "Cancel"; cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true; cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.ButtonCancel_Click); cancelButton.Click += ButtonCancel_Click;
// //
// FormDress // FormDress
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); ClientSize = new Size(800, 450);
this.Controls.Add(this.cancelButton); Controls.Add(cancelButton);
this.Controls.Add(this.saveButton); Controls.Add(saveButton);
this.Controls.Add(this.materialsGroupBox); Controls.Add(materialsGroupBox);
this.Controls.Add(this.priceDressTextBox); Controls.Add(priceDressTextBox);
this.Controls.Add(this.nameDressTextBox); Controls.Add(nameDressTextBox);
this.Controls.Add(this.priceDressLabel); Controls.Add(priceDressLabel);
this.Controls.Add(this.nameDressLabel); Controls.Add(nameDressLabel);
this.Name = "FormDress"; Name = "FormDress";
this.Text = "FormDress"; Text = "Dress creation";
this.Load += new System.EventHandler(this.FormDress_Load); Load += FormDress_Load;
this.materialsGroupBox.ResumeLayout(false); materialsGroupBox.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)dressGridView).EndInit();
this.ResumeLayout(false); ResumeLayout(false);
this.PerformLayout(); PerformLayout();
} }
#endregion #endregion

View File

@ -28,86 +28,85 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.materialNameLabel = new System.Windows.Forms.Label(); materialNameLabel = new Label();
this.materialQuantityLabel = new System.Windows.Forms.Label(); materialQuantityLabel = new Label();
this.materialComboBox = new System.Windows.Forms.ComboBox(); materialComboBox = new ComboBox();
this.quantityTextBox = new System.Windows.Forms.TextBox(); quantityTextBox = new TextBox();
this.saveButton = new System.Windows.Forms.Button(); saveButton = new Button();
this.cancelButton = new System.Windows.Forms.Button(); cancelButton = new Button();
this.SuspendLayout(); SuspendLayout();
// //
// materialNameLabel // materialNameLabel
// //
this.materialNameLabel.AutoSize = true; materialNameLabel.AutoSize = true;
this.materialNameLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); materialNameLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.materialNameLabel.Location = new System.Drawing.Point(12, 19); materialNameLabel.Location = new Point(12, 19);
this.materialNameLabel.Name = "materialNameLabel"; materialNameLabel.Name = "materialNameLabel";
this.materialNameLabel.Size = new System.Drawing.Size(86, 25); materialNameLabel.Size = new Size(86, 25);
this.materialNameLabel.TabIndex = 0; materialNameLabel.TabIndex = 0;
this.materialNameLabel.Text = "Material:"; materialNameLabel.Text = "Material:";
// //
// materialQuantityLabel // materialQuantityLabel
// //
this.materialQuantityLabel.AutoSize = true; materialQuantityLabel.AutoSize = true;
this.materialQuantityLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); materialQuantityLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.materialQuantityLabel.Location = new System.Drawing.Point(12, 63); materialQuantityLabel.Location = new Point(12, 63);
this.materialQuantityLabel.Name = "materialQuantityLabel"; materialQuantityLabel.Name = "materialQuantityLabel";
this.materialQuantityLabel.Size = new System.Drawing.Size(88, 25); materialQuantityLabel.Size = new Size(88, 25);
this.materialQuantityLabel.TabIndex = 1; materialQuantityLabel.TabIndex = 1;
this.materialQuantityLabel.Text = "Quantity:"; materialQuantityLabel.Text = "Quantity:";
// //
// materialComboBox // materialComboBox
// //
this.materialComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; materialComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.materialComboBox.FormattingEnabled = true; materialComboBox.FormattingEnabled = true;
this.materialComboBox.Location = new System.Drawing.Point(123, 19); materialComboBox.Location = new Point(123, 19);
this.materialComboBox.Name = "materialComboBox"; materialComboBox.Name = "materialComboBox";
this.materialComboBox.Size = new System.Drawing.Size(342, 23); materialComboBox.Size = new Size(342, 23);
this.materialComboBox.TabIndex = 2; materialComboBox.TabIndex = 2;
// //
// quantityTextBox // quantityTextBox
// //
this.quantityTextBox.Location = new System.Drawing.Point(123, 63); quantityTextBox.Location = new Point(123, 63);
this.quantityTextBox.Name = "quantityTextBox"; quantityTextBox.Name = "quantityTextBox";
this.quantityTextBox.Size = new System.Drawing.Size(342, 23); quantityTextBox.Size = new Size(342, 23);
this.quantityTextBox.TabIndex = 3; quantityTextBox.TabIndex = 3;
// //
// saveButton // saveButton
// //
this.saveButton.Location = new System.Drawing.Point(275, 104); saveButton.Location = new Point(275, 104);
this.saveButton.Name = "saveButton"; saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(92, 23); saveButton.Size = new Size(92, 23);
this.saveButton.TabIndex = 4; saveButton.TabIndex = 4;
this.saveButton.Text = "Save"; saveButton.Text = "Save";
this.saveButton.UseVisualStyleBackColor = true; saveButton.UseVisualStyleBackColor = true;
this.saveButton.Click += new System.EventHandler(this.saveButton_Click); saveButton.Click += saveButton_Click;
// //
// cancelButton // cancelButton
// //
this.cancelButton.Location = new System.Drawing.Point(373, 104); cancelButton.Location = new Point(373, 104);
this.cancelButton.Name = "cancelButton"; cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(92, 23); cancelButton.Size = new Size(92, 23);
this.cancelButton.TabIndex = 5; cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel"; cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true; cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); cancelButton.Click += cancelButton_Click;
// //
// FormDressMaterial // FormDressMaterial
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(477, 129); ClientSize = new Size(477, 129);
this.Controls.Add(this.cancelButton); Controls.Add(cancelButton);
this.Controls.Add(this.saveButton); Controls.Add(saveButton);
this.Controls.Add(this.quantityTextBox); Controls.Add(quantityTextBox);
this.Controls.Add(this.materialComboBox); Controls.Add(materialComboBox);
this.Controls.Add(this.materialQuantityLabel); Controls.Add(materialQuantityLabel);
this.Controls.Add(this.materialNameLabel); Controls.Add(materialNameLabel);
this.Name = "FormDressMaterial"; Name = "FormDressMaterial";
this.Text = "FormDressMaterial"; Text = "Dress material";
this.ResumeLayout(false); ResumeLayout(false);
this.PerformLayout(); PerformLayout();
} }
#endregion #endregion

View File

@ -88,7 +88,7 @@ namespace SewingDresses
} }
if (materialComboBox.SelectedValue == null) if (materialComboBox.SelectedValue == null)
{ {
MessageBox.Show("Choose material", "Error",MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Choose material", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;

121
SewingDresses/FormDressSelling.Designer.cs generated Normal file
View File

@ -0,0 +1,121 @@
namespace SewingDresses
{
partial class FormDressSelling
{
/// <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()
{
labelDressName = new Label();
labelQuantity = new Label();
textBoxQuantity = new TextBox();
comboBoxDresses = new ComboBox();
buttonSell = new Button();
buttonCancel = new Button();
SuspendLayout();
//
// labelDressName
//
labelDressName.AutoSize = true;
labelDressName.Font = new Font("Segoe UI Semibold", 14.25F, FontStyle.Bold, GraphicsUnit.Point);
labelDressName.Location = new Point(12, 25);
labelDressName.Name = "labelDressName";
labelDressName.Size = new Size(73, 25);
labelDressName.TabIndex = 0;
labelDressName.Text = "DRESS:";
//
// labelQuantity
//
labelQuantity.AutoSize = true;
labelQuantity.Font = new Font("Segoe UI Semibold", 14.25F, FontStyle.Bold, GraphicsUnit.Point);
labelQuantity.Location = new Point(12, 72);
labelQuantity.Name = "labelQuantity";
labelQuantity.Size = new Size(109, 25);
labelQuantity.TabIndex = 1;
labelQuantity.Text = "QUANTITY:";
//
// textBoxQuantity
//
textBoxQuantity.Location = new Point(127, 72);
textBoxQuantity.Name = "textBoxQuantity";
textBoxQuantity.Size = new Size(100, 23);
textBoxQuantity.TabIndex = 2;
//
// comboBoxDresses
//
comboBoxDresses.FormattingEnabled = true;
comboBoxDresses.Location = new Point(106, 27);
comboBoxDresses.Name = "comboBoxDresses";
comboBoxDresses.Size = new Size(121, 23);
comboBoxDresses.TabIndex = 3;
//
// buttonSell
//
buttonSell.Location = new Point(161, 134);
buttonSell.Name = "buttonSell";
buttonSell.Size = new Size(75, 23);
buttonSell.TabIndex = 4;
buttonSell.Text = "Sell";
buttonSell.UseVisualStyleBackColor = true;
buttonSell.Click += buttonSell_Click;
//
// buttonCancel
//
buttonCancel.Location = new Point(242, 134);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(75, 23);
buttonCancel.TabIndex = 5;
buttonCancel.Text = "Cancel";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += buttonCancel_Click;
//
// FormDressSelling
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(329, 169);
Controls.Add(buttonCancel);
Controls.Add(buttonSell);
Controls.Add(comboBoxDresses);
Controls.Add(textBoxQuantity);
Controls.Add(labelQuantity);
Controls.Add(labelDressName);
Name = "FormDressSelling";
Text = "Dress selling";
Load += FormDressSelling_Load;
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelDressName;
private Label labelQuantity;
private TextBox textBoxQuantity;
private ComboBox comboBoxDresses;
private Button buttonSell;
private Button buttonCancel;
}
}

View File

@ -0,0 +1,81 @@
using DressAtelierContracts.BindingModels;
using DressAtelierContracts.BusinessLogicContracts;
using DressAtelierContracts.SearchModels;
using DressAtelierDataModels.Models;
using Microsoft.Extensions.Logging;
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 SewingDresses
{
public partial class FormDressSelling : Form
{
private readonly IAtelierLogic _logicAtelier;
private readonly IDressLogic _logicDress;
private readonly ILogger _logger;
private Dictionary<int, (IDressModel, int)> _dressesList;
public FormDressSelling(ILogger<FormAtelierRestocking> logger, IDressLogic logicD, IAtelierLogic logicA)
{
InitializeComponent();
_logger = logger;
_logicDress = logicD;
_dressesList = new Dictionary<int, (IDressModel, int)>();
_logicAtelier = logicA;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void buttonSell_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBoxQuantity.Text))
{
MessageBox.Show("Fill quantity field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
DressSearchModel model = new DressSearchModel { ID = Convert.ToInt32(comboBoxDresses.SelectedValue) };
if(!_logicAtelier.SellDress(model, Convert.ToInt32(textBoxQuantity.Text)))
{
MessageBox.Show("There are not enough of specified dresses.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
MessageBox.Show("Dresses were sold.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
Close();
}
private void FormDressSelling_Load(object sender, EventArgs e)
{
_logger.LogInformation("Downloading dresses");
try
{
var _list = _logicDress.ReadList(null);
if (_list != null)
{
comboBoxDresses.DisplayMember = "DressName";
comboBoxDresses.ValueMember = "ID";
comboBoxDresses.DataSource = _list;
comboBoxDresses.SelectedItem = null;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Downloading dresses error");
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -0,0 +1,60 @@
<root>
<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,80 +28,79 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.dressGridView = new System.Windows.Forms.DataGridView(); dressGridView = new DataGridView();
this.ButtonAdd = new System.Windows.Forms.Button(); ButtonAdd = new Button();
this.ButtonChange = new System.Windows.Forms.Button(); ButtonChange = new Button();
this.ButtonDelete = new System.Windows.Forms.Button(); ButtonDelete = new Button();
this.ButtonRefresh = new System.Windows.Forms.Button(); ButtonRefresh = new Button();
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)dressGridView).BeginInit();
this.SuspendLayout(); SuspendLayout();
// //
// dressGridView // dressGridView
// //
this.dressGridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight; dressGridView.BackgroundColor = SystemColors.ButtonHighlight;
this.dressGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dressGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dressGridView.Location = new System.Drawing.Point(2, 2); dressGridView.Location = new Point(2, 2);
this.dressGridView.Name = "dressGridView"; dressGridView.Name = "dressGridView";
this.dressGridView.RowTemplate.Height = 25; dressGridView.RowTemplate.Height = 25;
this.dressGridView.Size = new System.Drawing.Size(605, 447); dressGridView.Size = new Size(605, 447);
this.dressGridView.TabIndex = 0; dressGridView.TabIndex = 0;
// //
// ButtonAdd // ButtonAdd
// //
this.ButtonAdd.Location = new System.Drawing.Point(661, 30); ButtonAdd.Location = new Point(661, 30);
this.ButtonAdd.Name = "ButtonAdd"; ButtonAdd.Name = "ButtonAdd";
this.ButtonAdd.Size = new System.Drawing.Size(92, 35); ButtonAdd.Size = new Size(92, 35);
this.ButtonAdd.TabIndex = 1; ButtonAdd.TabIndex = 1;
this.ButtonAdd.Text = "Add"; ButtonAdd.Text = "Add";
this.ButtonAdd.UseVisualStyleBackColor = true; ButtonAdd.UseVisualStyleBackColor = true;
this.ButtonAdd.Click += new System.EventHandler(this.ButtonAdd_Click); ButtonAdd.Click += ButtonAdd_Click;
// //
// ButtonChange // ButtonChange
// //
this.ButtonChange.Location = new System.Drawing.Point(661, 85); ButtonChange.Location = new Point(661, 85);
this.ButtonChange.Name = "ButtonChange"; ButtonChange.Name = "ButtonChange";
this.ButtonChange.Size = new System.Drawing.Size(92, 35); ButtonChange.Size = new Size(92, 35);
this.ButtonChange.TabIndex = 2; ButtonChange.TabIndex = 2;
this.ButtonChange.Text = "Change"; ButtonChange.Text = "Change";
this.ButtonChange.UseVisualStyleBackColor = true; ButtonChange.UseVisualStyleBackColor = true;
this.ButtonChange.Click += new System.EventHandler(this.ButtonUpdate_Click); ButtonChange.Click += ButtonUpdate_Click;
// //
// ButtonDelete // ButtonDelete
// //
this.ButtonDelete.Location = new System.Drawing.Point(661, 142); ButtonDelete.Location = new Point(661, 142);
this.ButtonDelete.Name = "ButtonDelete"; ButtonDelete.Name = "ButtonDelete";
this.ButtonDelete.Size = new System.Drawing.Size(92, 35); ButtonDelete.Size = new Size(92, 35);
this.ButtonDelete.TabIndex = 3; ButtonDelete.TabIndex = 3;
this.ButtonDelete.Text = "Delete"; ButtonDelete.Text = "Delete";
this.ButtonDelete.UseVisualStyleBackColor = true; ButtonDelete.UseVisualStyleBackColor = true;
this.ButtonDelete.Click += new System.EventHandler(this.ButtonDelete_Click); ButtonDelete.Click += ButtonDelete_Click;
// //
// ButtonRefresh // ButtonRefresh
// //
this.ButtonRefresh.Location = new System.Drawing.Point(661, 204); ButtonRefresh.Location = new Point(661, 204);
this.ButtonRefresh.Name = "ButtonRefresh"; ButtonRefresh.Name = "ButtonRefresh";
this.ButtonRefresh.Size = new System.Drawing.Size(92, 35); ButtonRefresh.Size = new Size(92, 35);
this.ButtonRefresh.TabIndex = 4; ButtonRefresh.TabIndex = 4;
this.ButtonRefresh.Text = "Refresh"; ButtonRefresh.Text = "Refresh";
this.ButtonRefresh.UseVisualStyleBackColor = true; ButtonRefresh.UseVisualStyleBackColor = true;
this.ButtonRefresh.Click += new System.EventHandler(this.ButtonRefresh_Click); ButtonRefresh.Click += ButtonRefresh_Click;
// //
// FormDresses // FormDresses
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); ClientSize = new Size(800, 450);
this.Controls.Add(this.ButtonRefresh); Controls.Add(ButtonRefresh);
this.Controls.Add(this.ButtonDelete); Controls.Add(ButtonDelete);
this.Controls.Add(this.ButtonChange); Controls.Add(ButtonChange);
this.Controls.Add(this.ButtonAdd); Controls.Add(ButtonAdd);
this.Controls.Add(this.dressGridView); Controls.Add(dressGridView);
this.Name = "FormDresses"; Name = "FormDresses";
this.Text = "FormDresses"; Text = "Dresses list";
this.Load += new System.EventHandler(this.FormDresses_Load); Load += FormDresses_Load;
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)dressGridView).EndInit();
this.ResumeLayout(false); ResumeLayout(false);
} }
#endregion #endregion

View File

@ -28,156 +28,163 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.menuStrip = new System.Windows.Forms.MenuStrip(); menuStrip = new MenuStrip();
this.directoriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); directoriesToolStripMenuItem = new ToolStripMenuItem();
this.materialsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); materialsToolStripMenuItem = new ToolStripMenuItem();
this.dressesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); dressesToolStripMenuItem = new ToolStripMenuItem();
this.ateliersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ateliersToolStripMenuItem = new ToolStripMenuItem();
this.dataGridView = new System.Windows.Forms.DataGridView(); dataGridView = new DataGridView();
this.createOrderButton = new System.Windows.Forms.Button(); createOrderButton = new Button();
this.processOrderButton = new System.Windows.Forms.Button(); processOrderButton = new Button();
this.readyOrderButton = new System.Windows.Forms.Button(); readyOrderButton = new Button();
this.givenOrderButton = new System.Windows.Forms.Button(); givenOrderButton = new Button();
this.refreshOrdersButton = new System.Windows.Forms.Button(); refreshOrdersButton = new Button();
this.buttonRestocking = new System.Windows.Forms.Button(); buttonRestocking = new Button();
this.menuStrip.SuspendLayout(); buttonSell = new Button();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); menuStrip.SuspendLayout();
this.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
// //
// menuStrip // menuStrip
// //
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { menuStrip.Items.AddRange(new ToolStripItem[] { directoriesToolStripMenuItem });
this.directoriesToolStripMenuItem}); menuStrip.Location = new Point(0, 0);
this.menuStrip.Location = new System.Drawing.Point(0, 0); menuStrip.Name = "menuStrip";
this.menuStrip.Name = "menuStrip"; menuStrip.Size = new Size(800, 24);
this.menuStrip.Size = new System.Drawing.Size(800, 24); menuStrip.TabIndex = 0;
this.menuStrip.TabIndex = 0; menuStrip.Text = "menuStrip1";
this.menuStrip.Text = "menuStrip1";
// //
// directoriesToolStripMenuItem // directoriesToolStripMenuItem
// //
this.directoriesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { directoriesToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { materialsToolStripMenuItem, dressesToolStripMenuItem, ateliersToolStripMenuItem });
this.materialsToolStripMenuItem, directoriesToolStripMenuItem.Name = "directoriesToolStripMenuItem";
this.dressesToolStripMenuItem, directoriesToolStripMenuItem.Size = new Size(75, 20);
this.ateliersToolStripMenuItem}); directoriesToolStripMenuItem.Text = "Directories";
this.directoriesToolStripMenuItem.Name = "directoriesToolStripMenuItem";
this.directoriesToolStripMenuItem.Size = new System.Drawing.Size(75, 20);
this.directoriesToolStripMenuItem.Text = "Directories";
// //
// materialsToolStripMenuItem // materialsToolStripMenuItem
// //
this.materialsToolStripMenuItem.Name = "materialsToolStripMenuItem"; materialsToolStripMenuItem.Name = "materialsToolStripMenuItem";
this.materialsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); materialsToolStripMenuItem.Size = new Size(122, 22);
this.materialsToolStripMenuItem.Text = "Materials"; materialsToolStripMenuItem.Text = "Materials";
this.materialsToolStripMenuItem.Click += new System.EventHandler(this.materialsToolStripMenuItem_Click); materialsToolStripMenuItem.Click += materialsToolStripMenuItem_Click;
// //
// dressesToolStripMenuItem // dressesToolStripMenuItem
// //
this.dressesToolStripMenuItem.Name = "dressesToolStripMenuItem"; dressesToolStripMenuItem.Name = "dressesToolStripMenuItem";
this.dressesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); dressesToolStripMenuItem.Size = new Size(122, 22);
this.dressesToolStripMenuItem.Text = "Dresses"; dressesToolStripMenuItem.Text = "Dresses";
this.dressesToolStripMenuItem.Click += new System.EventHandler(this.dressesToolStripMenuItem_Click); dressesToolStripMenuItem.Click += dressesToolStripMenuItem_Click;
// //
// ateliersToolStripMenuItem // ateliersToolStripMenuItem
// //
this.ateliersToolStripMenuItem.Name = "ateliersToolStripMenuItem"; ateliersToolStripMenuItem.Name = "ateliersToolStripMenuItem";
this.ateliersToolStripMenuItem.Size = new System.Drawing.Size(180, 22); ateliersToolStripMenuItem.Size = new Size(122, 22);
this.ateliersToolStripMenuItem.Text = "Ateliers"; ateliersToolStripMenuItem.Text = "Ateliers";
this.ateliersToolStripMenuItem.Click += new System.EventHandler(this.ateliersToolStripMenuItem_Click); ateliersToolStripMenuItem.Click += ateliersToolStripMenuItem_Click;
// //
// dataGridView // dataGridView
// //
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight; dataGridView.BackgroundColor = SystemColors.ButtonHighlight;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Location = new System.Drawing.Point(2, 27); dataGridView.Location = new Point(2, 27);
this.dataGridView.Name = "dataGridView"; dataGridView.Name = "dataGridView";
this.dataGridView.RowTemplate.Height = 25; dataGridView.RowTemplate.Height = 25;
this.dataGridView.Size = new System.Drawing.Size(631, 420); dataGridView.Size = new Size(631, 420);
this.dataGridView.TabIndex = 1; dataGridView.TabIndex = 1;
// //
// createOrderButton // createOrderButton
// //
this.createOrderButton.Location = new System.Drawing.Point(652, 89); createOrderButton.Location = new Point(652, 40);
this.createOrderButton.Name = "createOrderButton"; createOrderButton.Name = "createOrderButton";
this.createOrderButton.Size = new System.Drawing.Size(117, 34); createOrderButton.Size = new Size(117, 34);
this.createOrderButton.TabIndex = 2; createOrderButton.TabIndex = 2;
this.createOrderButton.Text = "Create order"; createOrderButton.Text = "Create order";
this.createOrderButton.UseVisualStyleBackColor = true; createOrderButton.UseVisualStyleBackColor = true;
this.createOrderButton.Click += new System.EventHandler(this.ButtonCreateOrder_Click); createOrderButton.Click += ButtonCreateOrder_Click;
// //
// processOrderButton // processOrderButton
// //
this.processOrderButton.Location = new System.Drawing.Point(652, 145); processOrderButton.Location = new Point(652, 96);
this.processOrderButton.Name = "processOrderButton"; processOrderButton.Name = "processOrderButton";
this.processOrderButton.Size = new System.Drawing.Size(117, 34); processOrderButton.Size = new Size(117, 34);
this.processOrderButton.TabIndex = 3; processOrderButton.TabIndex = 3;
this.processOrderButton.Text = "Order\'s in process"; processOrderButton.Text = "Order's in process";
this.processOrderButton.UseVisualStyleBackColor = true; processOrderButton.UseVisualStyleBackColor = true;
this.processOrderButton.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click); processOrderButton.Click += ButtonTakeOrderInWork_Click;
// //
// readyOrderButton // readyOrderButton
// //
this.readyOrderButton.Location = new System.Drawing.Point(652, 203); readyOrderButton.Location = new Point(652, 154);
this.readyOrderButton.Name = "readyOrderButton"; readyOrderButton.Name = "readyOrderButton";
this.readyOrderButton.Size = new System.Drawing.Size(117, 34); readyOrderButton.Size = new Size(117, 34);
this.readyOrderButton.TabIndex = 4; readyOrderButton.TabIndex = 4;
this.readyOrderButton.Text = "Order\'s ready"; readyOrderButton.Text = "Order's ready";
this.readyOrderButton.UseVisualStyleBackColor = true; readyOrderButton.UseVisualStyleBackColor = true;
this.readyOrderButton.Click += new System.EventHandler(this.ButtonOrderReady_Click); readyOrderButton.Click += ButtonOrderReady_Click;
// //
// givenOrderButton // givenOrderButton
// //
this.givenOrderButton.Location = new System.Drawing.Point(652, 259); givenOrderButton.Location = new Point(652, 210);
this.givenOrderButton.Name = "givenOrderButton"; givenOrderButton.Name = "givenOrderButton";
this.givenOrderButton.Size = new System.Drawing.Size(117, 34); givenOrderButton.Size = new Size(117, 34);
this.givenOrderButton.TabIndex = 5; givenOrderButton.TabIndex = 5;
this.givenOrderButton.Text = "Order\'s given"; givenOrderButton.Text = "Order's given";
this.givenOrderButton.UseVisualStyleBackColor = true; givenOrderButton.UseVisualStyleBackColor = true;
this.givenOrderButton.Click += new System.EventHandler(this.ButtonIssuedOrder_Click); givenOrderButton.Click += ButtonIssuedOrder_Click;
// //
// refreshOrdersButton // refreshOrdersButton
// //
this.refreshOrdersButton.Location = new System.Drawing.Point(652, 321); refreshOrdersButton.Location = new Point(652, 272);
this.refreshOrdersButton.Name = "refreshOrdersButton"; refreshOrdersButton.Name = "refreshOrdersButton";
this.refreshOrdersButton.Size = new System.Drawing.Size(117, 34); refreshOrdersButton.Size = new Size(117, 34);
this.refreshOrdersButton.TabIndex = 6; refreshOrdersButton.TabIndex = 6;
this.refreshOrdersButton.Text = "Refresh list"; refreshOrdersButton.Text = "Refresh list";
this.refreshOrdersButton.UseVisualStyleBackColor = true; refreshOrdersButton.UseVisualStyleBackColor = true;
this.refreshOrdersButton.Click += new System.EventHandler(this.ButtonRef_Click); refreshOrdersButton.Click += ButtonRef_Click;
// //
// buttonRestocking // buttonRestocking
// //
this.buttonRestocking.Location = new System.Drawing.Point(652, 404); buttonRestocking.Location = new Point(652, 404);
this.buttonRestocking.Name = "buttonRestocking"; buttonRestocking.Name = "buttonRestocking";
this.buttonRestocking.Size = new System.Drawing.Size(117, 34); buttonRestocking.Size = new Size(117, 34);
this.buttonRestocking.TabIndex = 7; buttonRestocking.TabIndex = 7;
this.buttonRestocking.Text = "Store restocking"; buttonRestocking.Text = "Store restocking";
this.buttonRestocking.UseVisualStyleBackColor = true; buttonRestocking.UseVisualStyleBackColor = true;
this.buttonRestocking.Click += new System.EventHandler(this.buttonRestocking_Click); buttonRestocking.Click += buttonRestocking_Click;
//
// buttonSell
//
buttonSell.Location = new Point(652, 364);
buttonSell.Name = "buttonSell";
buttonSell.Size = new Size(117, 34);
buttonSell.TabIndex = 8;
buttonSell.Text = "Selling dresses";
buttonSell.UseVisualStyleBackColor = true;
buttonSell.Click += buttonSell_Click;
// //
// FormMain // FormMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); ClientSize = new Size(800, 450);
this.Controls.Add(this.buttonRestocking); Controls.Add(buttonSell);
this.Controls.Add(this.refreshOrdersButton); Controls.Add(buttonRestocking);
this.Controls.Add(this.givenOrderButton); Controls.Add(refreshOrdersButton);
this.Controls.Add(this.readyOrderButton); Controls.Add(givenOrderButton);
this.Controls.Add(this.processOrderButton); Controls.Add(readyOrderButton);
this.Controls.Add(this.createOrderButton); Controls.Add(processOrderButton);
this.Controls.Add(this.dataGridView); Controls.Add(createOrderButton);
this.Controls.Add(this.menuStrip); Controls.Add(dataGridView);
this.MainMenuStrip = this.menuStrip; Controls.Add(menuStrip);
this.Name = "FormMain"; MainMenuStrip = menuStrip;
this.Text = "FormMain"; Name = "FormMain";
this.Load += new System.EventHandler(this.FormMain_Load); Text = "Order menu";
this.menuStrip.ResumeLayout(false); Load += FormMain_Load;
this.menuStrip.PerformLayout(); menuStrip.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); menuStrip.PerformLayout();
this.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
this.PerformLayout(); ResumeLayout(false);
PerformLayout();
} }
#endregion #endregion
@ -194,5 +201,6 @@
private ToolStripMenuItem dressesToolStripMenuItem; private ToolStripMenuItem dressesToolStripMenuItem;
private ToolStripMenuItem ateliersToolStripMenuItem; private ToolStripMenuItem ateliersToolStripMenuItem;
private Button buttonRestocking; private Button buttonRestocking;
private Button buttonSell;
} }
} }

View File

@ -172,7 +172,7 @@ namespace SewingDresses
if (dataGridView.SelectedRows.Count == 1) if (dataGridView.SelectedRows.Count == 1)
{ {
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["DressID"].Value); int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["DressID"].Value);
_logger.LogInformation("Order №{id}. Changing status to 'Given'",id); _logger.LogInformation("Order №{id}. Changing status to 'Given'", id);
try try
{ {
var operationResult = _orderLogic.GivenOrder(new OrderBindingModel var operationResult = _orderLogic.GivenOrder(new OrderBindingModel
@ -192,6 +192,12 @@ namespace SewingDresses
_logger.LogInformation("Order №{id} is given", id); _logger.LogInformation("Order №{id} is given", id);
LoadData(); LoadData();
} }
catch (OverflowException ex)
{
_logger.LogError(ex, "Error in giving 'Is given' status to order");
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error in giving 'Is given' status to order"); _logger.LogError(ex, "Error in giving 'Is given' status to order");
@ -205,6 +211,13 @@ namespace SewingDresses
LoadData(); LoadData();
} }
private void buttonSell_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormDressSelling));
if (service is FormDressSelling form)
{
form.ShowDialog();
}
}
} }
} }

View File

@ -28,111 +28,110 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.dressLabel = new System.Windows.Forms.Label(); dressLabel = new Label();
this.quantityLabel = new System.Windows.Forms.Label(); quantityLabel = new Label();
this.priceLabel = new System.Windows.Forms.Label(); priceLabel = new Label();
this.dressComboBox = new System.Windows.Forms.ComboBox(); dressComboBox = new ComboBox();
this.quantityTextBox = new System.Windows.Forms.TextBox(); quantityTextBox = new TextBox();
this.priceTextBox = new System.Windows.Forms.TextBox(); priceTextBox = new TextBox();
this.ButtonSave = new System.Windows.Forms.Button(); ButtonSave = new Button();
this.ButtonCancel = new System.Windows.Forms.Button(); ButtonCancel = new Button();
this.SuspendLayout(); SuspendLayout();
// //
// dressLabel // dressLabel
// //
this.dressLabel.AutoSize = true; dressLabel.AutoSize = true;
this.dressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); dressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.dressLabel.Location = new System.Drawing.Point(12, 9); dressLabel.Location = new Point(12, 9);
this.dressLabel.Name = "dressLabel"; dressLabel.Name = "dressLabel";
this.dressLabel.Size = new System.Drawing.Size(82, 25); dressLabel.Size = new Size(82, 25);
this.dressLabel.TabIndex = 0; dressLabel.TabIndex = 0;
this.dressLabel.Text = "Product:"; dressLabel.Text = "Product:";
// //
// quantityLabel // quantityLabel
// //
this.quantityLabel.AutoSize = true; quantityLabel.AutoSize = true;
this.quantityLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); quantityLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.quantityLabel.Location = new System.Drawing.Point(12, 50); quantityLabel.Location = new Point(12, 50);
this.quantityLabel.Name = "quantityLabel"; quantityLabel.Name = "quantityLabel";
this.quantityLabel.Size = new System.Drawing.Size(88, 25); quantityLabel.Size = new Size(88, 25);
this.quantityLabel.TabIndex = 1; quantityLabel.TabIndex = 1;
this.quantityLabel.Text = "Quantity:"; quantityLabel.Text = "Quantity:";
// //
// priceLabel // priceLabel
// //
this.priceLabel.AutoSize = true; priceLabel.AutoSize = true;
this.priceLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); priceLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
this.priceLabel.Location = new System.Drawing.Point(12, 90); priceLabel.Location = new Point(12, 90);
this.priceLabel.Name = "priceLabel"; priceLabel.Name = "priceLabel";
this.priceLabel.Size = new System.Drawing.Size(56, 25); priceLabel.Size = new Size(56, 25);
this.priceLabel.TabIndex = 2; priceLabel.TabIndex = 2;
this.priceLabel.Text = "Total:"; priceLabel.Text = "Total:";
// //
// dressComboBox // dressComboBox
// //
this.dressComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; dressComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.dressComboBox.FormattingEnabled = true; dressComboBox.FormattingEnabled = true;
this.dressComboBox.Location = new System.Drawing.Point(114, 12); dressComboBox.Location = new Point(114, 12);
this.dressComboBox.Name = "dressComboBox"; dressComboBox.Name = "dressComboBox";
this.dressComboBox.Size = new System.Drawing.Size(320, 23); dressComboBox.Size = new Size(320, 23);
this.dressComboBox.TabIndex = 3; dressComboBox.TabIndex = 3;
this.dressComboBox.SelectedIndexChanged += new System.EventHandler(this.DressComboBox_SelectedIndexChanged); dressComboBox.SelectedIndexChanged += DressComboBox_SelectedIndexChanged;
// //
// quantityTextBox // quantityTextBox
// //
this.quantityTextBox.Location = new System.Drawing.Point(114, 52); quantityTextBox.Location = new Point(114, 52);
this.quantityTextBox.Name = "quantityTextBox"; quantityTextBox.Name = "quantityTextBox";
this.quantityTextBox.Size = new System.Drawing.Size(320, 23); quantityTextBox.Size = new Size(320, 23);
this.quantityTextBox.TabIndex = 4; quantityTextBox.TabIndex = 4;
this.quantityTextBox.TextChanged += new System.EventHandler(this.QuantityTextBox_TextChanged); quantityTextBox.TextChanged += QuantityTextBox_TextChanged;
// //
// priceTextBox // priceTextBox
// //
this.priceTextBox.Location = new System.Drawing.Point(114, 90); priceTextBox.Location = new Point(114, 90);
this.priceTextBox.Name = "priceTextBox"; priceTextBox.Name = "priceTextBox";
this.priceTextBox.ReadOnly = true; priceTextBox.ReadOnly = true;
this.priceTextBox.Size = new System.Drawing.Size(320, 23); priceTextBox.Size = new Size(320, 23);
this.priceTextBox.TabIndex = 5; priceTextBox.TabIndex = 5;
// //
// ButtonSave // ButtonSave
// //
this.ButtonSave.Location = new System.Drawing.Point(220, 138); ButtonSave.Location = new Point(220, 138);
this.ButtonSave.Name = "ButtonSave"; ButtonSave.Name = "ButtonSave";
this.ButtonSave.Size = new System.Drawing.Size(100, 32); ButtonSave.Size = new Size(100, 32);
this.ButtonSave.TabIndex = 6; ButtonSave.TabIndex = 6;
this.ButtonSave.Text = "Save"; ButtonSave.Text = "Save";
this.ButtonSave.UseVisualStyleBackColor = true; ButtonSave.UseVisualStyleBackColor = true;
this.ButtonSave.Click += new System.EventHandler(this.ButtonSave_Click); ButtonSave.Click += ButtonSave_Click;
// //
// ButtonCancel // ButtonCancel
// //
this.ButtonCancel.Location = new System.Drawing.Point(334, 138); ButtonCancel.Location = new Point(334, 138);
this.ButtonCancel.Name = "ButtonCancel"; ButtonCancel.Name = "ButtonCancel";
this.ButtonCancel.Size = new System.Drawing.Size(100, 32); ButtonCancel.Size = new Size(100, 32);
this.ButtonCancel.TabIndex = 7; ButtonCancel.TabIndex = 7;
this.ButtonCancel.Text = "Cancel"; ButtonCancel.Text = "Cancel";
this.ButtonCancel.UseVisualStyleBackColor = true; ButtonCancel.UseVisualStyleBackColor = true;
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); ButtonCancel.Click += ButtonCancel_Click;
// //
// FormOrderCreation // FormOrderCreation
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(446, 181); ClientSize = new Size(446, 181);
this.Controls.Add(this.ButtonCancel); Controls.Add(ButtonCancel);
this.Controls.Add(this.ButtonSave); Controls.Add(ButtonSave);
this.Controls.Add(this.priceTextBox); Controls.Add(priceTextBox);
this.Controls.Add(this.quantityTextBox); Controls.Add(quantityTextBox);
this.Controls.Add(this.dressComboBox); Controls.Add(dressComboBox);
this.Controls.Add(this.priceLabel); Controls.Add(priceLabel);
this.Controls.Add(this.quantityLabel); Controls.Add(quantityLabel);
this.Controls.Add(this.dressLabel); Controls.Add(dressLabel);
this.Name = "FormOrderCreation"; Name = "FormOrderCreation";
this.Text = "FormOrderCreation"; Text = "Order creation";
this.Load += new System.EventHandler(this.FormOrderCreation_Load); Load += FormOrderCreation_Load;
this.ResumeLayout(false); ResumeLayout(false);
this.PerformLayout(); PerformLayout();
} }
#endregion #endregion

View File

@ -55,6 +55,7 @@ namespace SewingDresses
services.AddTransient<FormAtelier>(); services.AddTransient<FormAtelier>();
services.AddTransient<FormAteliers>(); services.AddTransient<FormAteliers>();
services.AddTransient<FormAtelierRestocking>(); services.AddTransient<FormAtelierRestocking>();
services.AddTransient<FormDressSelling>();
} }
} }