-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.cshtml.cs
24 lines (23 loc) · 1.05 KB
/
Test.cshtml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using MySql.Data.MySqlClient;
using System.Security.Claims;
namespace pdftest.Pages
{
[Authorize]
[IgnoreAntiforgeryToken]
public class TestModel : PageModel
{
public FileResult OnPostSendQuestions(int[] questionIds, string ticket, string school, string speciality, bool answerList)
{
DbOperations.IncreaseGeneratedTestsCount();
string ticketDescription = DbOperations.GetTicketDescription(DbOperations.GetSpecialityId(speciality), int.Parse(ticket));
Console.WriteLine(answerList);
questionIds = questionIds.Where(x => x != 0).ToArray();
//byte[] pdfBytes = PdfOperatons.CreateDocument(questionIds, ticket, school, speciality, ticketDescription);
byte[] pdfBytes = MigraGenerate.Generate(questionIds, ticket, school, speciality, ticketDescription, answerList);
return File(pdfBytes, "application/pdf", "PDFTest.pdf");
}
}
}