41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using DataModels.Enums;
|
|
using Xceed.Words.NET;
|
|
|
|
namespace DataModels.Models
|
|
{
|
|
public abstract class AbstractOrder : Model
|
|
{
|
|
protected AbstractOrder(OrderType orderType, Reason reason, int number, Dean? currentDean, DateTime date, List<Student> students)
|
|
{
|
|
OrderType = orderType;
|
|
Reason = reason;
|
|
Number = number;
|
|
CurrentDean = currentDean;
|
|
Date = date;
|
|
Students = students;
|
|
}
|
|
|
|
protected AbstractOrder(int id, OrderType orderType, Reason reason, int number, Dean? currentDean, DateTime date, List<Student> students)
|
|
: this(orderType, reason, number, currentDean, date, students)
|
|
{
|
|
Id = id;
|
|
}
|
|
|
|
public List<Student> Students { get; set; }
|
|
public OrderType OrderType { get; set; }
|
|
public Reason Reason { get; set; }
|
|
public int Number { get; set; }
|
|
public Dean? CurrentDean { get; set; }
|
|
public DateTime Date { get; set; } = DateTime.Now;
|
|
|
|
public abstract string TemplatePath { get; }
|
|
public abstract void FillTemplate(DocX doc);
|
|
public void CreateDocument(string path)
|
|
{
|
|
var doc = DocX.Load(TemplatePath);
|
|
FillTemplate(doc);
|
|
doc.SaveAs(path);
|
|
}
|
|
}
|
|
}
|