точно готовая лаба 1

This commit is contained in:
Полина Чубыкина 2024-03-12 21:04:18 +04:00
parent deef66e3fc
commit 35d8276190
18 changed files with 11 additions and 11 deletions

View File

@ -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; }

View File

@ -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; }

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace ConfectioneryDataModels
{
public interface Iid
public interface IId
{
int Id { get; }
}

View File

@ -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; }

View File

@ -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; }

View File

@ -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; }

View File

@ -8,7 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConfectioneryListImplement
namespace ConfectioneryListImplement.Models
{
internal class Order : IOrderModel
{

View File

@ -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
//

View File

@ -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;
}