Merge branch 'Lab2_Base' into Lab2_Hard
This commit is contained in:
commit
a087bc0b53
2
Confectionery/FormCreateOrder.Designer.cs
generated
2
Confectionery/FormCreateOrder.Designer.cs
generated
@ -103,7 +103,7 @@
|
|||||||
this.textBoxCount.Name = "textBoxCount";
|
this.textBoxCount.Name = "textBoxCount";
|
||||||
this.textBoxCount.Size = new System.Drawing.Size(214, 23);
|
this.textBoxCount.Size = new System.Drawing.Size(214, 23);
|
||||||
this.textBoxCount.TabIndex = 6;
|
this.textBoxCount.TabIndex = 6;
|
||||||
this.textBoxCount.Click += new System.EventHandler(this.TextBoxCount_TextChanged);
|
this.textBoxCount.ValueChanged += new System.EventHandler(this.TextBoxCount_TextChanged);
|
||||||
//
|
//
|
||||||
// textBoxSum
|
// textBoxSum
|
||||||
//
|
//
|
||||||
|
@ -39,19 +39,17 @@ namespace ConfectioneryView
|
|||||||
}
|
}
|
||||||
private void CalcSum()
|
private void CalcSum()
|
||||||
{
|
{
|
||||||
if (comboBoxPastry.SelectedValue != null &&
|
if (comboBoxPastry.SelectedValue != null && !string.IsNullOrEmpty(textBoxCount.Text))
|
||||||
!string.IsNullOrEmpty(textBoxCount.Text))
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int id = Convert.ToInt32(comboBoxPastry.SelectedValue);
|
int id = Convert.ToInt32(comboBoxPastry.SelectedValue);
|
||||||
var pastry = _logicP.ReadElement(new PastrySearchModel
|
var pastry = _logicP.ReadElement(new()
|
||||||
{
|
{
|
||||||
Id = id
|
Id = id
|
||||||
});
|
});
|
||||||
int count = Convert.ToInt32(textBoxCount.Text);
|
int count = Convert.ToInt32(textBoxCount.Value);
|
||||||
textBoxSum.Text = Math.Round(count * (pastry?.Price ?? 0),
|
textBoxSum.Text = Math.Round(count * (pastry?.Price ?? 0), 2).ToString();
|
||||||
2).ToString();
|
|
||||||
_logger.LogInformation("Расчет суммы заказа");
|
_logger.LogInformation("Расчет суммы заказа");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user