using Ease.Core.Model; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.IO; using System.Reflection; namespace HRM.BO { #region Class TrainingNeedAnalysis [Serializable] public class TrainingNeedAnalysis : AuditTrailBase { #region Constructor public TrainingNeedAnalysis() { TrainingYear = 0; Name = string.Empty; DepartmentID = 0; EmployeeID = 0; TrainingID = 0; Description = string.Empty; MaxParticipent = 0; // _schedule = string.Empty; Conduct_Required = 0; } #endregion #region Properties public int TrainingYear { get; set; } public int EmployeeID { get; set; } public Employee Employee { get; set; } public int TrainingID { get; set; } public Training Training { get; set; } public int DepartmentID { get; set; } public string Description { get; set; } public string Name { get; set; } public int MaxParticipent { get; set; } public double Conduct_Required { get; set; } //#region Property Schedule : string //private string _schedule; //public string Schedule //{ // get // { // return _schedule; // } // set // { // _schedule = value; // } //} //#endregion public List TrainingDepartments { get; set; } public List TrainingEmployee { get; set; } public List TrainingNdAnalysisTimeSchs { get; set; } #endregion //#region Functions //public static TrainingNeedAnalysis Get(int nTrainingNeedAnalysisID) //{ // TrainingNeedAnalysis oTrainingNeedAnalysis = null; // #region Cache Header // oTrainingNeedAnalysis = (TrainingNeedAnalysis)_cache["Get", nTrainingNeedAnalysisID]; // if (oTrainingNeedAnalysis != null) // return oTrainingNeedAnalysis; // #endregion // oTrainingNeedAnalysis = TrainingNeedAnalysis.Service.Get(ID.FromInteger(nTrainingNeedAnalysisID)); // #region Cache Footer // _cache.Add(oTrainingNeedAnalysis, "Get", nTrainingNeedAnalysisID); // #endregion // return oTrainingNeedAnalysis; //} //public ID Save() //{ // this.SetAuditTrailProperties(); // return TrainingNeedAnalysis.Service.Save(this); //} //public static void Delete(ID id) //{ // TrainingNeedAnalysis.Service.Delete(id); //} //public static string GetStatus(TrainingNeedAnalysis oTNA) //{ // string status = string.Empty; // if (oTNA.TrainingID > 0) // { // ObjectsTemplate oTrainingSch = TrainingSchedule.Get(oTNA.TrainingID, oTNA.ID.Integer, true); // if (oTrainingSch.Count > 0) // { // //int left = oTNA.TrainingNdAnalysisTimeSchs.Count - oTrainingSch.Count; // status = "Scheduled (" + oTrainingSch.Count + ")"; // } // else // { // status = "Not Schedule"; // } // } // else // { // status = "Training Not Available"; // } // return status; //} //#endregion //#region Collection Functions //public static ObjectsTemplate Get() //{ // ObjectsTemplate oTrainingNeedAnalysiss = null; // #region Cache Header // oTrainingNeedAnalysiss = (ObjectsTemplate)_cache["Get"]; // if (oTrainingNeedAnalysiss != null) // return oTrainingNeedAnalysiss; // #endregion // oTrainingNeedAnalysiss = TrainingNeedAnalysis.Service.Get(); // #region Cache Footer // _cache.Add(oTrainingNeedAnalysiss, "Get"); // #endregion // return oTrainingNeedAnalysiss; //} //public string GetTimeschedule(int year) //{ // string str = ""; // int nCount = 0; // foreach (TrainingNdAnalysisTimeSch item in this.TrainingNdAnalysisTimeSchs) // { // nCount = nCount + 1; // str = str + item.Month.ToString() + " " + year.ToString(); // if (nCount != this.TrainingNdAnalysisTimeSchs.Count) // str = str + ", "; // } // return str; //} //public string GetDepartmetns() //{ // string str = ""; // int nCount = 0; // foreach (TrainingDepartment item in this.TrainingDepartments) // { // nCount = nCount + 1; // Department od = Department.Get(item.DepartmentID); // str = str + od.Name.ToString(); // if (nCount != this.TrainingNdAnalysisTimeSchs.Count) // str = str + ", "; // } // return str; //} //public static ObjectsTemplate GetByYear(int year) //{ // ObjectsTemplate oTrainingNeedAnalysiss = null; // #region Cache Header // oTrainingNeedAnalysiss = (ObjectsTemplate)_cache["Get"]; // if (oTrainingNeedAnalysiss != null) // return oTrainingNeedAnalysiss; // #endregion // oTrainingNeedAnalysiss = TrainingNeedAnalysis.Service.GetByYear(year); // #region Cache Footer // _cache.Add(oTrainingNeedAnalysiss, "Get"); // #endregion // return oTrainingNeedAnalysiss; //} //public static ObjectsTemplate GetByParam(int year, string sEmpIDs, string sDeptForIDs) //{ // ObjectsTemplate oTrainingNeedAnalysiss = null; // #region Cache Header // oTrainingNeedAnalysiss = (ObjectsTemplate)_cache["Get"]; // if (oTrainingNeedAnalysiss != null) // return oTrainingNeedAnalysiss; // #endregion // oTrainingNeedAnalysiss = TrainingNeedAnalysis.Service.GetByParam(year, sEmpIDs, sDeptForIDs); // #region Cache Footer // _cache.Add(oTrainingNeedAnalysiss, "Get"); // #endregion // return oTrainingNeedAnalysiss; //} //#endregion //#region Service Factory //internal static ITrainingNeedAnalysisService Service //{ // get // { // return Services.Factory.CreateService(typeof(ITrainingNeedAnalysisService)); // } //} //#endregion //public static ObjectsTemplate Get(string query) //{ // ObjectsTemplate oTrainingNeedAnalysiss = null; // #region Cache Header // oTrainingNeedAnalysiss = (ObjectsTemplate)_cache["Get"]; // if (oTrainingNeedAnalysiss != null) // return oTrainingNeedAnalysiss; // #endregion // oTrainingNeedAnalysiss = TrainingNeedAnalysis.Service.Get(query); // #region Cache Footer // _cache.Add(oTrainingNeedAnalysiss, "Get"); // #endregion // return oTrainingNeedAnalysiss; //} //public static TrainingNeedAnalysis GetByEmployeeID(string employeeNo) //{ // return TrainingNeedAnalysis.Service.GetByEmployeeID(employeeNo); //} //#region Subordinate Function //public static SubordinateTrainee SubordinateGet(ID id) //{ // return TrainingNeedAnalysis.Service.SubordinateGet(id); //} //public static ObjectsTemplate SubordinateGet() //{ // return TrainingNeedAnalysis.Service.SubordinateGet(); //} //public static ObjectsTemplate GetByTrainingNeedAnalysisID(ID trainingNeedAnalysisID) //{ // return TrainingNeedAnalysis.Service.GetByTrainingNeedAnalysisID(trainingNeedAnalysisID); //} //#endregion //public static TrainingNeedAnalysis IsExist(ID trainingID) //{ // return TrainingNeedAnalysis.Service.IsExist(trainingID); //} } #endregion #region Class SubordinateTrainee public class SubordinateTrainee : BasicBaseObject { #region Constructor public SubordinateTrainee() { TrainingNeedAnalysisID = 0; EmployeeID = 0; Remarks = string.Empty; } #endregion #region Properties public int TrainingNeedAnalysisID { get; set; } public int EmployeeID { get; set; } public string Remarks { get; set; } #endregion } #endregion #region ITrainingNeedAnalysisService Service public interface ITrainingNeedAnalysisService { TrainingNeedAnalysis Get(int id); TrainingNeedAnalysis GetByEmployeeID(string employeeNo); List Get(); List GetByYear(int year); List Get(string query); int Save(TrainingNeedAnalysis oTrainingNeedAnalysis); void Delete(int id); List Get(int trainingID, int departmentID, int departmentForID, int trainingType); List GetByParam(int year, string sDeptIDs, string sDeptForIDs); #region Subordinate Interface SubordinateTrainee SubordinateGet(int id); List SubordinateGet(); List GetByTrainingNeedAnalysisID(int trainingNeedAnalysisID); #endregion TrainingNeedAnalysis IsExist(int trainingID); } #endregion }