52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using InternshipSystem.Core.ValueObject;
|
|
|
|
namespace InternshipSystem.Core.Entity.Internship
|
|
{
|
|
public class Internship
|
|
{
|
|
public long Id { get; set; }
|
|
public Student Student { get; set; }
|
|
public InternshipRegistration InternshipRegistration { get; set; }
|
|
public Report Report { get; set; }
|
|
public List<Document> Documentation { get; set; }
|
|
|
|
public Edition Edition { get; set; }
|
|
|
|
public float? Grade { get; set; }
|
|
|
|
public static Internship CreateStudentsInternship(Student student)
|
|
{
|
|
var internship = new Internship();
|
|
|
|
internship.Student = student;
|
|
|
|
internship.InternshipRegistration = InternshipRegistration.Create();
|
|
internship.Report = Report.Create();
|
|
internship.Documentation = new List<Document>();
|
|
|
|
return internship;
|
|
}
|
|
|
|
public void AddNewDocument(string description, DocumentType type)
|
|
{
|
|
var document = new Document
|
|
{
|
|
Description = description,
|
|
Type = type,
|
|
State = DocumentState.Draft
|
|
};
|
|
|
|
Documentation.Add(document);
|
|
}
|
|
|
|
public void UpdateDocumentScan(long documentId, byte[] documentScan)
|
|
{
|
|
var document = Documentation.First(d => d.Id == documentId);
|
|
|
|
// document.Scan = documentScan;
|
|
// document.State = DocumentState.Submitted;
|
|
}
|
|
}
|
|
} |