Сделал красивую табличку (тока кнопки до сих пор не очень красиво) :(
This commit is contained in:
parent
8b8ffbcb32
commit
c967df43b3
@ -670,8 +670,8 @@ namespace HostrelHeadwaiterApp.Controllers
|
|||||||
APIClient.PostRequest("api/report/SendPdfToMail", new MailSendInfoBindingModel
|
APIClient.PostRequest("api/report/SendPdfToMail", new MailSendInfoBindingModel
|
||||||
{
|
{
|
||||||
MailAddress = headwaiterEmail,
|
MailAddress = headwaiterEmail,
|
||||||
Subject = "Отчет по участникам (pdf)",
|
Subject = "Отчет по обедам (pdf)",
|
||||||
Text = "Отчет по участникам с " + dateFrom.ToShortDateString() + " до " + dateTo.ToShortDateString()
|
Text = "Отчет по обедам с " + dateFrom.ToShortDateString() + " до " + dateTo.ToShortDateString()
|
||||||
});
|
});
|
||||||
Response.Redirect("ListDinnersToPdfFile");
|
Response.Redirect("ListDinnersToPdfFile");
|
||||||
}
|
}
|
||||||
@ -700,45 +700,41 @@ namespace HostrelHeadwaiterApp.Controllers
|
|||||||
}
|
}
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
string table = "";
|
string table = "";
|
||||||
table += $"<h2 class=\"u-text u-text-custom-color-1 u-text-default u-text-1\">Предварительный отчет</h2>";
|
table += "<h2 class=\"text-custom-color-1\">Предварительный отчет</h2>";
|
||||||
table += $"<table class=\"u-table-entity\">";
|
table += "<div class=\"table-responsive\">";
|
||||||
table += "<colgroup>";
|
table += "<table class=\"table table-striped table-bordered table-hover\">";
|
||||||
table += "<col width=\"20%\" />";
|
table += "<thead class=\"table-dark\">";
|
||||||
table += "<col width=\"20%\" />";
|
table += "<tr>";
|
||||||
table += "<col width=\"20%\" />";
|
table += "<th scope=\"col\">Обед</th>";
|
||||||
table += "<col width=\"20%\" />";
|
table += "<th scope=\"col\">Имя комнаты</th>";
|
||||||
table += "<col width=\"20%\" />";
|
table += "<th scope=\"col\">Цена комнаты</th>";
|
||||||
table += "</colgroup>";
|
table += "<th scope=\"col\">Название зала</th>";
|
||||||
table += "<thead class=\"u-custom-color-1 u-table-header u-table-header-1\">";
|
table += "<th scope=\"col\">Дата броинирования</th>";
|
||||||
table += "<tr style=\"height: 31px\">";
|
|
||||||
table += $"<th class=\"u-border-1 u-border-grey-50 u-table-cell\">Обед</th>";
|
|
||||||
table += $"<th class=\"u-border-1 u-border-grey-50 u-table-cell\">Имя комнаты</th>";
|
|
||||||
table += $"<th class=\"u-border-1 u-border-grey-50 u-table-cell\">Цена комнаты</th>";
|
|
||||||
table += $"<th class=\"u-border-1 u-border-grey-50 u-table-cell\">Название зала</th>";
|
|
||||||
table += $"<th class=\"u-border-1 u-border-grey-50 u-table-cell\">Дата броинирования</th>";
|
|
||||||
table += "</tr>";
|
table += "</tr>";
|
||||||
table += "</thead>";
|
table += "</thead>";
|
||||||
foreach (var report in result)
|
foreach (var report in result)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool IsCost = true;
|
bool IsCost = true;
|
||||||
if (report.RoomPrice.ToString() == "0")
|
if (report.RoomPrice == 0)
|
||||||
{
|
{
|
||||||
IsCost = false;
|
IsCost = false;
|
||||||
}
|
}
|
||||||
table += "<tbody class=\"u-table-body\">";
|
table += "<tbody>";
|
||||||
table += "<tr style=\"height: 75px\">";
|
table += "<tr>";
|
||||||
table += $"<td class=\"u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell\">{report.DinnerName}</td>";
|
table += $"<td>{report.DinnerName}</td>";
|
||||||
table += $"<td class=\"u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell\">{report.RoomName}</td>";
|
table += $"<td>{report.RoomName}</td>";
|
||||||
table += $"<td class=\"u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell\">{(IsCost is true ? report.RoomPrice.ToString() : string.Empty)}</td>";
|
table += $"<td>{(IsCost ? report.RoomPrice.ToString() : string.Empty)}</td>";
|
||||||
table += $"<td class=\"u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell\">{report.NameHall}</td>";
|
table += $"<td>{report.NameHall}</td>";
|
||||||
table += $"<td class=\"u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell\">{report.BookingDate}</td>";
|
table += $"<td>{report.BookingDate?.ToShortDateString()}</td>";
|
||||||
table += "</tr>";
|
table += "</tr>";
|
||||||
table += "</tbody>";
|
table += "</tbody>";
|
||||||
sum += report.RoomPrice;
|
sum += report.RoomPrice;
|
||||||
}
|
}
|
||||||
|
table += "<tfoot class=\"table-secondary\">";
|
||||||
|
table += $"<tr><th colspan=\"2\">Итого:</th><th>{sum}</th><th colspan=\"2\"></th></tr>";
|
||||||
|
table += "</tfoot>";
|
||||||
table += "</table>";
|
table += "</table>";
|
||||||
table += $"<h2 class=\"u-text u-text-custom-color-1 u-text-default u-text-1\">Итого: {sum}</h2>";
|
table += "</div>";
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user