123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- #pragma warning disable 1591
- #pragma warning disable 0414
- #pragma warning disable 0649
- #pragma warning disable 0169
- namespace HyperCube.Pages
- {
- #line hidden
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.Components;
- #nullable restore
- #line 1 "c:\ProjectHyperCube\_Imports.razor"
- using System.Net.Http;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 2 "c:\ProjectHyperCube\_Imports.razor"
- using Microsoft.AspNetCore.Authorization;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 3 "c:\ProjectHyperCube\_Imports.razor"
- using Microsoft.AspNetCore.Components.Authorization;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 4 "c:\ProjectHyperCube\_Imports.razor"
- using Microsoft.AspNetCore.Components.Forms;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 5 "c:\ProjectHyperCube\_Imports.razor"
- using Microsoft.AspNetCore.Components.Routing;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 6 "c:\ProjectHyperCube\_Imports.razor"
- using Microsoft.AspNetCore.Components.Web;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 7 "c:\ProjectHyperCube\_Imports.razor"
- using Microsoft.AspNetCore.Components.Web.Virtualization;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 8 "c:\ProjectHyperCube\_Imports.razor"
- using Microsoft.JSInterop;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 9 "c:\ProjectHyperCube\_Imports.razor"
- using HyperCube;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 10 "c:\ProjectHyperCube\_Imports.razor"
- using HyperCube.Shared;
- #line default
- #line hidden
- #nullable disable
- #nullable restore
- #line 2 "c:\ProjectHyperCube\Pages\DocsLoad.razor"
- using System.IO;
- #line default
- #line hidden
- #nullable disable
- [Microsoft.AspNetCore.Components.RouteAttribute("/docsload")]
- public partial class DocsLoad : Microsoft.AspNetCore.Components.ComponentBase
- {
- #pragma warning disable 1998
- protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
- {
- }
- #pragma warning restore 1998
- #nullable restore
- #line 42 "c:\ProjectHyperCube\Pages\DocsLoad.razor"
-
- private Models.ArticleModel articleModel = new Models.ArticleModel();
- string status;
- string text;
- private void HandleValidSubmit()
- {
- MySQLConnector dbCon = MySQLConnector.Instance();
- string stringSQL = $"INSERT INTO articles (filename, article_name, authors)" +
- $"VALUES ('{articleModel.Filename}', '{articleModel.Name}', '{articleModel.Author}')";
- long id = dbCon.SQLInsert(stringSQL);
- stringSQL = $"INSERT INTO actions_history (article_id, action_type, acc_id)" +
- $"VALUES ('{id}', {1}, {1})";
- dbCon.SQLInsert(stringSQL);
- dbCon.Close();
- status = "Data sent";
- }
- async Task HandleSelection(InputFileChangeEventArgs e)
- {
- IBrowserFile file = e.File;
- if (file != null)
- {
- status = $"Finished loading {file.Size} bytes from {file.Name}";
-
- DocParse docParse = new DocParse();
- Dictionary<string, string> docFields = await DocParse.ReadPDF(file);
- articleModel.Filename = file.Name;
- articleModel.Name = docFields["name"];
-
- articleModel.Author = docFields["authors"];
- articleModel.Keywords = docFields["keywords"];
- articleModel.Annotation = docFields["annotation"];
- text = docFields["text"];
-
- }
- }
- #line default
- #line hidden
- #nullable disable
- }
- }
- #pragma warning restore 1591
|