точно готовая лаба 1
This commit is contained in:
parent
deef66e3fc
commit
35d8276190
@ -14,7 +14,7 @@ namespace ConfectioneryContracts.ViewModels
|
||||
[DisplayName("Номер")]
|
||||
public int Id { get; set; }
|
||||
public int PastryId { get; set; }
|
||||
[DisplayName("Изделие")]
|
||||
[DisplayName("Выпечка")]
|
||||
public string PastryName { get; set; } = string.Empty;
|
||||
[DisplayName("Количество")]
|
||||
public int Count { get; set; }
|
||||
|
@ -11,7 +11,7 @@ namespace ConfectioneryContracts.ViewModels
|
||||
public class PastryViewModel : IPastryModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название изделия")]
|
||||
[DisplayName("Название визделия")]
|
||||
public string PastryName { get; set; } = string.Empty;
|
||||
[DisplayName("Цена")]
|
||||
public double Price { get; set; }
|
||||
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ConfectioneryDataModels
|
||||
{
|
||||
public interface Iid
|
||||
public interface IId
|
||||
{
|
||||
int Id { get; }
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ConfectioneryDataModels.Models
|
||||
{
|
||||
public interface IComponentModel : Iid
|
||||
public interface IComponentModel : IId
|
||||
{
|
||||
string ComponentName { get; }
|
||||
double Cost { get; }
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ConfectioneryDataModels.Models
|
||||
{
|
||||
public interface IOrderModel : Iid
|
||||
public interface IOrderModel : IId
|
||||
{
|
||||
int PastryId { get; }
|
||||
int Count { get; }
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ConfectioneryDataModels.Models
|
||||
{
|
||||
public interface IPastryModel : Iid
|
||||
public interface IPastryModel : IId
|
||||
{
|
||||
string PastryName { get; }
|
||||
double Price { get; }
|
@ -8,7 +8,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ConfectioneryListImplement
|
||||
namespace ConfectioneryListImplement.Models
|
||||
{
|
||||
internal class Order : IOrderModel
|
||||
{
|
@ -45,7 +45,7 @@
|
||||
this.labelPastry.Name = "labelPastry";
|
||||
this.labelPastry.Size = new System.Drawing.Size(71, 20);
|
||||
this.labelPastry.TabIndex = 0;
|
||||
this.labelPastry.Text = "Изделие:";
|
||||
this.labelPastry.Text = "Выпечка:";
|
||||
//
|
||||
// labelCount
|
||||
//
|
||||
|
@ -55,12 +55,12 @@ namespace ConfectioneryView
|
||||
try
|
||||
{
|
||||
int id = Convert.ToInt32(comboBoxPastry.SelectedValue);
|
||||
var product = _logicP.ReadElement(new PastrySearchModel
|
||||
var pastry = _logicP.ReadElement(new PastrySearchModel
|
||||
{
|
||||
Id = id
|
||||
});
|
||||
int count = Convert.ToInt32(textBoxCount.Text);
|
||||
textBoxSum.Text = Math.Round(count * (product?.Price ?? 0),
|
||||
textBoxSum.Text = Math.Round(count * (pastry?.Price ?? 0),
|
||||
2).ToString();
|
||||
_logger.LogInformation("Расчет суммы заказа");
|
||||
}
|
||||
@ -91,7 +91,7 @@ namespace ConfectioneryView
|
||||
}
|
||||
if (comboBoxPastry.SelectedValue == null)
|
||||
{
|
||||
MessageBox.Show("Выберите изделие", "Ошибка",
|
||||
MessageBox.Show("Выберите выпечку", "Ошибка",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user