//------------------------------------------------------------------------------
//
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
//
//------------------------------------------------------------------------------
namespace Fab2ApprovalSystem.Models
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Fab2ApprovalSystem.DMO;
public partial class Training
{
public int TrainingID { get; set; }
public int ECN { get; set; }
public Nullable StartedDate { get; set; }
public Nullable CompletedDate { get; set; }
public Nullable Status { get; set; }
public Nullable Deleted { get; set; }
public Nullable DeletedDate { get; set; }
[NotMapped]
public string Title
{
get
{
ECN_DMO ecnDMO = new ECN_DMO();
string ECNTitle = ecnDMO.GetECN(ECN).Title;
return ECNTitle;
}
}
[NotMapped]
public string ECNTrainingGroups
{
get
{
ECN_DMO ecnDMO = new ECN_DMO();
TrainingDMO trainingDMO = new TrainingDMO();
ECN ecn = ecnDMO.GetECN(ECN);
List trainingGroupIDs = trainingDMO.GetECNAssignedTrainingGroups(ECN);
string groupNames = "";
foreach (int groupId in trainingGroupIDs)
{
string groupName = trainingDMO.GetTrainingGroupByID(groupId).TrainingGroupName;
groupNames += groupName + ",";
}
return groupNames;
}
}
}
}