This commit is contained in:
Arklightning 2023-04-09 13:25:27 +04:00
parent 5c6db64994
commit 3acfa3229b
5 changed files with 16 additions and 16 deletions

View File

@ -34,21 +34,21 @@ namespace BankBusinessLogic.BusinessLogics
}
public List<ReportMealPlanDinnerViewModel> GetMealPlanDinner()
{
var mealPlans = _mealPlansStorage.GetFullList();
var dinners = _dinnerStorage.GetFullList();
var additions = _mealPlansStorage.GetFullList();
var credits = _dinnerStorage.GetFullList();
var list = new List<ReportMealPlanDinnerViewModel>();
foreach (var dinner in dinners)
foreach (var credit in credits)
{
var record = new ReportMealPlanDinnerViewModel
{
DinnerName = dinner.DinnerName,
MealPlans = new List<Tuple<string, DateTime>>()
CreditName = credit.CreditName,
Additions = new List<Tuple<string, DateTime>>()
};
foreach (var mealPlan in mealPlans)
foreach (var additioms in additions)
{
if (mealPlan.MealPlanDinners.ContainsKey(dinner.Id))
if (additions.AdditionsCredit.ContainsKey(credit.Id))
{
record.MealPlans.Add(new Tuple<string, DateTime>(mealPlans.MealPlanName, mealPlans.StartDate));
record.Additions.Add(new Tuple<string, DateTime>(additions.AdditionsName, additions.AdditionsDate));
}
}
list.Add(record);
@ -62,7 +62,7 @@ namespace BankBusinessLogic.BusinessLogics
var listConferenceBinding = _conferenceBookingStorage.GetFilteredList(new ConferenceBookingSearchModel
{
HeadwaiterId = model.HeadwaiterId,
ClientId = model.ClientId,
DateFrom = model.DateFrom,
DateTo = model.DateTo
});

View File

@ -15,10 +15,10 @@ namespace BankBusinessLogic.BusinessLogics
private readonly IAdditionsPlanStorage _mealPlanStorage;
private readonly IMemberStorage _memberStorage;
private readonly IConferenceStorage _conferenceStorage;
private readonly AbstractSaveToExcelOrganiser _saveToExcel;
private readonly AbstractSaveToExcelClerc _saveToExcel;
private readonly AbstractSaveToWordClerc _saveToWord;
private readonly AbstractSaveToPdfClerc _saveToPdf;
public ReportLogicOrganiser(IAdditionsPlanStorage mealPlanStorage, IMemberStorage memberStorage, IConferenceStorage conferenceStorage, AbstractSaveToExcelOrganiser saveToExcel, AbstractSaveToWordClerc saveToWord, AbstractSaveToPdfClerc saveToPdf)
public ReportLogicOrganiser(IAdditionsPlanStorage mealPlanStorage, IMemberStorage memberStorage, IConferenceStorage conferenceStorage, AbstractSaveToExcelClerc saveToExcel, AbstractSaveToWordClerc saveToWord, AbstractSaveToPdfClerc saveToPdf)
{
_mealPlanStorage = mealPlanStorage;
_memberStorage = memberStorage;
@ -91,7 +91,7 @@ namespace BankBusinessLogic.BusinessLogics
public void SaveMemberConferenceToExcelFile(ReportBindingModel model)
{
_saveToExcel.CreateReport(new ExcelInfoOrganiser
_saveToExcel.CreateReport(new ExcelInfoClerc
{
FileName = model.FileName,
Title = "Список изделий",

View File

@ -11,6 +11,6 @@ namespace BankContracts.BindingModels
public string FileName { get; set; } = string.Empty;
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public int HeadwaiterId { get; set; }
public int ClientId { get; set; }
}
}

View File

@ -4,7 +4,7 @@ namespace BankContracts.SearchModels
public class ConferenceBookingSearchModel
{
public int? Id { get; set; }
public int? HeadwaiterId { get; set; }
public int? ClientId { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}

View File

@ -8,8 +8,8 @@ namespace BankContracts.ViewModels
{
public class ReportMealPlanDinnerViewModel
{
public string DinnerName { get; set; } = string.Empty;
public List<Tuple<string, DateTime>> MealPlans { get; set; } = new();
public string CreditName { get; set; } = string.Empty;
public List<Tuple<string, DateTime>> Additions { get; set; } = new();
}
}