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