This commit is contained in:
Daniel 2023-04-08 18:12:08 +04:00
parent 2bfd5d4ba6
commit efe1193cc6
44 changed files with 749 additions and 0 deletions

View File

@ -0,0 +1,10 @@
using FactoryDataModels.Models;
namespace FactoryContracts.BindingModels
{
public class ComponentBindingModel : IComponentModel
{
public int Id { get; set; }
public string ComponentName { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,20 @@
using FactoryDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.BindingModels
{
public class EngenierBindingModel : IEngenierModel
{
public int Id { get; set; }
public string Password { get; set; } = string.Empty;
public string Fio { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,19 @@
using FactoryDataModels.Models;
namespace FactoryContracts.BindingModels
{
public class LatheBindingModel : ILatheModel
{
public int Id { get; set; }
public string LatheName { get; set; } = String.Empty;
public int MasterId { get; set; }
public int BusyId { get; set; }
public Dictionary<int, (IReinforcedModel, int)> LatheReinforcedes { get; set; } = new();
}
}

View File

@ -0,0 +1,13 @@
using FactoryDataModels.Models;
namespace FactoryContracts.BindingModels
{
public class LatheBusyBindingModel : ILatheBusyModel
{
public int Id { get; set; }
public int Percent { get; set; }
public DateTime Date { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using FactoryDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.BindingModels
{
public class MasterBindingModel : IMasterModel
{
public int Id { get; set; }
public string Password { get; set; } = string.Empty;
public string Fio { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,17 @@
using FactoryDataModels.Models;
namespace FactoryContracts.BindingModels
{
public class PlanBindingModel : IPlanModel
{
public int Id { get; set; }
public string PlanName { get; set; } = string.Empty;
public Dictionary<int, (ILatheModel, int)> PlanLathes { get; set; } = new();
public Dictionary<int, (IComponentModel, int)> PlanComponents { get; set; } = new();
public DateTime date { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using FactoryDataModels.Models;
namespace FactoryContracts.BindingModels
{
public class ReinforcedBindingModel : IReinforcedModel
{
public int Id { get; set; }
public string ReinforcedName { get; set; } = string.Empty;
public int EngenierId { get; set; }
public Dictionary<int, (IComponentModel, int)> ReinforcedComponents { get; set; } = new();
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.BindingModels
{
public class ReportBindingModel
{
public string FileName { get; set; } = string.Empty;
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using FactoryDataModels.Models;
namespace FactoryContracts.BindingModels
{
public class StageBindingModel : IStageModel
{
public int Id { get; set; }
public int PlanId { get; set; }
public int ReinforsedId { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface IComponentLogic
{
List<ComponentViewModel>? ReadList(ComponentSearchModel? model);
ComponentViewModel? ReadElement(ComponentSearchModel model);
bool Create(ComponentBindingModel model);
bool Update(ComponentBindingModel model);
bool Delete(ComponentBindingModel model);
}
}

View File

@ -0,0 +1,24 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface IEngenierLogic
{
List<EngenierViewModel>? ReadList(EngenierSearchModel? model);
EngenierViewModel? ReadElement(EngenierSearchModel model);
bool Create(EngenierBindingModel model);
bool Update(EngenierBindingModel model);
bool Delete(EngenierBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface ILatheBusyLogic
{
List<LatheBusyViewModel>? ReadList(LatheBusySearchModel? model);
LatheBusyViewModel? ReadElement(LatheBusySearchModel model);
bool Create(LatheBusyBindingModel model);
bool Update(LatheBusyBindingModel model);
bool Delete(LatheBusyBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface ILatheLogic
{
List<LatheViewModel>? ReadList(LatheSearchModel? model);
LatheViewModel? ReadElement(LatheSearchModel model);
bool Create(LatheBindingModel model);
bool Update(LatheBindingModel model);
bool Delete(LatheBindingModel model);
}
}

View File

@ -0,0 +1,24 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface IMasterLogic
{
List<MasterViewModel>? ReadList(MasterSearchModel? model);
MasterViewModel? ReadElement(MasterSearchModel model);
bool Create(MasterBindingModel model);
bool Update(MasterBindingModel model);
bool Delete(MasterBindingModel model);
}
}

View File

@ -0,0 +1,17 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface IPlanLogic
{
List<PlanViewModel>? ReadList(PlanSearchModel? model);
PlanViewModel? ReadElement(PlanSearchModel model);
bool Create(PlanBindingModel model);
bool Update(PlanBindingModel model);
bool Delete(PlanBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface IReinforcedLogic
{
List<ReinforcedViewModel>? ReadList(ReinforcedSearchModel? model);
ReinforcedViewModel? ReadElement(ReinforcedSearchModel model);
bool Create(ReinforcedBindingModel model);
bool Update(ReinforcedBindingModel model);
bool Delete(ReinforcedBindingModel model);
}
}

View File

@ -0,0 +1,21 @@

using FactoryContracts.BindingModels;
using FactoryContracts.ViewModels;
using PrecastConcretePlantContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface IReportLogic
{
List<ReportLatheComponentViewModel> GetPlanLathesAndComponents(ReportBindingModel model);
List<ReportLatheViewModel> GetLatheByBusy(ReportBindingModel model);
void SaveReinforcedesToWordFile(ReportBindingModel model);
void SaveReinforcedComponentToExcelFile(ReportBindingModel model);
void SaveOrdersToPdfFile(ReportBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.BusinessLogicsContracts
{
public interface IStageLogic
{
List<StageViewModel>? ReadList(StageSearchModel? model);
StageViewModel? ReadElement(StageSearchModel model);
bool Create(StageBindingModel model);
bool Update(StageBindingModel model);
bool Delete(StageBindingModel model);
}
}

View File

@ -0,0 +1,8 @@
namespace FactoryContracts.SearchModels
{
public class ComponentSearchModel
{
public int? Id { get; set; }
public string? ComponentName { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.SearchModels
{
public class EngenierSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
public string? Surname { get; set; }
public string? Patronymic { get; set; }
public string? Email { get; set; }
public string? Password { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using FactoryDataModels.Models;
namespace FactoryContracts.SearchModels
{
public class LatheBusySearchModel
{
public int? Id { get; set; }
public int? Percent { get; set; }
public DateTime? DateTo { get; set; }
public DateTime? DateFrom { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using FactoryDataModels.Models;
namespace FactoryContracts.SearchModels
{
public class LatheSearchModel
{
public int? Id { get; set; }
public string? LatheName { get; set; }
public int? MasterId { get; set; }
public int? BusyId { get; set; }
public Dictionary<int, (IReinforcedModel, int)>? LatheReinforcedes { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.SearchModels
{
public class MasterSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
public string? Surname { get; set; }
public string? Patronymic { get; set; }
public string? Email { get; set; }
public string? Password { get; set; }
public string? Telephone { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using FactoryDataModels.Models;
namespace FactoryContracts.SearchModels
{
public class PlanSearchModel
{
public int? Id { get; set; }
public string? PlanName { get; set; } = string.Empty;
public Dictionary<int, (ILatheModel, int)>? PlanLathes { get; set; } = new();
public DateTime? DateTo { get; set; }
public DateTime? DateFrom { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace FactoryContracts.SearchModels
{
public class ReinforcedSearchModel
{
public int? Id { get; set; }
public string? ReinforcedName { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using FactoryDataModels.Models;
namespace FactoryContracts.SearchModels
{
public class StageSearchModel
{
public int? Id { get; set; }
public int? PlanId { get; set; }
public int? ReinforsedId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.StoragesContracts
{
public interface IComponentStorage
{
List<ComponentViewModel> GetFullList();
List<ComponentViewModel> GetFilteredList(ComponentSearchModel model);
ComponentViewModel? GetElement(ComponentSearchModel model);
ComponentViewModel? Insert(ComponentBindingModel model);
ComponentViewModel? Update(ComponentBindingModel model);
ComponentViewModel? Delete(ComponentBindingModel model);
}
}

View File

@ -0,0 +1,26 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.StoragesContracts
{
public interface IEngenierStorage
{
List<EngenierViewModel> GetFullList();
List<EngenierViewModel> GetFilteredList(EngenierSearchModel model);
EngenierViewModel? GetElement(EngenierSearchModel model);
EngenierViewModel? Insert(EngenierBindingModel model);
EngenierViewModel? Update(EngenierBindingModel model);
EngenierViewModel? Delete(EngenierBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.StoragesContracts
{
public interface ILatheBusyStorage
{
List<LatheBusyViewModel> GetFullList();
List<LatheBusyViewModel> GetFilteredList(LatheBusySearchModel model);
LatheBusyViewModel? GetElement(LatheBusySearchModel model);
LatheBusyViewModel? Insert(LatheBusyBindingModel model);
LatheBusyViewModel? Update(LatheBusyBindingModel model);
LatheBusyViewModel? Delete(LatheBusyBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.StoragesContracts
{
public interface ILatheStorage
{
List<LatheViewModel> GetFullList();
List<LatheViewModel> GetFilteredList(LatheSearchModel model);
LatheViewModel? GetElement(LatheSearchModel model);
LatheViewModel? Insert(LatheBindingModel model);
LatheViewModel? Update(LatheBindingModel model);
LatheViewModel? Delete(LatheBindingModel model);
}
}

View File

@ -0,0 +1,26 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.StoragesContracts
{
public interface IMasterStorage
{
List<MasterViewModel> GetFullList();
List<MasterViewModel> GetFilteredList(MasterSearchModel model);
MasterViewModel? GetElement(MasterSearchModel model);
MasterViewModel? Insert(MasterBindingModel model);
MasterViewModel? Update(MasterBindingModel model);
MasterViewModel? Delete(MasterBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.StoragesContracts
{
public interface IPlanStorage
{
List<PlanViewModel> GetFullList();
List<PlanViewModel> GetFilteredList(PlanSearchModel model);
PlanViewModel? GetElement(PlanSearchModel model);
PlanViewModel? Insert(PlanBindingModel model);
PlanViewModel? Update(PlanBindingModel model);
PlanViewModel? Delete(PlanBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.StoragesContracts
{
public interface IReinforcedStorage
{
List<ReinforcedViewModel> GetFullList();
List<ReinforcedViewModel> GetFilteredList(ReinforcedSearchModel model);
ReinforcedViewModel? GetElement(ReinforcedSearchModel model);
ReinforcedViewModel? Insert(ReinforcedBindingModel model);
ReinforcedViewModel? Update(ReinforcedBindingModel model);
ReinforcedViewModel? Delete(ReinforcedBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using FactoryContracts.BindingModels;
using FactoryContracts.SearchModels;
using FactoryContracts.ViewModels;
namespace FactoryContracts.StoragesContracts
{
public interface IStageStorage
{
List<StageViewModel> GetFullList();
List<StageViewModel> GetFilteredList(StageSearchModel model);
StageViewModel? GetElement(StageSearchModel model);
StageViewModel? Insert(StageBindingModel model);
StageViewModel? Update(StageBindingModel model);
StageViewModel? Delete(StageBindingModel model);
}
}

View File

@ -0,0 +1,12 @@
using FactoryDataModels.Models;
using System.ComponentModel;
namespace FactoryContracts.ViewModels
{
public class ComponentViewModel : IComponentModel
{
public int Id { get; set; }
[DisplayName("Название компонента")]
public string ComponentName { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,22 @@
using FactoryDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.ViewModels
{
public class EngenierViewModel : IEngenierModel
{
public int Id { get; set; }
public string Password { get; set; } = string.Empty;
[DisplayName("Имя")]
public string Fio { get; set; } = string.Empty;
[DisplayName("Почта")]
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,15 @@
using FactoryDataModels.Models;
using System.ComponentModel;
namespace FactoryContracts.ViewModels
{
public class LatheBusyViewModel : ILatheBusyModel
{
public int Id { get; set; }
[DisplayName("Процент занятости")]
public int Percent { get; set; }
[DisplayName("Дата занятости")]
public DateTime Date { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using FactoryDataModels.Models;
using System.ComponentModel;
namespace FactoryContracts.ViewModels
{
public class LatheViewModel : ILatheModel
{
public int Id { get; set; }
[DisplayName("Название станка")]
public string LatheName { get; set; } = String.Empty;
public int MasterId { get; set; }
public int BusyId { get; set; }
public Dictionary<int, (IReinforcedModel, int)> LatheReinforcedes { get; set; } = new();
}
}

View File

@ -0,0 +1,23 @@
using FactoryDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.ViewModels
{
public class MasterViewModel : IMasterModel
{
public int Id { get; set; }
public string Password { get; set; } = string.Empty;
[DisplayName("Имя")]
public string Fio { get; set; } = string.Empty;
[DisplayName("Почта")]
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,19 @@
using FactoryDataModels.Models;
using System.ComponentModel;
namespace FactoryContracts.ViewModels
{
public class PlanViewModel : IPlanModel
{
public int Id { get; set; }
[DisplayName("Название производства")]
public string PlanName { get; set; } = string.Empty;
public Dictionary<int, (ILatheModel, int)> PlanLathes { get; set; } = new();
public Dictionary<int, (IComponentModel, int)> PlanComponents { get; set; } = new();
[DisplayName("Дата выполнения")]
public DateTime date { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using FactoryDataModels.Models;
using System.ComponentModel;
namespace FactoryContracts.ViewModels
{
public class ReinforcedViewModel : IReinforcedModel
{
public int Id { get; set; }
[DisplayName("Название изделия")]
public string ReinforcedName { get; set; } = string.Empty;
public int EngenierId { get; set; }
public Dictionary<int, (IComponentModel, int)> ReinforcedComponents { get;set;} = new();
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactoryContracts.ViewModels
{
public class ReportLatheComponentViewModel
{
public string PlanName { get; set; } = string.Empty;
public int TotalCount { get; set; }
public List<(string Component, int Count)> Components { get; set; } = new();
public List<(string Component, int Count)> Lathes { get; set; } = new();
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PrecastConcretePlantContracts.ViewModels
{
public class ReportLatheViewModel
{
public List<String> Lathes { get; set; } = new();
}
}

View File

@ -0,0 +1,13 @@
using FactoryDataModels.Models;
namespace FactoryContracts.ViewModels
{
public class StageViewModel : IStageModel
{
public int Id { get; set; }
public int PlanId { get; set; }
public int ReinforsedId { get; set; }
}
}