аааа
This commit is contained in:
parent
a7eaf9241b
commit
ec23419300
19
FlowerShopDataModels/IShopModel.cs
Normal file
19
FlowerShopDataModels/IShopModel.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using FlowerShopDataModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FlowerShopDataModels.Models
|
||||
{
|
||||
public interface IShopModel : IId
|
||||
{
|
||||
string ShopName { get; }
|
||||
string Address { get; }
|
||||
DateTime DateOpen { get; }
|
||||
Dictionary<int, (IFlowerModel, int)> ShopFlowers { get; }
|
||||
int MaxCapacity { get; }
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FlowerShopDataModels.Enums;
|
||||
|
||||
namespace FlowerShopDatabaseImplement
|
||||
namespace FlowerShopDatabaseImplement.Models
|
||||
{
|
||||
public class Order : IOrderModel
|
||||
{
|
||||
@ -27,8 +27,9 @@ namespace FlowerShopDatabaseImplement
|
||||
public DateTime? DateImplement { get; private set; }
|
||||
[Required]
|
||||
public int FlowerId { get; private set; }
|
||||
public virtual Flower Flower { get; private set; }
|
||||
|
||||
public static Order? Create(OrderBindingModel model)
|
||||
public static Order? Create(FlowerShopDataBase context,OrderBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
@ -43,6 +44,7 @@ namespace FlowerShopDatabaseImplement
|
||||
DateCreate = model.DateCreate,
|
||||
DateImplement = model.DateImplement,
|
||||
FlowerId = model.FlowerId,
|
||||
Flower = context.Flowers.FirstOrDefault(x => x.Id == model.FlowerId)
|
||||
};
|
||||
}
|
||||
|
||||
@ -64,6 +66,7 @@ namespace FlowerShopDatabaseImplement
|
||||
Status = Status,
|
||||
DateCreate = DateCreate,
|
||||
DateImplement = DateImplement,
|
||||
FlowerName = Flower.FlowerName,
|
||||
Id = Id,
|
||||
};
|
||||
|
||||
|
@ -101,7 +101,7 @@
|
||||
Controls.Add(labelNumber);
|
||||
Controls.Add(labelComponent);
|
||||
Name = "FormFlowerComponent";
|
||||
Text = "Цветок-компонент";
|
||||
Text = "Цветы-компоненты";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user