Small fixes in Docs
This commit is contained in:
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
using WGneu.Models;
|
||||
|
||||
namespace WGneu.Documents {
|
||||
public class BusinessDocument : Document {
|
||||
public abstract class BusinessDocument : Document {
|
||||
|
||||
public BusinessDocument(string title, Member m) : base(title) {
|
||||
Member = m;
|
||||
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
|
||||
namespace WGneu.Documents {
|
||||
public class Document {
|
||||
public abstract class Document {
|
||||
|
||||
public Document(string title) {
|
||||
Title = title;
|
||||
@ -32,20 +32,13 @@ namespace WGneu.Documents {
|
||||
private async Task<string> Render() {
|
||||
if (this is BusinessLetter bl) {
|
||||
return await Pdf.CompileRenderAsync("BusinessLetter.cshtml", bl);
|
||||
} else if (this is BusinessDocument bd) {
|
||||
return await Pdf.CompileRenderAsync("BusinessDocument.cshtml", bd);
|
||||
} else {
|
||||
return await Pdf.CompileRenderAsync("Document.cshtml", this);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<string> SaveHtml() {
|
||||
await File.WriteAllTextAsync("razor_test.html", await Render());
|
||||
return "";
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
public async Task<string> Save() {
|
||||
await SaveHtml();
|
||||
// TODO tempfile
|
||||
await File.WriteAllTextAsync("razor_test.html", await Render());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace WGneu {
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSqlite("Data Source=\"C:\\Users\\tom\\Projects\\wgneu\\wgtest.sqlite3\"; foreign keys=true");
|
||||
optionsBuilder.UseSqlite("Data Source=\"C:\\Users\\lorenz\\Desktop\\wgtest.sqlite3\"; foreign keys=true");
|
||||
optionsBuilder.UseLazyLoadingProxies();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user