Теперь точно готово
This commit is contained in:
parent
2e5c36d63b
commit
269964f62d
@ -70,37 +70,41 @@ namespace IceCreamShop
|
|||||||
option.SetMinimumLevel(LogLevel.Information);
|
option.SetMinimumLevel(LogLevel.Information);
|
||||||
option.AddNLog("nlog.config");
|
option.AddNLog("nlog.config");
|
||||||
});
|
});
|
||||||
services.AddSingleton<AbstractMailWorker, MailKitWorker>();
|
|
||||||
services.AddTransient<IComponentStorage, ComponentStorage>();
|
services.AddTransient<IComponentStorage, ComponentStorage>();
|
||||||
services.AddTransient<IOrderStorage, OrderStorage>();
|
services.AddTransient<IOrderStorage, OrderStorage>();
|
||||||
|
services.AddTransient<IImplementerStorage, ImplementerStorage>();
|
||||||
services.AddTransient<IIceCreamStorage, IceCreamStorage>();
|
services.AddTransient<IIceCreamStorage, IceCreamStorage>();
|
||||||
|
services.AddTransient<IClientStorage, ClientStorage>();
|
||||||
|
services.AddTransient<IMessageInfoStorage, MessageInfoStorage>();
|
||||||
|
|
||||||
|
services.AddTransient<IClientLogic, ClientLogic>();
|
||||||
|
services.AddTransient<IImplementerLogic, ImplementerLogic>();
|
||||||
services.AddTransient<IComponentLogic, ComponentLogic>();
|
services.AddTransient<IComponentLogic, ComponentLogic>();
|
||||||
services.AddTransient<IOrderLogic, OrderLogic>();
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
||||||
services.AddTransient<IReportLogic, ReportLogic>();
|
|
||||||
services.AddTransient<IIceCreamLogic, IceCreamLogic>();
|
services.AddTransient<IIceCreamLogic, IceCreamLogic>();
|
||||||
services.AddTransient<IImplementerLogic, ImplementerLogic>();
|
services.AddTransient<IReportLogic, ReportLogic>();
|
||||||
services.AddTransient<IImplementerStorage, ImplementerStorage>();
|
|
||||||
services.AddTransient<IClientLogic, ClientLogic>();
|
|
||||||
services.AddTransient<IClientStorage, ClientStorage>();
|
|
||||||
services.AddTransient<IWorkProcess, WorkModeling>();
|
services.AddTransient<IWorkProcess, WorkModeling>();
|
||||||
services.AddTransient<IMessageInfoLogic, MessageInfoLogic>();
|
services.AddTransient<IMessageInfoLogic, MessageInfoLogic>();
|
||||||
services.AddTransient<IMessageInfoStorage, MessageInfoStorage>();
|
|
||||||
|
services.AddSingleton<AbstractMailWorker, MailKitWorker>();
|
||||||
|
|
||||||
|
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
||||||
|
services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
||||||
|
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
||||||
|
|
||||||
services.AddTransient<MainForm>();
|
services.AddTransient<MainForm>();
|
||||||
services.AddTransient<ViewMailForm>();
|
services.AddTransient<ImplementerForm>();
|
||||||
|
services.AddTransient<ImplementersForm>();
|
||||||
|
services.AddTransient<ClientsForm>();
|
||||||
services.AddTransient<ComponentForm>();
|
services.AddTransient<ComponentForm>();
|
||||||
services.AddTransient<ComponentsForm>();
|
services.AddTransient<ComponentLogic>();
|
||||||
services.AddTransient<OrderForm>();
|
services.AddTransient<OrderForm>();
|
||||||
services.AddTransient<IceCreamForm>();
|
services.AddTransient<IceCreamForm>();
|
||||||
services.AddTransient<ImplementersForm>();
|
|
||||||
services.AddTransient<ImplementerForm>();
|
|
||||||
services.AddTransient<ClientsForm>();
|
|
||||||
services.AddTransient<IceCreamComponentForm>();
|
services.AddTransient<IceCreamComponentForm>();
|
||||||
services.AddTransient<IceCreamsForm>();
|
services.AddTransient<IceCreamsForm>();
|
||||||
services.AddTransient<ReportIceCreamComponentForm>();
|
services.AddTransient<ReportIceCreamComponentForm>();
|
||||||
services.AddTransient<ReportOrdersForm>();
|
services.AddTransient<ReportOrdersForm>();
|
||||||
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
services.AddTransient<ViewMailForm>();
|
||||||
services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
|
||||||
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void MailCheck(object obj) =>
|
private static void MailCheck(object obj) =>
|
||||||
|
@ -39,7 +39,7 @@ namespace IceCreamShopDatabaseImplement.Implements
|
|||||||
public MessageInfoViewModel? Insert(MessageInfoBindingModel model)
|
public MessageInfoViewModel? Insert(MessageInfoBindingModel model)
|
||||||
{
|
{
|
||||||
using var context = new IceCreamShopDataBase();
|
using var context = new IceCreamShopDataBase();
|
||||||
var newMessage = MessageInfo.Create(model);
|
var newMessage = MessageInfo.Create(context, model);
|
||||||
if (newMessage == null || context.Messages.Any(x => x.MessageId.Equals(model.MessageId)))
|
if (newMessage == null || context.Messages.Any(x => x.MessageId.Equals(model.MessageId)))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@ -22,7 +22,7 @@ namespace IceCreamShopDatabaseImplement.Models
|
|||||||
|
|
||||||
public Client? Client { get; private set; }
|
public Client? Client { get; private set; }
|
||||||
|
|
||||||
public static MessageInfo? Create(MessageInfoBindingModel model)
|
public static MessageInfo? Create(IceCreamShopDataBase context, MessageInfoBindingModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
@ -32,7 +32,8 @@ namespace IceCreamShopDatabaseImplement.Models
|
|||||||
{
|
{
|
||||||
Body = model.Body,
|
Body = model.Body,
|
||||||
Subject = model.Subject,
|
Subject = model.Subject,
|
||||||
ClientId = model.ClientId,
|
ClientId = context.Clients.FirstOrDefault(x => x.Email == model.SenderName).Id,
|
||||||
|
Client = context.Clients.FirstOrDefault(x => x.Email == model.SenderName),
|
||||||
MessageId = model.MessageId,
|
MessageId = model.MessageId,
|
||||||
SenderName = model.SenderName,
|
SenderName = model.SenderName,
|
||||||
DateDelivery = model.DateDelivery,
|
DateDelivery = model.DateDelivery,
|
||||||
|
@ -21,7 +21,8 @@ builder.Services.AddTransient<IClientLogic, ClientLogic>();
|
|||||||
builder.Services.AddTransient<IIceCreamLogic, IceCreamLogic>();
|
builder.Services.AddTransient<IIceCreamLogic, IceCreamLogic>();
|
||||||
builder.Services.AddTransient<IImplementerLogic, ImplementerLogic>();
|
builder.Services.AddTransient<IImplementerLogic, ImplementerLogic>();
|
||||||
builder.Services.AddTransient<IMessageInfoLogic, MessageInfoLogic>();
|
builder.Services.AddTransient<IMessageInfoLogic, MessageInfoLogic>();
|
||||||
builder.Services.AddTransient<AbstractMailWorker, MailKitWorker>();
|
|
||||||
|
builder.Services.AddSingleton<AbstractMailWorker, MailKitWorker>();
|
||||||
|
|
||||||
|
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
Loading…
Reference in New Issue
Block a user