аааа
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 System.Threading.Tasks;
|
||||||
using FlowerShopDataModels.Enums;
|
using FlowerShopDataModels.Enums;
|
||||||
|
|
||||||
namespace FlowerShopDatabaseImplement
|
namespace FlowerShopDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
public class Order : IOrderModel
|
public class Order : IOrderModel
|
||||||
{
|
{
|
||||||
@ -27,8 +27,9 @@ namespace FlowerShopDatabaseImplement
|
|||||||
public DateTime? DateImplement { get; private set; }
|
public DateTime? DateImplement { get; private set; }
|
||||||
[Required]
|
[Required]
|
||||||
public int FlowerId { get; private set; }
|
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)
|
if (model == null)
|
||||||
{
|
{
|
||||||
@ -43,6 +44,7 @@ namespace FlowerShopDatabaseImplement
|
|||||||
DateCreate = model.DateCreate,
|
DateCreate = model.DateCreate,
|
||||||
DateImplement = model.DateImplement,
|
DateImplement = model.DateImplement,
|
||||||
FlowerId = model.FlowerId,
|
FlowerId = model.FlowerId,
|
||||||
|
Flower = context.Flowers.FirstOrDefault(x => x.Id == model.FlowerId)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +66,7 @@ namespace FlowerShopDatabaseImplement
|
|||||||
Status = Status,
|
Status = Status,
|
||||||
DateCreate = DateCreate,
|
DateCreate = DateCreate,
|
||||||
DateImplement = DateImplement,
|
DateImplement = DateImplement,
|
||||||
|
FlowerName = Flower.FlowerName,
|
||||||
Id = Id,
|
Id = Id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@
|
|||||||
Controls.Add(labelNumber);
|
Controls.Add(labelNumber);
|
||||||
Controls.Add(labelComponent);
|
Controls.Add(labelComponent);
|
||||||
Name = "FormFlowerComponent";
|
Name = "FormFlowerComponent";
|
||||||
Text = "Цветок-компонент";
|
Text = "Цветы-компоненты";
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user