Add search models
This commit is contained in:
parent
c11d13384a
commit
c81946029d
15
SushiBarContracts/BindingModels/ChequeBindingModel.cs
Normal file
15
SushiBarContracts/BindingModels/ChequeBindingModel.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class ChequeBindingModel
|
||||||
|
{
|
||||||
|
public List<ChequeItemBindingModel> ChequeItems { get; set; } = new();
|
||||||
|
|
||||||
|
public int? CustomerId { get; set; }
|
||||||
|
|
||||||
|
public DateTime OrderDate { get; set; }
|
||||||
|
|
||||||
|
public double TotalSum { get; set; }
|
||||||
|
|
||||||
|
public int? PromotionId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
11
SushiBarContracts/BindingModels/ChequeItemBindingModel.cs
Normal file
11
SushiBarContracts/BindingModels/ChequeItemBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class ChequeItemBindingModel
|
||||||
|
{
|
||||||
|
public int DishId { get; set; }
|
||||||
|
|
||||||
|
public int CookId { get; set; }
|
||||||
|
|
||||||
|
public int Count { get; set; }
|
||||||
|
}
|
||||||
|
}
|
9
SushiBarContracts/BindingModels/CookBindingModel.cs
Normal file
9
SushiBarContracts/BindingModels/CookBindingModel.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class CookBindingModel
|
||||||
|
{
|
||||||
|
public string Fio { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public DateTime EmploymentDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
9
SushiBarContracts/BindingModels/CustomerBindingModel.cs
Normal file
9
SushiBarContracts/BindingModels/CustomerBindingModel.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class CustomerBindingModel
|
||||||
|
{
|
||||||
|
public string Fio { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public DateTime? BirthdayDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
11
SushiBarContracts/BindingModels/DishBindingModel.cs
Normal file
11
SushiBarContracts/BindingModels/DishBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class DishBindingModel
|
||||||
|
{
|
||||||
|
public string DishName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string Category { get; set;} = string.Empty;
|
||||||
|
|
||||||
|
public List<DishIngredientBindingModel> Ingredients { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class DishIngredientBindingModel
|
||||||
|
{
|
||||||
|
public int IngredientId { get; set; }
|
||||||
|
|
||||||
|
public int Count { get; set; }
|
||||||
|
}
|
||||||
|
}
|
11
SushiBarContracts/BindingModels/IngredientBindingModel.cs
Normal file
11
SushiBarContracts/BindingModels/IngredientBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class IngredientBindingModel
|
||||||
|
{
|
||||||
|
public string IngredientName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string Unit { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double Cost { get; set; }
|
||||||
|
}
|
||||||
|
}
|
11
SushiBarContracts/BindingModels/PromotionBindingModel.cs
Normal file
11
SushiBarContracts/BindingModels/PromotionBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class PromotionBindingModel
|
||||||
|
{
|
||||||
|
public string PromotionName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public float Discount { get; set; }
|
||||||
|
|
||||||
|
public double TriggeringSum { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -6,8 +6,4 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="BindingModels\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using SushiBarContracts.BindingModels;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace SushiBarDatabaseImplement.Models
|
namespace SushiBarDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
@ -19,5 +21,31 @@ namespace SushiBarDatabaseImplement.Models
|
|||||||
|
|
||||||
[ForeignKey("IngredientId")]
|
[ForeignKey("IngredientId")]
|
||||||
public virtual List<DishIngredient> DishIngredients { get; set; } = new();
|
public virtual List<DishIngredient> DishIngredients { get; set; } = new();
|
||||||
|
|
||||||
|
public static Ingredient? Create(IngredientBindingModel Model)
|
||||||
|
{
|
||||||
|
return new Ingredient()
|
||||||
|
{
|
||||||
|
IngredientName = Model.IngredientName,
|
||||||
|
name = model.name,
|
||||||
|
facultyid = model.facultyid,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public void Update(CourseBindingModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
name = model.name;
|
||||||
|
facultyid = model.facultyid;
|
||||||
|
}
|
||||||
|
public CourseViewModel ViewModel => new()
|
||||||
|
{
|
||||||
|
course_id = course_id,
|
||||||
|
name = name,
|
||||||
|
facultyid = facultyid,
|
||||||
|
FacultyName = Faculty.name,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,9 @@ namespace SushiBarDatabaseImplement.Storages
|
|||||||
{
|
{
|
||||||
public List<IngredientViewModel> GetFullList()
|
public List<IngredientViewModel> GetFullList()
|
||||||
{
|
{
|
||||||
return new List<IngredientViewModel>();
|
using var Context = new SushiBarDatabase();
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user