02Hard is done.
This commit is contained in:
parent
d1891a4b1b
commit
52b4de4084
@ -121,39 +121,64 @@ 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 atelier = _atelierStorage.GetElement(new AtelierSearchModel
|
||||
{
|
||||
ID = atelierModel.ID
|
||||
});
|
||||
|
||||
var dress = _dressStorage.GetElement(new DressSearchModel
|
||||
{
|
||||
ID = dressModel.ID
|
||||
});
|
||||
if(atelier.DressesList.ContainsKey(dress.ID))
|
||||
|
||||
var atelier = _atelierStorage.GetElement(new AtelierSearchModel
|
||||
{
|
||||
atelier.DressesList[dressModel.ID] = (dress, quantity + atelier.DressesList[dressModel.ID].Item2);
|
||||
}
|
||||
else
|
||||
ID = atelierModel.ID
|
||||
});
|
||||
|
||||
if(atelier.CurrentQuantity >= atelier.MaxTotalOfDresses)
|
||||
{
|
||||
atelier.DressesList.Add(dress.ID, (dress, quantity));
|
||||
throw new Exception("Storage overflow");
|
||||
}
|
||||
|
||||
if(!atelier.DressesList.ContainsKey(dress.ID))
|
||||
{
|
||||
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.Address = atelier.Address;
|
||||
atelierModel.DressesList = atelier.DressesList;
|
||||
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");
|
||||
return false;
|
||||
throw new Exception("Something went wrong.");
|
||||
}
|
||||
return (true, quantity);
|
||||
}
|
||||
|
||||
public bool SellDress(DressSearchModel model, int quantity)
|
||||
{
|
||||
if(_atelierStorage.SellDresses(model,quantity))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
|
||||
namespace DressAtelierBusinessLogic.BusinessLogic
|
||||
{
|
||||
@ -18,11 +19,12 @@ namespace DressAtelierBusinessLogic.BusinessLogic
|
||||
private readonly ILogger _logger;
|
||||
|
||||
private readonly IOrderStorage _orderStorage;
|
||||
|
||||
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage)
|
||||
private readonly IAtelierLogic _atelierLogic;
|
||||
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage, IAtelierLogic atelierLogic)
|
||||
{
|
||||
_logger = logger;
|
||||
_orderStorage = orderStorage;
|
||||
_atelierLogic = atelierLogic;
|
||||
}
|
||||
|
||||
public bool CreateOrder(OrderBindingModel model)
|
||||
@ -53,6 +55,35 @@ namespace DressAtelierBusinessLogic.BusinessLogic
|
||||
_logger.LogWarning("Update operation failed");
|
||||
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.DateImplement = DateTime.Now;
|
||||
_orderStorage.Update(model);
|
||||
@ -69,6 +100,7 @@ namespace DressAtelierBusinessLogic.BusinessLogic
|
||||
_logger.LogWarning("Update operation failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
model.Status = OrderStatus.Ready;
|
||||
|
||||
_orderStorage.Update(model);
|
||||
|
@ -20,5 +20,7 @@ namespace DressAtelierContracts.BindingModels
|
||||
public int ID { get; set; }
|
||||
|
||||
public int MaxTotalOfDresses { get; set; }
|
||||
|
||||
public int CurrentQuantity { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,9 +13,10 @@ namespace DressAtelierContracts.BusinessLogicContracts
|
||||
{
|
||||
List<AtelierViewModel>? ReadList(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 Update(AtelierBindingModel model);
|
||||
bool Delete(AtelierBindingModel model);
|
||||
bool SellDress(DressSearchModel model, int quantity);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ namespace DressAtelierContracts.StorageContracts
|
||||
AtelierViewModel? Insert(AtelierBindingModel model);
|
||||
AtelierViewModel? Update(AtelierBindingModel model);
|
||||
AtelierViewModel? Delete(AtelierBindingModel model);
|
||||
AtelierViewModel? CheckDressesQuantity(DressBindingModel model, int quantity);
|
||||
bool SellDresses(DressBindingModel model, int quantity);
|
||||
AtelierViewModel? CheckDressesQuantity(DressSearchModel model, int quantity);
|
||||
bool SellDresses(DressSearchModel model, int quantity);
|
||||
}
|
||||
}
|
||||
|
@ -21,5 +21,6 @@ namespace DressAtelierContracts.ViewModels
|
||||
public Dictionary<int, (IDressModel, int)> DressesList { get; set; } = new();
|
||||
|
||||
public int MaxTotalOfDresses { get; set; }
|
||||
public int CurrentQuantity { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,5 +13,6 @@ namespace DressAtelierDataModels.Models
|
||||
DateTime OpeningDate { get; }
|
||||
Dictionary<int,(IDressModel,int)> DressesList { get; }
|
||||
int MaxTotalOfDresses { get; }
|
||||
int CurrentQuantity { get; }
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
using DressAtelierContracts.SearchModels;
|
||||
using DressAtelierContracts.StorageContracts;
|
||||
using DressAtelierContracts.ViewModels;
|
||||
using DressAtelierDataModels.Models;
|
||||
using DressAtelierFileImplement.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -97,12 +98,12 @@ namespace DressAtelierFileImplement.Implements
|
||||
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 });
|
||||
foreach(var atelier in ateliers)
|
||||
{
|
||||
if (atelier.DressesList[model.ID].Item2 >= quantity)
|
||||
if (atelier.DressesList[model.ID.Value].Item2 >= quantity)
|
||||
{
|
||||
return atelier;
|
||||
}
|
||||
@ -110,10 +111,13 @@ namespace DressAtelierFileImplement.Implements
|
||||
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);
|
||||
|
||||
|
||||
|
||||
if (specatelier == null)
|
||||
{
|
||||
var ateliers = GetFilteredList(new AtelierSearchModel { DressID = model.ID });
|
||||
@ -124,15 +128,26 @@ namespace DressAtelierFileImplement.Implements
|
||||
{
|
||||
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);
|
||||
_source.SaveAteliers();
|
||||
scope.Complete();
|
||||
return true;
|
||||
requiredQuantity -= atelier.DressesList[model.ID.Value].Item2;
|
||||
atelier.DressesList.Remove(model.ID.Value);
|
||||
|
||||
}
|
||||
requiredQuantity -= atelier.DressesList[model.ID].Item2;
|
||||
atelier.DressesList.Remove(model.ID);
|
||||
else
|
||||
{
|
||||
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)
|
||||
@ -140,6 +155,7 @@ namespace DressAtelierFileImplement.Implements
|
||||
throw new Exception("Not enough dresses in ateliers");
|
||||
}
|
||||
_source.SaveAteliers();
|
||||
scope.Complete();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -148,8 +164,18 @@ namespace DressAtelierFileImplement.Implements
|
||||
}
|
||||
}
|
||||
|
||||
specatelier.DressesList.Remove(model.ID);
|
||||
_source.SaveAteliers();
|
||||
qnt = specatelier.DressesList[model.ID.Value];
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -84,12 +84,9 @@ namespace DressAtelierFileImplement.Models
|
||||
{
|
||||
return;
|
||||
}
|
||||
Name = atelier.Name;
|
||||
Address = atelier.Address;
|
||||
CurrentDresses = atelier.DressesList.ToDictionary(x => x.Key, x => x.Value.Item2);
|
||||
DressesList.Clear();
|
||||
OpeningDate = atelier.OpeningDate;
|
||||
MaxTotalOfDresses = atelier.MaxTotalOfDresses;
|
||||
CurrentQuantity = atelier.DressesList.Sum(x => x.Value.Item2);
|
||||
DressesList = Dresses;
|
||||
}
|
||||
|
||||
|
||||
@ -99,15 +96,16 @@ namespace DressAtelierFileImplement.Models
|
||||
Name = Name,
|
||||
Address = Address,
|
||||
OpeningDate = OpeningDate,
|
||||
DressesList = DressesList,
|
||||
MaxTotalOfDresses = MaxTotalOfDresses
|
||||
DressesList = Dresses,
|
||||
MaxTotalOfDresses = MaxTotalOfDresses,
|
||||
CurrentQuantity = CurrentQuantity
|
||||
};
|
||||
|
||||
public XElement GetXElement => new("Atelier", new XAttribute("ID", ID),
|
||||
new XElement("Name", Name),
|
||||
new XElement("Address", Address),
|
||||
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("CurrentDressesQuantity", CurrentQuantity));
|
||||
}
|
||||
|
@ -99,12 +99,12 @@ namespace DressAtelierListImplement.Implements
|
||||
return null;
|
||||
}
|
||||
|
||||
public AtelierViewModel? CheckDressesQuantity(DressBindingModel model, int quantity)
|
||||
public AtelierViewModel? CheckDressesQuantity(DressSearchModel model, int quantity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool SellDresses(DressBindingModel model, int quantity)
|
||||
public bool SellDresses(DressSearchModel model, int quantity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace DressAtelierListImplement.Models
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
public string Address { get; private set; } = string.Empty;
|
||||
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 Dictionary<int, (IDressModel, int)> DressesList { get; private set; } = new Dictionary<int, (IDressModel, int)>();
|
||||
|
||||
@ -33,7 +33,7 @@ namespace DressAtelierListImplement.Models
|
||||
OpeningDate = atelier.OpeningDate,
|
||||
DressesList = atelier.DressesList,
|
||||
MaxTotalOfDresses = atelier.MaxTotalOfDresses,
|
||||
CurrentDressesQuantity = 0
|
||||
CurrentQuantity = 0
|
||||
};
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ namespace DressAtelierListImplement.Models
|
||||
DressesList = atelier.DressesList;
|
||||
OpeningDate = atelier.OpeningDate;
|
||||
MaxTotalOfDresses = atelier.MaxTotalOfDresses;
|
||||
CurrentDressesQuantity = DressesList.Count();
|
||||
CurrentQuantity = atelier.DressesList.Sum(x => x.Value.Item2);
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,9 @@ namespace DressAtelierListImplement.Models
|
||||
Address = Address,
|
||||
OpeningDate = OpeningDate,
|
||||
DressesList = DressesList,
|
||||
MaxTotalOfDresses = MaxTotalOfDresses
|
||||
MaxTotalOfDresses = MaxTotalOfDresses,
|
||||
CurrentQuantity = CurrentQuantity
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
2
SewingDresses/FormAtelier.Designer.cs
generated
2
SewingDresses/FormAtelier.Designer.cs
generated
@ -123,7 +123,7 @@
|
||||
Controls.Add(atelierAddressTextBox);
|
||||
Controls.Add(atelierNameTextBox);
|
||||
Name = "FormAtelier";
|
||||
Text = "FormAtelier";
|
||||
Text = "Atelier creation";
|
||||
Load += FormAtelier_Load;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
|
153
SewingDresses/FormAtelierRestocking.Designer.cs
generated
153
SewingDresses/FormAtelierRestocking.Designer.cs
generated
@ -28,110 +28,109 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.atelierComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.atelierLabel = new System.Windows.Forms.Label();
|
||||
this.dressComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.dressLabel = new System.Windows.Forms.Label();
|
||||
this.quantityTextBox = new System.Windows.Forms.TextBox();
|
||||
this.quantityLabel = new System.Windows.Forms.Label();
|
||||
this.ButtonCancel = new System.Windows.Forms.Button();
|
||||
this.ButtonSave = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
atelierComboBox = new ComboBox();
|
||||
atelierLabel = new Label();
|
||||
dressComboBox = new ComboBox();
|
||||
dressLabel = new Label();
|
||||
quantityTextBox = new TextBox();
|
||||
quantityLabel = new Label();
|
||||
ButtonCancel = new Button();
|
||||
ButtonSave = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// atelierComboBox
|
||||
//
|
||||
this.atelierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.atelierComboBox.FormattingEnabled = true;
|
||||
this.atelierComboBox.Location = new System.Drawing.Point(114, 21);
|
||||
this.atelierComboBox.Name = "atelierComboBox";
|
||||
this.atelierComboBox.Size = new System.Drawing.Size(293, 23);
|
||||
this.atelierComboBox.TabIndex = 7;
|
||||
atelierComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
atelierComboBox.FormattingEnabled = true;
|
||||
atelierComboBox.Location = new Point(114, 21);
|
||||
atelierComboBox.Name = "atelierComboBox";
|
||||
atelierComboBox.Size = new Size(293, 23);
|
||||
atelierComboBox.TabIndex = 7;
|
||||
//
|
||||
// atelierLabel
|
||||
//
|
||||
this.atelierLabel.AutoSize = true;
|
||||
this.atelierLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.atelierLabel.Location = new System.Drawing.Point(12, 18);
|
||||
this.atelierLabel.Name = "atelierLabel";
|
||||
this.atelierLabel.Size = new System.Drawing.Size(71, 25);
|
||||
this.atelierLabel.TabIndex = 6;
|
||||
this.atelierLabel.Text = "Atelier:";
|
||||
atelierLabel.AutoSize = true;
|
||||
atelierLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
atelierLabel.Location = new Point(12, 18);
|
||||
atelierLabel.Name = "atelierLabel";
|
||||
atelierLabel.Size = new Size(71, 25);
|
||||
atelierLabel.TabIndex = 6;
|
||||
atelierLabel.Text = "Atelier:";
|
||||
//
|
||||
// dressComboBox
|
||||
//
|
||||
this.dressComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.dressComboBox.FormattingEnabled = true;
|
||||
this.dressComboBox.Location = new System.Drawing.Point(114, 69);
|
||||
this.dressComboBox.Name = "dressComboBox";
|
||||
this.dressComboBox.Size = new System.Drawing.Size(320, 23);
|
||||
this.dressComboBox.TabIndex = 9;
|
||||
dressComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
dressComboBox.FormattingEnabled = true;
|
||||
dressComboBox.Location = new Point(114, 69);
|
||||
dressComboBox.Name = "dressComboBox";
|
||||
dressComboBox.Size = new Size(320, 23);
|
||||
dressComboBox.TabIndex = 9;
|
||||
//
|
||||
// dressLabel
|
||||
//
|
||||
this.dressLabel.AutoSize = true;
|
||||
this.dressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.dressLabel.Location = new System.Drawing.Point(12, 66);
|
||||
this.dressLabel.Name = "dressLabel";
|
||||
this.dressLabel.Size = new System.Drawing.Size(82, 25);
|
||||
this.dressLabel.TabIndex = 8;
|
||||
this.dressLabel.Text = "Product:";
|
||||
dressLabel.AutoSize = true;
|
||||
dressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
dressLabel.Location = new Point(12, 66);
|
||||
dressLabel.Name = "dressLabel";
|
||||
dressLabel.Size = new Size(82, 25);
|
||||
dressLabel.TabIndex = 8;
|
||||
dressLabel.Text = "Product:";
|
||||
//
|
||||
// quantityTextBox
|
||||
//
|
||||
this.quantityTextBox.Location = new System.Drawing.Point(114, 113);
|
||||
this.quantityTextBox.Name = "quantityTextBox";
|
||||
this.quantityTextBox.Size = new System.Drawing.Size(320, 23);
|
||||
this.quantityTextBox.TabIndex = 11;
|
||||
quantityTextBox.Location = new Point(114, 113);
|
||||
quantityTextBox.Name = "quantityTextBox";
|
||||
quantityTextBox.Size = new Size(320, 23);
|
||||
quantityTextBox.TabIndex = 11;
|
||||
//
|
||||
// quantityLabel
|
||||
//
|
||||
this.quantityLabel.AutoSize = true;
|
||||
this.quantityLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.quantityLabel.Location = new System.Drawing.Point(12, 111);
|
||||
this.quantityLabel.Name = "quantityLabel";
|
||||
this.quantityLabel.Size = new System.Drawing.Size(88, 25);
|
||||
this.quantityLabel.TabIndex = 10;
|
||||
this.quantityLabel.Text = "Quantity:";
|
||||
quantityLabel.AutoSize = true;
|
||||
quantityLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
quantityLabel.Location = new Point(12, 111);
|
||||
quantityLabel.Name = "quantityLabel";
|
||||
quantityLabel.Size = new Size(88, 25);
|
||||
quantityLabel.TabIndex = 10;
|
||||
quantityLabel.Text = "Quantity:";
|
||||
//
|
||||
// ButtonCancel
|
||||
//
|
||||
this.ButtonCancel.Location = new System.Drawing.Point(336, 177);
|
||||
this.ButtonCancel.Name = "ButtonCancel";
|
||||
this.ButtonCancel.Size = new System.Drawing.Size(100, 32);
|
||||
this.ButtonCancel.TabIndex = 13;
|
||||
this.ButtonCancel.Text = "Cancel";
|
||||
this.ButtonCancel.UseVisualStyleBackColor = true;
|
||||
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
|
||||
ButtonCancel.Location = new Point(336, 177);
|
||||
ButtonCancel.Name = "ButtonCancel";
|
||||
ButtonCancel.Size = new Size(100, 32);
|
||||
ButtonCancel.TabIndex = 13;
|
||||
ButtonCancel.Text = "Cancel";
|
||||
ButtonCancel.UseVisualStyleBackColor = true;
|
||||
ButtonCancel.Click += ButtonCancel_Click;
|
||||
//
|
||||
// ButtonSave
|
||||
//
|
||||
this.ButtonSave.Location = new System.Drawing.Point(222, 177);
|
||||
this.ButtonSave.Name = "ButtonSave";
|
||||
this.ButtonSave.Size = new System.Drawing.Size(100, 32);
|
||||
this.ButtonSave.TabIndex = 12;
|
||||
this.ButtonSave.Text = "Save";
|
||||
this.ButtonSave.UseVisualStyleBackColor = true;
|
||||
this.ButtonSave.Click += new System.EventHandler(this.ButtonSave_Click);
|
||||
ButtonSave.Location = new Point(222, 177);
|
||||
ButtonSave.Name = "ButtonSave";
|
||||
ButtonSave.Size = new Size(100, 32);
|
||||
ButtonSave.TabIndex = 12;
|
||||
ButtonSave.Text = "Save";
|
||||
ButtonSave.UseVisualStyleBackColor = true;
|
||||
ButtonSave.Click += ButtonSave_Click;
|
||||
//
|
||||
// FormAtelierRestocking
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(448, 221);
|
||||
this.Controls.Add(this.ButtonCancel);
|
||||
this.Controls.Add(this.ButtonSave);
|
||||
this.Controls.Add(this.quantityTextBox);
|
||||
this.Controls.Add(this.quantityLabel);
|
||||
this.Controls.Add(this.dressComboBox);
|
||||
this.Controls.Add(this.dressLabel);
|
||||
this.Controls.Add(this.atelierComboBox);
|
||||
this.Controls.Add(this.atelierLabel);
|
||||
this.Name = "FormAtelierRestocking";
|
||||
this.Text = "FormAtelierRestocking";
|
||||
this.Load += new System.EventHandler(this.FormAtelierRestocking_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(448, 221);
|
||||
Controls.Add(ButtonCancel);
|
||||
Controls.Add(ButtonSave);
|
||||
Controls.Add(quantityTextBox);
|
||||
Controls.Add(quantityLabel);
|
||||
Controls.Add(dressComboBox);
|
||||
Controls.Add(dressLabel);
|
||||
Controls.Add(atelierComboBox);
|
||||
Controls.Add(atelierLabel);
|
||||
Name = "FormAtelierRestocking";
|
||||
Text = "Atelier restocking";
|
||||
Load += FormAtelierRestocking_Load;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -120,7 +120,7 @@ namespace SewingDresses
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
111
SewingDresses/FormAteliers.Designer.cs
generated
111
SewingDresses/FormAteliers.Designer.cs
generated
@ -28,80 +28,79 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.atelierGridView = new System.Windows.Forms.DataGridView();
|
||||
this.ButtonDelete = new System.Windows.Forms.Button();
|
||||
this.ButtonChange = new System.Windows.Forms.Button();
|
||||
this.ButtonAdd = new System.Windows.Forms.Button();
|
||||
this.buttonCheckDresses = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.atelierGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
atelierGridView = new DataGridView();
|
||||
ButtonDelete = new Button();
|
||||
ButtonChange = new Button();
|
||||
ButtonAdd = new Button();
|
||||
buttonCheckDresses = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)atelierGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// atelierGridView
|
||||
//
|
||||
this.atelierGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.atelierGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.atelierGridView.Location = new System.Drawing.Point(1, 2);
|
||||
this.atelierGridView.Name = "atelierGridView";
|
||||
this.atelierGridView.RowTemplate.Height = 25;
|
||||
this.atelierGridView.Size = new System.Drawing.Size(598, 447);
|
||||
this.atelierGridView.TabIndex = 0;
|
||||
atelierGridView.BackgroundColor = SystemColors.ControlLightLight;
|
||||
atelierGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
atelierGridView.Location = new Point(1, 2);
|
||||
atelierGridView.Name = "atelierGridView";
|
||||
atelierGridView.RowTemplate.Height = 25;
|
||||
atelierGridView.Size = new Size(598, 447);
|
||||
atelierGridView.TabIndex = 0;
|
||||
//
|
||||
// ButtonDelete
|
||||
//
|
||||
this.ButtonDelete.Location = new System.Drawing.Point(652, 148);
|
||||
this.ButtonDelete.Name = "ButtonDelete";
|
||||
this.ButtonDelete.Size = new System.Drawing.Size(92, 35);
|
||||
this.ButtonDelete.TabIndex = 6;
|
||||
this.ButtonDelete.Text = "Delete";
|
||||
this.ButtonDelete.UseVisualStyleBackColor = true;
|
||||
this.ButtonDelete.Click += new System.EventHandler(this.ButtonDelete_Click);
|
||||
ButtonDelete.Location = new Point(652, 148);
|
||||
ButtonDelete.Name = "ButtonDelete";
|
||||
ButtonDelete.Size = new Size(92, 35);
|
||||
ButtonDelete.TabIndex = 6;
|
||||
ButtonDelete.Text = "Delete";
|
||||
ButtonDelete.UseVisualStyleBackColor = true;
|
||||
ButtonDelete.Click += ButtonDelete_Click;
|
||||
//
|
||||
// ButtonChange
|
||||
//
|
||||
this.ButtonChange.Location = new System.Drawing.Point(652, 91);
|
||||
this.ButtonChange.Name = "ButtonChange";
|
||||
this.ButtonChange.Size = new System.Drawing.Size(92, 35);
|
||||
this.ButtonChange.TabIndex = 5;
|
||||
this.ButtonChange.Text = "Change";
|
||||
this.ButtonChange.UseVisualStyleBackColor = true;
|
||||
this.ButtonChange.Click += new System.EventHandler(this.ButtonChange_Click);
|
||||
ButtonChange.Location = new Point(652, 91);
|
||||
ButtonChange.Name = "ButtonChange";
|
||||
ButtonChange.Size = new Size(92, 35);
|
||||
ButtonChange.TabIndex = 5;
|
||||
ButtonChange.Text = "Change";
|
||||
ButtonChange.UseVisualStyleBackColor = true;
|
||||
ButtonChange.Click += ButtonChange_Click;
|
||||
//
|
||||
// ButtonAdd
|
||||
//
|
||||
this.ButtonAdd.Location = new System.Drawing.Point(652, 36);
|
||||
this.ButtonAdd.Name = "ButtonAdd";
|
||||
this.ButtonAdd.Size = new System.Drawing.Size(92, 35);
|
||||
this.ButtonAdd.TabIndex = 4;
|
||||
this.ButtonAdd.Text = "Add";
|
||||
this.ButtonAdd.UseVisualStyleBackColor = true;
|
||||
this.ButtonAdd.Click += new System.EventHandler(this.ButtonAdd_Click);
|
||||
ButtonAdd.Location = new Point(652, 36);
|
||||
ButtonAdd.Name = "ButtonAdd";
|
||||
ButtonAdd.Size = new Size(92, 35);
|
||||
ButtonAdd.TabIndex = 4;
|
||||
ButtonAdd.Text = "Add";
|
||||
ButtonAdd.UseVisualStyleBackColor = true;
|
||||
ButtonAdd.Click += ButtonAdd_Click;
|
||||
//
|
||||
// buttonCheckDresses
|
||||
//
|
||||
this.buttonCheckDresses.Location = new System.Drawing.Point(652, 210);
|
||||
this.buttonCheckDresses.Name = "buttonCheckDresses";
|
||||
this.buttonCheckDresses.Size = new System.Drawing.Size(92, 35);
|
||||
this.buttonCheckDresses.TabIndex = 7;
|
||||
this.buttonCheckDresses.Text = "Dresses";
|
||||
this.buttonCheckDresses.UseVisualStyleBackColor = true;
|
||||
this.buttonCheckDresses.Click += new System.EventHandler(this.buttonCheckDresses_Click);
|
||||
buttonCheckDresses.Location = new Point(652, 210);
|
||||
buttonCheckDresses.Name = "buttonCheckDresses";
|
||||
buttonCheckDresses.Size = new Size(92, 35);
|
||||
buttonCheckDresses.TabIndex = 7;
|
||||
buttonCheckDresses.Text = "Dresses";
|
||||
buttonCheckDresses.UseVisualStyleBackColor = true;
|
||||
buttonCheckDresses.Click += buttonCheckDresses_Click;
|
||||
//
|
||||
// FormAteliers
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.buttonCheckDresses);
|
||||
this.Controls.Add(this.ButtonDelete);
|
||||
this.Controls.Add(this.ButtonChange);
|
||||
this.Controls.Add(this.ButtonAdd);
|
||||
this.Controls.Add(this.atelierGridView);
|
||||
this.Name = "FormAteliers";
|
||||
this.Text = "FormAteliers";
|
||||
this.Load += new System.EventHandler(this.FormAteliers_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.atelierGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(buttonCheckDresses);
|
||||
Controls.Add(ButtonDelete);
|
||||
Controls.Add(ButtonChange);
|
||||
Controls.Add(ButtonAdd);
|
||||
Controls.Add(atelierGridView);
|
||||
Name = "FormAteliers";
|
||||
Text = "Ateliers";
|
||||
Load += FormAteliers_Load;
|
||||
((System.ComponentModel.ISupportInitialize)atelierGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
106
SewingDresses/FormCheckDresses.Designer.cs
generated
106
SewingDresses/FormCheckDresses.Designer.cs
generated
@ -28,82 +28,78 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.atelierComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.atelierLabel = new System.Windows.Forms.Label();
|
||||
this.dressesGridView = new System.Windows.Forms.DataGridView();
|
||||
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.DressName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Quantity = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dressesGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
atelierComboBox = new ComboBox();
|
||||
atelierLabel = new Label();
|
||||
dressesGridView = new DataGridView();
|
||||
ID = new DataGridViewTextBoxColumn();
|
||||
DressName = new DataGridViewTextBoxColumn();
|
||||
Quantity = new DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)dressesGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// atelierComboBox
|
||||
//
|
||||
this.atelierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.atelierComboBox.FormattingEnabled = true;
|
||||
this.atelierComboBox.Location = new System.Drawing.Point(106, 12);
|
||||
this.atelierComboBox.Name = "atelierComboBox";
|
||||
this.atelierComboBox.Size = new System.Drawing.Size(293, 23);
|
||||
this.atelierComboBox.TabIndex = 5;
|
||||
this.atelierComboBox.SelectedIndexChanged += new System.EventHandler(this.atelierComboBox_SelectedIndexChanged);
|
||||
atelierComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
atelierComboBox.FormattingEnabled = true;
|
||||
atelierComboBox.Location = new Point(106, 12);
|
||||
atelierComboBox.Name = "atelierComboBox";
|
||||
atelierComboBox.Size = new Size(293, 23);
|
||||
atelierComboBox.TabIndex = 5;
|
||||
atelierComboBox.SelectedIndexChanged += atelierComboBox_SelectedIndexChanged;
|
||||
//
|
||||
// atelierLabel
|
||||
//
|
||||
this.atelierLabel.AutoSize = true;
|
||||
this.atelierLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.atelierLabel.Location = new System.Drawing.Point(4, 9);
|
||||
this.atelierLabel.Name = "atelierLabel";
|
||||
this.atelierLabel.Size = new System.Drawing.Size(71, 25);
|
||||
this.atelierLabel.TabIndex = 4;
|
||||
this.atelierLabel.Text = "Atelier:";
|
||||
atelierLabel.AutoSize = true;
|
||||
atelierLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
atelierLabel.Location = new Point(4, 9);
|
||||
atelierLabel.Name = "atelierLabel";
|
||||
atelierLabel.Size = new Size(71, 25);
|
||||
atelierLabel.TabIndex = 4;
|
||||
atelierLabel.Text = "Atelier:";
|
||||
//
|
||||
// dressesGridView
|
||||
//
|
||||
this.dressesGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.dressesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dressesGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.ID,
|
||||
this.DressName,
|
||||
this.Quantity});
|
||||
this.dressesGridView.Location = new System.Drawing.Point(4, 51);
|
||||
this.dressesGridView.Name = "dressesGridView";
|
||||
this.dressesGridView.RowTemplate.Height = 25;
|
||||
this.dressesGridView.Size = new System.Drawing.Size(404, 261);
|
||||
this.dressesGridView.TabIndex = 6;
|
||||
dressesGridView.BackgroundColor = SystemColors.ControlLightLight;
|
||||
dressesGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dressesGridView.Columns.AddRange(new DataGridViewColumn[] { ID, DressName, Quantity });
|
||||
dressesGridView.Location = new Point(4, 51);
|
||||
dressesGridView.Name = "dressesGridView";
|
||||
dressesGridView.RowTemplate.Height = 25;
|
||||
dressesGridView.Size = new Size(404, 261);
|
||||
dressesGridView.TabIndex = 6;
|
||||
//
|
||||
// ID
|
||||
//
|
||||
this.ID.HeaderText = "ID";
|
||||
this.ID.Name = "ID";
|
||||
this.ID.Visible = false;
|
||||
ID.HeaderText = "ID";
|
||||
ID.Name = "ID";
|
||||
ID.Visible = false;
|
||||
//
|
||||
// DressName
|
||||
//
|
||||
this.DressName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.DressName.HeaderText = "DressName";
|
||||
this.DressName.Name = "DressName";
|
||||
DressName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
DressName.HeaderText = "DressName";
|
||||
DressName.Name = "DressName";
|
||||
//
|
||||
// Quantity
|
||||
//
|
||||
this.Quantity.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.Quantity.HeaderText = "Quantity";
|
||||
this.Quantity.Name = "Quantity";
|
||||
Quantity.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
Quantity.HeaderText = "Quantity";
|
||||
Quantity.Name = "Quantity";
|
||||
//
|
||||
// FormCheckDresses
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(411, 314);
|
||||
this.Controls.Add(this.dressesGridView);
|
||||
this.Controls.Add(this.atelierComboBox);
|
||||
this.Controls.Add(this.atelierLabel);
|
||||
this.Name = "FormCheckDresses";
|
||||
this.Text = "FormCheckDresses";
|
||||
this.Load += new System.EventHandler(this.FormCheckDresses_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dressesGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(411, 314);
|
||||
Controls.Add(dressesGridView);
|
||||
Controls.Add(atelierComboBox);
|
||||
Controls.Add(atelierLabel);
|
||||
Name = "FormCheckDresses";
|
||||
Text = "Check dresses";
|
||||
Load += FormCheckDresses_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dressesGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
258
SewingDresses/FormDress.Designer.cs
generated
258
SewingDresses/FormDress.Designer.cs
generated
@ -28,185 +28,181 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.nameDressLabel = new System.Windows.Forms.Label();
|
||||
this.priceDressLabel = new System.Windows.Forms.Label();
|
||||
this.nameDressTextBox = new System.Windows.Forms.TextBox();
|
||||
this.priceDressTextBox = new System.Windows.Forms.TextBox();
|
||||
this.materialsGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.RefreshButton = new System.Windows.Forms.Button();
|
||||
this.deleteButton = new System.Windows.Forms.Button();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
this.AddButton = new System.Windows.Forms.Button();
|
||||
this.dressGridView = new System.Windows.Forms.DataGridView();
|
||||
this.ColumnID = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ColumnMaterial = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ColumnQuantity = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.saveButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.materialsGroupBox.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
nameDressLabel = new Label();
|
||||
priceDressLabel = new Label();
|
||||
nameDressTextBox = new TextBox();
|
||||
priceDressTextBox = new TextBox();
|
||||
materialsGroupBox = new GroupBox();
|
||||
RefreshButton = new Button();
|
||||
deleteButton = new Button();
|
||||
changeButton = new Button();
|
||||
AddButton = new Button();
|
||||
dressGridView = new DataGridView();
|
||||
ColumnID = new DataGridViewTextBoxColumn();
|
||||
ColumnMaterial = new DataGridViewTextBoxColumn();
|
||||
ColumnQuantity = new DataGridViewTextBoxColumn();
|
||||
saveButton = new Button();
|
||||
cancelButton = new Button();
|
||||
materialsGroupBox.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dressGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// nameDressLabel
|
||||
//
|
||||
this.nameDressLabel.AutoSize = true;
|
||||
this.nameDressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.nameDressLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.nameDressLabel.Name = "nameDressLabel";
|
||||
this.nameDressLabel.Size = new System.Drawing.Size(66, 25);
|
||||
this.nameDressLabel.TabIndex = 0;
|
||||
this.nameDressLabel.Text = "Name:";
|
||||
nameDressLabel.AutoSize = true;
|
||||
nameDressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
nameDressLabel.Location = new Point(12, 9);
|
||||
nameDressLabel.Name = "nameDressLabel";
|
||||
nameDressLabel.Size = new Size(66, 25);
|
||||
nameDressLabel.TabIndex = 0;
|
||||
nameDressLabel.Text = "Name:";
|
||||
//
|
||||
// priceDressLabel
|
||||
//
|
||||
this.priceDressLabel.AutoSize = true;
|
||||
this.priceDressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.priceDressLabel.Location = new System.Drawing.Point(12, 46);
|
||||
this.priceDressLabel.Name = "priceDressLabel";
|
||||
this.priceDressLabel.Size = new System.Drawing.Size(58, 25);
|
||||
this.priceDressLabel.TabIndex = 1;
|
||||
this.priceDressLabel.Text = "Price:";
|
||||
priceDressLabel.AutoSize = true;
|
||||
priceDressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
priceDressLabel.Location = new Point(12, 46);
|
||||
priceDressLabel.Name = "priceDressLabel";
|
||||
priceDressLabel.Size = new Size(58, 25);
|
||||
priceDressLabel.TabIndex = 1;
|
||||
priceDressLabel.Text = "Price:";
|
||||
//
|
||||
// nameDressTextBox
|
||||
//
|
||||
this.nameDressTextBox.Location = new System.Drawing.Point(84, 11);
|
||||
this.nameDressTextBox.Name = "nameDressTextBox";
|
||||
this.nameDressTextBox.Size = new System.Drawing.Size(287, 23);
|
||||
this.nameDressTextBox.TabIndex = 2;
|
||||
nameDressTextBox.Location = new Point(84, 11);
|
||||
nameDressTextBox.Name = "nameDressTextBox";
|
||||
nameDressTextBox.Size = new Size(287, 23);
|
||||
nameDressTextBox.TabIndex = 2;
|
||||
//
|
||||
// priceDressTextBox
|
||||
//
|
||||
this.priceDressTextBox.Location = new System.Drawing.Point(84, 48);
|
||||
this.priceDressTextBox.Name = "priceDressTextBox";
|
||||
this.priceDressTextBox.ReadOnly = true;
|
||||
this.priceDressTextBox.Size = new System.Drawing.Size(178, 23);
|
||||
this.priceDressTextBox.TabIndex = 3;
|
||||
priceDressTextBox.Location = new Point(84, 48);
|
||||
priceDressTextBox.Name = "priceDressTextBox";
|
||||
priceDressTextBox.ReadOnly = true;
|
||||
priceDressTextBox.Size = new Size(178, 23);
|
||||
priceDressTextBox.TabIndex = 3;
|
||||
//
|
||||
// materialsGroupBox
|
||||
//
|
||||
this.materialsGroupBox.Controls.Add(this.RefreshButton);
|
||||
this.materialsGroupBox.Controls.Add(this.deleteButton);
|
||||
this.materialsGroupBox.Controls.Add(this.changeButton);
|
||||
this.materialsGroupBox.Controls.Add(this.AddButton);
|
||||
this.materialsGroupBox.Controls.Add(this.dressGridView);
|
||||
this.materialsGroupBox.Location = new System.Drawing.Point(16, 89);
|
||||
this.materialsGroupBox.Name = "materialsGroupBox";
|
||||
this.materialsGroupBox.Size = new System.Drawing.Size(770, 301);
|
||||
this.materialsGroupBox.TabIndex = 4;
|
||||
this.materialsGroupBox.TabStop = false;
|
||||
this.materialsGroupBox.Text = "Materials";
|
||||
materialsGroupBox.Controls.Add(RefreshButton);
|
||||
materialsGroupBox.Controls.Add(deleteButton);
|
||||
materialsGroupBox.Controls.Add(changeButton);
|
||||
materialsGroupBox.Controls.Add(AddButton);
|
||||
materialsGroupBox.Controls.Add(dressGridView);
|
||||
materialsGroupBox.Location = new Point(16, 89);
|
||||
materialsGroupBox.Name = "materialsGroupBox";
|
||||
materialsGroupBox.Size = new Size(770, 301);
|
||||
materialsGroupBox.TabIndex = 4;
|
||||
materialsGroupBox.TabStop = false;
|
||||
materialsGroupBox.Text = "Materials";
|
||||
//
|
||||
// RefreshButton
|
||||
//
|
||||
this.RefreshButton.Location = new System.Drawing.Point(638, 225);
|
||||
this.RefreshButton.Name = "RefreshButton";
|
||||
this.RefreshButton.Size = new System.Drawing.Size(103, 36);
|
||||
this.RefreshButton.TabIndex = 4;
|
||||
this.RefreshButton.Text = "Refresh";
|
||||
this.RefreshButton.UseVisualStyleBackColor = true;
|
||||
this.RefreshButton.Click += new System.EventHandler(this.ButtonRefresh_Click);
|
||||
RefreshButton.Location = new Point(638, 225);
|
||||
RefreshButton.Name = "RefreshButton";
|
||||
RefreshButton.Size = new Size(103, 36);
|
||||
RefreshButton.TabIndex = 4;
|
||||
RefreshButton.Text = "Refresh";
|
||||
RefreshButton.UseVisualStyleBackColor = true;
|
||||
RefreshButton.Click += ButtonRefresh_Click;
|
||||
//
|
||||
// deleteButton
|
||||
//
|
||||
this.deleteButton.Location = new System.Drawing.Point(638, 168);
|
||||
this.deleteButton.Name = "deleteButton";
|
||||
this.deleteButton.Size = new System.Drawing.Size(103, 36);
|
||||
this.deleteButton.TabIndex = 3;
|
||||
this.deleteButton.Text = "Delete";
|
||||
this.deleteButton.UseVisualStyleBackColor = true;
|
||||
this.deleteButton.Click += new System.EventHandler(this.ButtonDelete_Click);
|
||||
deleteButton.Location = new Point(638, 168);
|
||||
deleteButton.Name = "deleteButton";
|
||||
deleteButton.Size = new Size(103, 36);
|
||||
deleteButton.TabIndex = 3;
|
||||
deleteButton.Text = "Delete";
|
||||
deleteButton.UseVisualStyleBackColor = true;
|
||||
deleteButton.Click += ButtonDelete_Click;
|
||||
//
|
||||
// changeButton
|
||||
//
|
||||
this.changeButton.Location = new System.Drawing.Point(638, 110);
|
||||
this.changeButton.Name = "changeButton";
|
||||
this.changeButton.Size = new System.Drawing.Size(103, 36);
|
||||
this.changeButton.TabIndex = 2;
|
||||
this.changeButton.Text = "Change";
|
||||
this.changeButton.UseVisualStyleBackColor = true;
|
||||
this.changeButton.Click += new System.EventHandler(this.ButtonUpdate_Click);
|
||||
changeButton.Location = new Point(638, 110);
|
||||
changeButton.Name = "changeButton";
|
||||
changeButton.Size = new Size(103, 36);
|
||||
changeButton.TabIndex = 2;
|
||||
changeButton.Text = "Change";
|
||||
changeButton.UseVisualStyleBackColor = true;
|
||||
changeButton.Click += ButtonUpdate_Click;
|
||||
//
|
||||
// AddButton
|
||||
//
|
||||
this.AddButton.Location = new System.Drawing.Point(638, 56);
|
||||
this.AddButton.Name = "AddButton";
|
||||
this.AddButton.Size = new System.Drawing.Size(103, 36);
|
||||
this.AddButton.TabIndex = 1;
|
||||
this.AddButton.Text = "Add";
|
||||
this.AddButton.UseVisualStyleBackColor = true;
|
||||
this.AddButton.Click += new System.EventHandler(this.ButtonAdd_Click);
|
||||
AddButton.Location = new Point(638, 56);
|
||||
AddButton.Name = "AddButton";
|
||||
AddButton.Size = new Size(103, 36);
|
||||
AddButton.TabIndex = 1;
|
||||
AddButton.Text = "Add";
|
||||
AddButton.UseVisualStyleBackColor = true;
|
||||
AddButton.Click += ButtonAdd_Click;
|
||||
//
|
||||
// dressGridView
|
||||
//
|
||||
this.dressGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dressGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.ColumnID,
|
||||
this.ColumnMaterial,
|
||||
this.ColumnQuantity});
|
||||
this.dressGridView.Location = new System.Drawing.Point(6, 22);
|
||||
this.dressGridView.Name = "dressGridView";
|
||||
this.dressGridView.RowTemplate.Height = 25;
|
||||
this.dressGridView.Size = new System.Drawing.Size(588, 273);
|
||||
this.dressGridView.TabIndex = 0;
|
||||
dressGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dressGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnID, ColumnMaterial, ColumnQuantity });
|
||||
dressGridView.Location = new Point(6, 22);
|
||||
dressGridView.Name = "dressGridView";
|
||||
dressGridView.RowTemplate.Height = 25;
|
||||
dressGridView.Size = new Size(588, 273);
|
||||
dressGridView.TabIndex = 0;
|
||||
//
|
||||
// ColumnID
|
||||
//
|
||||
this.ColumnID.HeaderText = "ID";
|
||||
this.ColumnID.Name = "ColumnID";
|
||||
this.ColumnID.Visible = false;
|
||||
ColumnID.HeaderText = "ID";
|
||||
ColumnID.Name = "ColumnID";
|
||||
ColumnID.Visible = false;
|
||||
//
|
||||
// ColumnMaterial
|
||||
//
|
||||
this.ColumnMaterial.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.ColumnMaterial.HeaderText = "Material";
|
||||
this.ColumnMaterial.Name = "ColumnMaterial";
|
||||
ColumnMaterial.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
ColumnMaterial.HeaderText = "Material";
|
||||
ColumnMaterial.Name = "ColumnMaterial";
|
||||
//
|
||||
// ColumnQuantity
|
||||
//
|
||||
this.ColumnQuantity.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.ColumnQuantity.HeaderText = "Quantity";
|
||||
this.ColumnQuantity.Name = "ColumnQuantity";
|
||||
ColumnQuantity.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
ColumnQuantity.HeaderText = "Quantity";
|
||||
ColumnQuantity.Name = "ColumnQuantity";
|
||||
//
|
||||
// saveButton
|
||||
//
|
||||
this.saveButton.Location = new System.Drawing.Point(562, 407);
|
||||
this.saveButton.Name = "saveButton";
|
||||
this.saveButton.Size = new System.Drawing.Size(89, 31);
|
||||
this.saveButton.TabIndex = 5;
|
||||
this.saveButton.Text = "Save";
|
||||
this.saveButton.UseVisualStyleBackColor = true;
|
||||
this.saveButton.Click += new System.EventHandler(this.ButtonSave_Click);
|
||||
saveButton.Location = new Point(562, 407);
|
||||
saveButton.Name = "saveButton";
|
||||
saveButton.Size = new Size(89, 31);
|
||||
saveButton.TabIndex = 5;
|
||||
saveButton.Text = "Save";
|
||||
saveButton.UseVisualStyleBackColor = true;
|
||||
saveButton.Click += ButtonSave_Click;
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Location = new System.Drawing.Point(657, 407);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(89, 31);
|
||||
this.cancelButton.TabIndex = 6;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.ButtonCancel_Click);
|
||||
cancelButton.Location = new Point(657, 407);
|
||||
cancelButton.Name = "cancelButton";
|
||||
cancelButton.Size = new Size(89, 31);
|
||||
cancelButton.TabIndex = 6;
|
||||
cancelButton.Text = "Cancel";
|
||||
cancelButton.UseVisualStyleBackColor = true;
|
||||
cancelButton.Click += ButtonCancel_Click;
|
||||
//
|
||||
// FormDress
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.saveButton);
|
||||
this.Controls.Add(this.materialsGroupBox);
|
||||
this.Controls.Add(this.priceDressTextBox);
|
||||
this.Controls.Add(this.nameDressTextBox);
|
||||
this.Controls.Add(this.priceDressLabel);
|
||||
this.Controls.Add(this.nameDressLabel);
|
||||
this.Name = "FormDress";
|
||||
this.Text = "FormDress";
|
||||
this.Load += new System.EventHandler(this.FormDress_Load);
|
||||
this.materialsGroupBox.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(cancelButton);
|
||||
Controls.Add(saveButton);
|
||||
Controls.Add(materialsGroupBox);
|
||||
Controls.Add(priceDressTextBox);
|
||||
Controls.Add(nameDressTextBox);
|
||||
Controls.Add(priceDressLabel);
|
||||
Controls.Add(nameDressLabel);
|
||||
Name = "FormDress";
|
||||
Text = "Dress creation";
|
||||
Load += FormDress_Load;
|
||||
materialsGroupBox.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dressGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
117
SewingDresses/FormDressMaterial.Designer.cs
generated
117
SewingDresses/FormDressMaterial.Designer.cs
generated
@ -28,86 +28,85 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.materialNameLabel = new System.Windows.Forms.Label();
|
||||
this.materialQuantityLabel = new System.Windows.Forms.Label();
|
||||
this.materialComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.quantityTextBox = new System.Windows.Forms.TextBox();
|
||||
this.saveButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
materialNameLabel = new Label();
|
||||
materialQuantityLabel = new Label();
|
||||
materialComboBox = new ComboBox();
|
||||
quantityTextBox = new TextBox();
|
||||
saveButton = new Button();
|
||||
cancelButton = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// materialNameLabel
|
||||
//
|
||||
this.materialNameLabel.AutoSize = true;
|
||||
this.materialNameLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.materialNameLabel.Location = new System.Drawing.Point(12, 19);
|
||||
this.materialNameLabel.Name = "materialNameLabel";
|
||||
this.materialNameLabel.Size = new System.Drawing.Size(86, 25);
|
||||
this.materialNameLabel.TabIndex = 0;
|
||||
this.materialNameLabel.Text = "Material:";
|
||||
materialNameLabel.AutoSize = true;
|
||||
materialNameLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
materialNameLabel.Location = new Point(12, 19);
|
||||
materialNameLabel.Name = "materialNameLabel";
|
||||
materialNameLabel.Size = new Size(86, 25);
|
||||
materialNameLabel.TabIndex = 0;
|
||||
materialNameLabel.Text = "Material:";
|
||||
//
|
||||
// materialQuantityLabel
|
||||
//
|
||||
this.materialQuantityLabel.AutoSize = true;
|
||||
this.materialQuantityLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.materialQuantityLabel.Location = new System.Drawing.Point(12, 63);
|
||||
this.materialQuantityLabel.Name = "materialQuantityLabel";
|
||||
this.materialQuantityLabel.Size = new System.Drawing.Size(88, 25);
|
||||
this.materialQuantityLabel.TabIndex = 1;
|
||||
this.materialQuantityLabel.Text = "Quantity:";
|
||||
materialQuantityLabel.AutoSize = true;
|
||||
materialQuantityLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
materialQuantityLabel.Location = new Point(12, 63);
|
||||
materialQuantityLabel.Name = "materialQuantityLabel";
|
||||
materialQuantityLabel.Size = new Size(88, 25);
|
||||
materialQuantityLabel.TabIndex = 1;
|
||||
materialQuantityLabel.Text = "Quantity:";
|
||||
//
|
||||
// materialComboBox
|
||||
//
|
||||
this.materialComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.materialComboBox.FormattingEnabled = true;
|
||||
this.materialComboBox.Location = new System.Drawing.Point(123, 19);
|
||||
this.materialComboBox.Name = "materialComboBox";
|
||||
this.materialComboBox.Size = new System.Drawing.Size(342, 23);
|
||||
this.materialComboBox.TabIndex = 2;
|
||||
materialComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
materialComboBox.FormattingEnabled = true;
|
||||
materialComboBox.Location = new Point(123, 19);
|
||||
materialComboBox.Name = "materialComboBox";
|
||||
materialComboBox.Size = new Size(342, 23);
|
||||
materialComboBox.TabIndex = 2;
|
||||
//
|
||||
// quantityTextBox
|
||||
//
|
||||
this.quantityTextBox.Location = new System.Drawing.Point(123, 63);
|
||||
this.quantityTextBox.Name = "quantityTextBox";
|
||||
this.quantityTextBox.Size = new System.Drawing.Size(342, 23);
|
||||
this.quantityTextBox.TabIndex = 3;
|
||||
quantityTextBox.Location = new Point(123, 63);
|
||||
quantityTextBox.Name = "quantityTextBox";
|
||||
quantityTextBox.Size = new Size(342, 23);
|
||||
quantityTextBox.TabIndex = 3;
|
||||
//
|
||||
// saveButton
|
||||
//
|
||||
this.saveButton.Location = new System.Drawing.Point(275, 104);
|
||||
this.saveButton.Name = "saveButton";
|
||||
this.saveButton.Size = new System.Drawing.Size(92, 23);
|
||||
this.saveButton.TabIndex = 4;
|
||||
this.saveButton.Text = "Save";
|
||||
this.saveButton.UseVisualStyleBackColor = true;
|
||||
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
|
||||
saveButton.Location = new Point(275, 104);
|
||||
saveButton.Name = "saveButton";
|
||||
saveButton.Size = new Size(92, 23);
|
||||
saveButton.TabIndex = 4;
|
||||
saveButton.Text = "Save";
|
||||
saveButton.UseVisualStyleBackColor = true;
|
||||
saveButton.Click += saveButton_Click;
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Location = new System.Drawing.Point(373, 104);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(92, 23);
|
||||
this.cancelButton.TabIndex = 5;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
cancelButton.Location = new Point(373, 104);
|
||||
cancelButton.Name = "cancelButton";
|
||||
cancelButton.Size = new Size(92, 23);
|
||||
cancelButton.TabIndex = 5;
|
||||
cancelButton.Text = "Cancel";
|
||||
cancelButton.UseVisualStyleBackColor = true;
|
||||
cancelButton.Click += cancelButton_Click;
|
||||
//
|
||||
// FormDressMaterial
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(477, 129);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.saveButton);
|
||||
this.Controls.Add(this.quantityTextBox);
|
||||
this.Controls.Add(this.materialComboBox);
|
||||
this.Controls.Add(this.materialQuantityLabel);
|
||||
this.Controls.Add(this.materialNameLabel);
|
||||
this.Name = "FormDressMaterial";
|
||||
this.Text = "FormDressMaterial";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(477, 129);
|
||||
Controls.Add(cancelButton);
|
||||
Controls.Add(saveButton);
|
||||
Controls.Add(quantityTextBox);
|
||||
Controls.Add(materialComboBox);
|
||||
Controls.Add(materialQuantityLabel);
|
||||
Controls.Add(materialNameLabel);
|
||||
Name = "FormDressMaterial";
|
||||
Text = "Dress material";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
121
SewingDresses/FormDressSelling.Designer.cs
generated
Normal file
121
SewingDresses/FormDressSelling.Designer.cs
generated
Normal 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;
|
||||
}
|
||||
}
|
81
SewingDresses/FormDressSelling.cs
Normal file
81
SewingDresses/FormDressSelling.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
60
SewingDresses/FormDressSelling.resx
Normal file
60
SewingDresses/FormDressSelling.resx
Normal 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>
|
111
SewingDresses/FormDresses.Designer.cs
generated
111
SewingDresses/FormDresses.Designer.cs
generated
@ -28,80 +28,79 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.dressGridView = new System.Windows.Forms.DataGridView();
|
||||
this.ButtonAdd = new System.Windows.Forms.Button();
|
||||
this.ButtonChange = new System.Windows.Forms.Button();
|
||||
this.ButtonDelete = new System.Windows.Forms.Button();
|
||||
this.ButtonRefresh = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
dressGridView = new DataGridView();
|
||||
ButtonAdd = new Button();
|
||||
ButtonChange = new Button();
|
||||
ButtonDelete = new Button();
|
||||
ButtonRefresh = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dressGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dressGridView
|
||||
//
|
||||
this.dressGridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
|
||||
this.dressGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dressGridView.Location = new System.Drawing.Point(2, 2);
|
||||
this.dressGridView.Name = "dressGridView";
|
||||
this.dressGridView.RowTemplate.Height = 25;
|
||||
this.dressGridView.Size = new System.Drawing.Size(605, 447);
|
||||
this.dressGridView.TabIndex = 0;
|
||||
dressGridView.BackgroundColor = SystemColors.ButtonHighlight;
|
||||
dressGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dressGridView.Location = new Point(2, 2);
|
||||
dressGridView.Name = "dressGridView";
|
||||
dressGridView.RowTemplate.Height = 25;
|
||||
dressGridView.Size = new Size(605, 447);
|
||||
dressGridView.TabIndex = 0;
|
||||
//
|
||||
// ButtonAdd
|
||||
//
|
||||
this.ButtonAdd.Location = new System.Drawing.Point(661, 30);
|
||||
this.ButtonAdd.Name = "ButtonAdd";
|
||||
this.ButtonAdd.Size = new System.Drawing.Size(92, 35);
|
||||
this.ButtonAdd.TabIndex = 1;
|
||||
this.ButtonAdd.Text = "Add";
|
||||
this.ButtonAdd.UseVisualStyleBackColor = true;
|
||||
this.ButtonAdd.Click += new System.EventHandler(this.ButtonAdd_Click);
|
||||
ButtonAdd.Location = new Point(661, 30);
|
||||
ButtonAdd.Name = "ButtonAdd";
|
||||
ButtonAdd.Size = new Size(92, 35);
|
||||
ButtonAdd.TabIndex = 1;
|
||||
ButtonAdd.Text = "Add";
|
||||
ButtonAdd.UseVisualStyleBackColor = true;
|
||||
ButtonAdd.Click += ButtonAdd_Click;
|
||||
//
|
||||
// ButtonChange
|
||||
//
|
||||
this.ButtonChange.Location = new System.Drawing.Point(661, 85);
|
||||
this.ButtonChange.Name = "ButtonChange";
|
||||
this.ButtonChange.Size = new System.Drawing.Size(92, 35);
|
||||
this.ButtonChange.TabIndex = 2;
|
||||
this.ButtonChange.Text = "Change";
|
||||
this.ButtonChange.UseVisualStyleBackColor = true;
|
||||
this.ButtonChange.Click += new System.EventHandler(this.ButtonUpdate_Click);
|
||||
ButtonChange.Location = new Point(661, 85);
|
||||
ButtonChange.Name = "ButtonChange";
|
||||
ButtonChange.Size = new Size(92, 35);
|
||||
ButtonChange.TabIndex = 2;
|
||||
ButtonChange.Text = "Change";
|
||||
ButtonChange.UseVisualStyleBackColor = true;
|
||||
ButtonChange.Click += ButtonUpdate_Click;
|
||||
//
|
||||
// ButtonDelete
|
||||
//
|
||||
this.ButtonDelete.Location = new System.Drawing.Point(661, 142);
|
||||
this.ButtonDelete.Name = "ButtonDelete";
|
||||
this.ButtonDelete.Size = new System.Drawing.Size(92, 35);
|
||||
this.ButtonDelete.TabIndex = 3;
|
||||
this.ButtonDelete.Text = "Delete";
|
||||
this.ButtonDelete.UseVisualStyleBackColor = true;
|
||||
this.ButtonDelete.Click += new System.EventHandler(this.ButtonDelete_Click);
|
||||
ButtonDelete.Location = new Point(661, 142);
|
||||
ButtonDelete.Name = "ButtonDelete";
|
||||
ButtonDelete.Size = new Size(92, 35);
|
||||
ButtonDelete.TabIndex = 3;
|
||||
ButtonDelete.Text = "Delete";
|
||||
ButtonDelete.UseVisualStyleBackColor = true;
|
||||
ButtonDelete.Click += ButtonDelete_Click;
|
||||
//
|
||||
// ButtonRefresh
|
||||
//
|
||||
this.ButtonRefresh.Location = new System.Drawing.Point(661, 204);
|
||||
this.ButtonRefresh.Name = "ButtonRefresh";
|
||||
this.ButtonRefresh.Size = new System.Drawing.Size(92, 35);
|
||||
this.ButtonRefresh.TabIndex = 4;
|
||||
this.ButtonRefresh.Text = "Refresh";
|
||||
this.ButtonRefresh.UseVisualStyleBackColor = true;
|
||||
this.ButtonRefresh.Click += new System.EventHandler(this.ButtonRefresh_Click);
|
||||
ButtonRefresh.Location = new Point(661, 204);
|
||||
ButtonRefresh.Name = "ButtonRefresh";
|
||||
ButtonRefresh.Size = new Size(92, 35);
|
||||
ButtonRefresh.TabIndex = 4;
|
||||
ButtonRefresh.Text = "Refresh";
|
||||
ButtonRefresh.UseVisualStyleBackColor = true;
|
||||
ButtonRefresh.Click += ButtonRefresh_Click;
|
||||
//
|
||||
// FormDresses
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.ButtonRefresh);
|
||||
this.Controls.Add(this.ButtonDelete);
|
||||
this.Controls.Add(this.ButtonChange);
|
||||
this.Controls.Add(this.ButtonAdd);
|
||||
this.Controls.Add(this.dressGridView);
|
||||
this.Name = "FormDresses";
|
||||
this.Text = "FormDresses";
|
||||
this.Load += new System.EventHandler(this.FormDresses_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dressGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(ButtonRefresh);
|
||||
Controls.Add(ButtonDelete);
|
||||
Controls.Add(ButtonChange);
|
||||
Controls.Add(ButtonAdd);
|
||||
Controls.Add(dressGridView);
|
||||
Name = "FormDresses";
|
||||
Text = "Dresses list";
|
||||
Load += FormDresses_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dressGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
230
SewingDresses/FormMain.Designer.cs
generated
230
SewingDresses/FormMain.Designer.cs
generated
@ -28,156 +28,163 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.directoriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.materialsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.dressesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ateliersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.createOrderButton = new System.Windows.Forms.Button();
|
||||
this.processOrderButton = new System.Windows.Forms.Button();
|
||||
this.readyOrderButton = new System.Windows.Forms.Button();
|
||||
this.givenOrderButton = new System.Windows.Forms.Button();
|
||||
this.refreshOrdersButton = new System.Windows.Forms.Button();
|
||||
this.buttonRestocking = new System.Windows.Forms.Button();
|
||||
this.menuStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
menuStrip = new MenuStrip();
|
||||
directoriesToolStripMenuItem = new ToolStripMenuItem();
|
||||
materialsToolStripMenuItem = new ToolStripMenuItem();
|
||||
dressesToolStripMenuItem = new ToolStripMenuItem();
|
||||
ateliersToolStripMenuItem = new ToolStripMenuItem();
|
||||
dataGridView = new DataGridView();
|
||||
createOrderButton = new Button();
|
||||
processOrderButton = new Button();
|
||||
readyOrderButton = new Button();
|
||||
givenOrderButton = new Button();
|
||||
refreshOrdersButton = new Button();
|
||||
buttonRestocking = new Button();
|
||||
buttonSell = new Button();
|
||||
menuStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.directoriesToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(800, 24);
|
||||
this.menuStrip.TabIndex = 0;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
menuStrip.Items.AddRange(new ToolStripItem[] { directoriesToolStripMenuItem });
|
||||
menuStrip.Location = new Point(0, 0);
|
||||
menuStrip.Name = "menuStrip";
|
||||
menuStrip.Size = new Size(800, 24);
|
||||
menuStrip.TabIndex = 0;
|
||||
menuStrip.Text = "menuStrip1";
|
||||
//
|
||||
// directoriesToolStripMenuItem
|
||||
//
|
||||
this.directoriesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.materialsToolStripMenuItem,
|
||||
this.dressesToolStripMenuItem,
|
||||
this.ateliersToolStripMenuItem});
|
||||
this.directoriesToolStripMenuItem.Name = "directoriesToolStripMenuItem";
|
||||
this.directoriesToolStripMenuItem.Size = new System.Drawing.Size(75, 20);
|
||||
this.directoriesToolStripMenuItem.Text = "Directories";
|
||||
directoriesToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { materialsToolStripMenuItem, dressesToolStripMenuItem, ateliersToolStripMenuItem });
|
||||
directoriesToolStripMenuItem.Name = "directoriesToolStripMenuItem";
|
||||
directoriesToolStripMenuItem.Size = new Size(75, 20);
|
||||
directoriesToolStripMenuItem.Text = "Directories";
|
||||
//
|
||||
// materialsToolStripMenuItem
|
||||
//
|
||||
this.materialsToolStripMenuItem.Name = "materialsToolStripMenuItem";
|
||||
this.materialsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.materialsToolStripMenuItem.Text = "Materials";
|
||||
this.materialsToolStripMenuItem.Click += new System.EventHandler(this.materialsToolStripMenuItem_Click);
|
||||
materialsToolStripMenuItem.Name = "materialsToolStripMenuItem";
|
||||
materialsToolStripMenuItem.Size = new Size(122, 22);
|
||||
materialsToolStripMenuItem.Text = "Materials";
|
||||
materialsToolStripMenuItem.Click += materialsToolStripMenuItem_Click;
|
||||
//
|
||||
// dressesToolStripMenuItem
|
||||
//
|
||||
this.dressesToolStripMenuItem.Name = "dressesToolStripMenuItem";
|
||||
this.dressesToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.dressesToolStripMenuItem.Text = "Dresses";
|
||||
this.dressesToolStripMenuItem.Click += new System.EventHandler(this.dressesToolStripMenuItem_Click);
|
||||
dressesToolStripMenuItem.Name = "dressesToolStripMenuItem";
|
||||
dressesToolStripMenuItem.Size = new Size(122, 22);
|
||||
dressesToolStripMenuItem.Text = "Dresses";
|
||||
dressesToolStripMenuItem.Click += dressesToolStripMenuItem_Click;
|
||||
//
|
||||
// ateliersToolStripMenuItem
|
||||
//
|
||||
this.ateliersToolStripMenuItem.Name = "ateliersToolStripMenuItem";
|
||||
this.ateliersToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.ateliersToolStripMenuItem.Text = "Ateliers";
|
||||
this.ateliersToolStripMenuItem.Click += new System.EventHandler(this.ateliersToolStripMenuItem_Click);
|
||||
ateliersToolStripMenuItem.Name = "ateliersToolStripMenuItem";
|
||||
ateliersToolStripMenuItem.Size = new Size(122, 22);
|
||||
ateliersToolStripMenuItem.Text = "Ateliers";
|
||||
ateliersToolStripMenuItem.Click += ateliersToolStripMenuItem_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
|
||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView.Location = new System.Drawing.Point(2, 27);
|
||||
this.dataGridView.Name = "dataGridView";
|
||||
this.dataGridView.RowTemplate.Height = 25;
|
||||
this.dataGridView.Size = new System.Drawing.Size(631, 420);
|
||||
this.dataGridView.TabIndex = 1;
|
||||
dataGridView.BackgroundColor = SystemColors.ButtonHighlight;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Location = new Point(2, 27);
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowTemplate.Height = 25;
|
||||
dataGridView.Size = new Size(631, 420);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// createOrderButton
|
||||
//
|
||||
this.createOrderButton.Location = new System.Drawing.Point(652, 89);
|
||||
this.createOrderButton.Name = "createOrderButton";
|
||||
this.createOrderButton.Size = new System.Drawing.Size(117, 34);
|
||||
this.createOrderButton.TabIndex = 2;
|
||||
this.createOrderButton.Text = "Create order";
|
||||
this.createOrderButton.UseVisualStyleBackColor = true;
|
||||
this.createOrderButton.Click += new System.EventHandler(this.ButtonCreateOrder_Click);
|
||||
createOrderButton.Location = new Point(652, 40);
|
||||
createOrderButton.Name = "createOrderButton";
|
||||
createOrderButton.Size = new Size(117, 34);
|
||||
createOrderButton.TabIndex = 2;
|
||||
createOrderButton.Text = "Create order";
|
||||
createOrderButton.UseVisualStyleBackColor = true;
|
||||
createOrderButton.Click += ButtonCreateOrder_Click;
|
||||
//
|
||||
// processOrderButton
|
||||
//
|
||||
this.processOrderButton.Location = new System.Drawing.Point(652, 145);
|
||||
this.processOrderButton.Name = "processOrderButton";
|
||||
this.processOrderButton.Size = new System.Drawing.Size(117, 34);
|
||||
this.processOrderButton.TabIndex = 3;
|
||||
this.processOrderButton.Text = "Order\'s in process";
|
||||
this.processOrderButton.UseVisualStyleBackColor = true;
|
||||
this.processOrderButton.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click);
|
||||
processOrderButton.Location = new Point(652, 96);
|
||||
processOrderButton.Name = "processOrderButton";
|
||||
processOrderButton.Size = new Size(117, 34);
|
||||
processOrderButton.TabIndex = 3;
|
||||
processOrderButton.Text = "Order's in process";
|
||||
processOrderButton.UseVisualStyleBackColor = true;
|
||||
processOrderButton.Click += ButtonTakeOrderInWork_Click;
|
||||
//
|
||||
// readyOrderButton
|
||||
//
|
||||
this.readyOrderButton.Location = new System.Drawing.Point(652, 203);
|
||||
this.readyOrderButton.Name = "readyOrderButton";
|
||||
this.readyOrderButton.Size = new System.Drawing.Size(117, 34);
|
||||
this.readyOrderButton.TabIndex = 4;
|
||||
this.readyOrderButton.Text = "Order\'s ready";
|
||||
this.readyOrderButton.UseVisualStyleBackColor = true;
|
||||
this.readyOrderButton.Click += new System.EventHandler(this.ButtonOrderReady_Click);
|
||||
readyOrderButton.Location = new Point(652, 154);
|
||||
readyOrderButton.Name = "readyOrderButton";
|
||||
readyOrderButton.Size = new Size(117, 34);
|
||||
readyOrderButton.TabIndex = 4;
|
||||
readyOrderButton.Text = "Order's ready";
|
||||
readyOrderButton.UseVisualStyleBackColor = true;
|
||||
readyOrderButton.Click += ButtonOrderReady_Click;
|
||||
//
|
||||
// givenOrderButton
|
||||
//
|
||||
this.givenOrderButton.Location = new System.Drawing.Point(652, 259);
|
||||
this.givenOrderButton.Name = "givenOrderButton";
|
||||
this.givenOrderButton.Size = new System.Drawing.Size(117, 34);
|
||||
this.givenOrderButton.TabIndex = 5;
|
||||
this.givenOrderButton.Text = "Order\'s given";
|
||||
this.givenOrderButton.UseVisualStyleBackColor = true;
|
||||
this.givenOrderButton.Click += new System.EventHandler(this.ButtonIssuedOrder_Click);
|
||||
givenOrderButton.Location = new Point(652, 210);
|
||||
givenOrderButton.Name = "givenOrderButton";
|
||||
givenOrderButton.Size = new Size(117, 34);
|
||||
givenOrderButton.TabIndex = 5;
|
||||
givenOrderButton.Text = "Order's given";
|
||||
givenOrderButton.UseVisualStyleBackColor = true;
|
||||
givenOrderButton.Click += ButtonIssuedOrder_Click;
|
||||
//
|
||||
// refreshOrdersButton
|
||||
//
|
||||
this.refreshOrdersButton.Location = new System.Drawing.Point(652, 321);
|
||||
this.refreshOrdersButton.Name = "refreshOrdersButton";
|
||||
this.refreshOrdersButton.Size = new System.Drawing.Size(117, 34);
|
||||
this.refreshOrdersButton.TabIndex = 6;
|
||||
this.refreshOrdersButton.Text = "Refresh list";
|
||||
this.refreshOrdersButton.UseVisualStyleBackColor = true;
|
||||
this.refreshOrdersButton.Click += new System.EventHandler(this.ButtonRef_Click);
|
||||
refreshOrdersButton.Location = new Point(652, 272);
|
||||
refreshOrdersButton.Name = "refreshOrdersButton";
|
||||
refreshOrdersButton.Size = new Size(117, 34);
|
||||
refreshOrdersButton.TabIndex = 6;
|
||||
refreshOrdersButton.Text = "Refresh list";
|
||||
refreshOrdersButton.UseVisualStyleBackColor = true;
|
||||
refreshOrdersButton.Click += ButtonRef_Click;
|
||||
//
|
||||
// buttonRestocking
|
||||
//
|
||||
this.buttonRestocking.Location = new System.Drawing.Point(652, 404);
|
||||
this.buttonRestocking.Name = "buttonRestocking";
|
||||
this.buttonRestocking.Size = new System.Drawing.Size(117, 34);
|
||||
this.buttonRestocking.TabIndex = 7;
|
||||
this.buttonRestocking.Text = "Store restocking";
|
||||
this.buttonRestocking.UseVisualStyleBackColor = true;
|
||||
this.buttonRestocking.Click += new System.EventHandler(this.buttonRestocking_Click);
|
||||
buttonRestocking.Location = new Point(652, 404);
|
||||
buttonRestocking.Name = "buttonRestocking";
|
||||
buttonRestocking.Size = new Size(117, 34);
|
||||
buttonRestocking.TabIndex = 7;
|
||||
buttonRestocking.Text = "Store restocking";
|
||||
buttonRestocking.UseVisualStyleBackColor = true;
|
||||
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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.buttonRestocking);
|
||||
this.Controls.Add(this.refreshOrdersButton);
|
||||
this.Controls.Add(this.givenOrderButton);
|
||||
this.Controls.Add(this.readyOrderButton);
|
||||
this.Controls.Add(this.processOrderButton);
|
||||
this.Controls.Add(this.createOrderButton);
|
||||
this.Controls.Add(this.dataGridView);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.MainMenuStrip = this.menuStrip;
|
||||
this.Name = "FormMain";
|
||||
this.Text = "FormMain";
|
||||
this.Load += new System.EventHandler(this.FormMain_Load);
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(buttonSell);
|
||||
Controls.Add(buttonRestocking);
|
||||
Controls.Add(refreshOrdersButton);
|
||||
Controls.Add(givenOrderButton);
|
||||
Controls.Add(readyOrderButton);
|
||||
Controls.Add(processOrderButton);
|
||||
Controls.Add(createOrderButton);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(menuStrip);
|
||||
MainMenuStrip = menuStrip;
|
||||
Name = "FormMain";
|
||||
Text = "Order menu";
|
||||
Load += FormMain_Load;
|
||||
menuStrip.ResumeLayout(false);
|
||||
menuStrip.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -194,5 +201,6 @@
|
||||
private ToolStripMenuItem dressesToolStripMenuItem;
|
||||
private ToolStripMenuItem ateliersToolStripMenuItem;
|
||||
private Button buttonRestocking;
|
||||
private Button buttonSell;
|
||||
}
|
||||
}
|
@ -192,6 +192,12 @@ namespace SewingDresses
|
||||
_logger.LogInformation("Order №{id} is given", id);
|
||||
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)
|
||||
{
|
||||
_logger.LogError(ex, "Error in giving 'Is given' status to order");
|
||||
@ -205,6 +211,13 @@ namespace SewingDresses
|
||||
LoadData();
|
||||
}
|
||||
|
||||
|
||||
private void buttonSell_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormDressSelling));
|
||||
if (service is FormDressSelling form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
155
SewingDresses/FormOrderCreation.Designer.cs
generated
155
SewingDresses/FormOrderCreation.Designer.cs
generated
@ -28,111 +28,110 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.dressLabel = new System.Windows.Forms.Label();
|
||||
this.quantityLabel = new System.Windows.Forms.Label();
|
||||
this.priceLabel = new System.Windows.Forms.Label();
|
||||
this.dressComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.quantityTextBox = new System.Windows.Forms.TextBox();
|
||||
this.priceTextBox = new System.Windows.Forms.TextBox();
|
||||
this.ButtonSave = new System.Windows.Forms.Button();
|
||||
this.ButtonCancel = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
dressLabel = new Label();
|
||||
quantityLabel = new Label();
|
||||
priceLabel = new Label();
|
||||
dressComboBox = new ComboBox();
|
||||
quantityTextBox = new TextBox();
|
||||
priceTextBox = new TextBox();
|
||||
ButtonSave = new Button();
|
||||
ButtonCancel = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dressLabel
|
||||
//
|
||||
this.dressLabel.AutoSize = true;
|
||||
this.dressLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.dressLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.dressLabel.Name = "dressLabel";
|
||||
this.dressLabel.Size = new System.Drawing.Size(82, 25);
|
||||
this.dressLabel.TabIndex = 0;
|
||||
this.dressLabel.Text = "Product:";
|
||||
dressLabel.AutoSize = true;
|
||||
dressLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
dressLabel.Location = new Point(12, 9);
|
||||
dressLabel.Name = "dressLabel";
|
||||
dressLabel.Size = new Size(82, 25);
|
||||
dressLabel.TabIndex = 0;
|
||||
dressLabel.Text = "Product:";
|
||||
//
|
||||
// quantityLabel
|
||||
//
|
||||
this.quantityLabel.AutoSize = true;
|
||||
this.quantityLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.quantityLabel.Location = new System.Drawing.Point(12, 50);
|
||||
this.quantityLabel.Name = "quantityLabel";
|
||||
this.quantityLabel.Size = new System.Drawing.Size(88, 25);
|
||||
this.quantityLabel.TabIndex = 1;
|
||||
this.quantityLabel.Text = "Quantity:";
|
||||
quantityLabel.AutoSize = true;
|
||||
quantityLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
quantityLabel.Location = new Point(12, 50);
|
||||
quantityLabel.Name = "quantityLabel";
|
||||
quantityLabel.Size = new Size(88, 25);
|
||||
quantityLabel.TabIndex = 1;
|
||||
quantityLabel.Text = "Quantity:";
|
||||
//
|
||||
// priceLabel
|
||||
//
|
||||
this.priceLabel.AutoSize = true;
|
||||
this.priceLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.priceLabel.Location = new System.Drawing.Point(12, 90);
|
||||
this.priceLabel.Name = "priceLabel";
|
||||
this.priceLabel.Size = new System.Drawing.Size(56, 25);
|
||||
this.priceLabel.TabIndex = 2;
|
||||
this.priceLabel.Text = "Total:";
|
||||
priceLabel.AutoSize = true;
|
||||
priceLabel.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
priceLabel.Location = new Point(12, 90);
|
||||
priceLabel.Name = "priceLabel";
|
||||
priceLabel.Size = new Size(56, 25);
|
||||
priceLabel.TabIndex = 2;
|
||||
priceLabel.Text = "Total:";
|
||||
//
|
||||
// dressComboBox
|
||||
//
|
||||
this.dressComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.dressComboBox.FormattingEnabled = true;
|
||||
this.dressComboBox.Location = new System.Drawing.Point(114, 12);
|
||||
this.dressComboBox.Name = "dressComboBox";
|
||||
this.dressComboBox.Size = new System.Drawing.Size(320, 23);
|
||||
this.dressComboBox.TabIndex = 3;
|
||||
this.dressComboBox.SelectedIndexChanged += new System.EventHandler(this.DressComboBox_SelectedIndexChanged);
|
||||
dressComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
dressComboBox.FormattingEnabled = true;
|
||||
dressComboBox.Location = new Point(114, 12);
|
||||
dressComboBox.Name = "dressComboBox";
|
||||
dressComboBox.Size = new Size(320, 23);
|
||||
dressComboBox.TabIndex = 3;
|
||||
dressComboBox.SelectedIndexChanged += DressComboBox_SelectedIndexChanged;
|
||||
//
|
||||
// quantityTextBox
|
||||
//
|
||||
this.quantityTextBox.Location = new System.Drawing.Point(114, 52);
|
||||
this.quantityTextBox.Name = "quantityTextBox";
|
||||
this.quantityTextBox.Size = new System.Drawing.Size(320, 23);
|
||||
this.quantityTextBox.TabIndex = 4;
|
||||
this.quantityTextBox.TextChanged += new System.EventHandler(this.QuantityTextBox_TextChanged);
|
||||
quantityTextBox.Location = new Point(114, 52);
|
||||
quantityTextBox.Name = "quantityTextBox";
|
||||
quantityTextBox.Size = new Size(320, 23);
|
||||
quantityTextBox.TabIndex = 4;
|
||||
quantityTextBox.TextChanged += QuantityTextBox_TextChanged;
|
||||
//
|
||||
// priceTextBox
|
||||
//
|
||||
this.priceTextBox.Location = new System.Drawing.Point(114, 90);
|
||||
this.priceTextBox.Name = "priceTextBox";
|
||||
this.priceTextBox.ReadOnly = true;
|
||||
this.priceTextBox.Size = new System.Drawing.Size(320, 23);
|
||||
this.priceTextBox.TabIndex = 5;
|
||||
priceTextBox.Location = new Point(114, 90);
|
||||
priceTextBox.Name = "priceTextBox";
|
||||
priceTextBox.ReadOnly = true;
|
||||
priceTextBox.Size = new Size(320, 23);
|
||||
priceTextBox.TabIndex = 5;
|
||||
//
|
||||
// ButtonSave
|
||||
//
|
||||
this.ButtonSave.Location = new System.Drawing.Point(220, 138);
|
||||
this.ButtonSave.Name = "ButtonSave";
|
||||
this.ButtonSave.Size = new System.Drawing.Size(100, 32);
|
||||
this.ButtonSave.TabIndex = 6;
|
||||
this.ButtonSave.Text = "Save";
|
||||
this.ButtonSave.UseVisualStyleBackColor = true;
|
||||
this.ButtonSave.Click += new System.EventHandler(this.ButtonSave_Click);
|
||||
ButtonSave.Location = new Point(220, 138);
|
||||
ButtonSave.Name = "ButtonSave";
|
||||
ButtonSave.Size = new Size(100, 32);
|
||||
ButtonSave.TabIndex = 6;
|
||||
ButtonSave.Text = "Save";
|
||||
ButtonSave.UseVisualStyleBackColor = true;
|
||||
ButtonSave.Click += ButtonSave_Click;
|
||||
//
|
||||
// ButtonCancel
|
||||
//
|
||||
this.ButtonCancel.Location = new System.Drawing.Point(334, 138);
|
||||
this.ButtonCancel.Name = "ButtonCancel";
|
||||
this.ButtonCancel.Size = new System.Drawing.Size(100, 32);
|
||||
this.ButtonCancel.TabIndex = 7;
|
||||
this.ButtonCancel.Text = "Cancel";
|
||||
this.ButtonCancel.UseVisualStyleBackColor = true;
|
||||
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
|
||||
ButtonCancel.Location = new Point(334, 138);
|
||||
ButtonCancel.Name = "ButtonCancel";
|
||||
ButtonCancel.Size = new Size(100, 32);
|
||||
ButtonCancel.TabIndex = 7;
|
||||
ButtonCancel.Text = "Cancel";
|
||||
ButtonCancel.UseVisualStyleBackColor = true;
|
||||
ButtonCancel.Click += ButtonCancel_Click;
|
||||
//
|
||||
// FormOrderCreation
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(446, 181);
|
||||
this.Controls.Add(this.ButtonCancel);
|
||||
this.Controls.Add(this.ButtonSave);
|
||||
this.Controls.Add(this.priceTextBox);
|
||||
this.Controls.Add(this.quantityTextBox);
|
||||
this.Controls.Add(this.dressComboBox);
|
||||
this.Controls.Add(this.priceLabel);
|
||||
this.Controls.Add(this.quantityLabel);
|
||||
this.Controls.Add(this.dressLabel);
|
||||
this.Name = "FormOrderCreation";
|
||||
this.Text = "FormOrderCreation";
|
||||
this.Load += new System.EventHandler(this.FormOrderCreation_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(446, 181);
|
||||
Controls.Add(ButtonCancel);
|
||||
Controls.Add(ButtonSave);
|
||||
Controls.Add(priceTextBox);
|
||||
Controls.Add(quantityTextBox);
|
||||
Controls.Add(dressComboBox);
|
||||
Controls.Add(priceLabel);
|
||||
Controls.Add(quantityLabel);
|
||||
Controls.Add(dressLabel);
|
||||
Name = "FormOrderCreation";
|
||||
Text = "Order creation";
|
||||
Load += FormOrderCreation_Load;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -55,6 +55,7 @@ namespace SewingDresses
|
||||
services.AddTransient<FormAtelier>();
|
||||
services.AddTransient<FormAteliers>();
|
||||
services.AddTransient<FormAtelierRestocking>();
|
||||
services.AddTransient<FormDressSelling>();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user