using Ease.Core.Model; using System; using System.Collections.Generic; using System.Data; namespace HRM.BO { public class ConfigReader { private string[] items = null; public List Details { get; } public List Types { get; } public List EnumTypes { get; } public List SQLRelationToEmp { get; } public int TotalTypes { get; } //public static List GetTotalTypes(string sType) //{ // List nTypes = new List(); // string[] items = sType.Split(','); // if (items != null && items.Length > 0) // { // foreach (string item in items) // { // switch (item.ToLower().Trim()) // { // case "grade": // nTypes.Add(EnmSetupManagerTranType.Grade); // break; // case "location": // nTypes.Add(EnmSetupManagerTranType.Location); // break; // case "category": // nTypes.Add(EnmSetupManagerTranType.Category); // break; // case "designation": // nTypes.Add(EnmSetupManagerTranType.Designation); // break; // } // } // } // return nTypes; //} //public ConfigReader(string sType) //{ // items = sType.Split(','); // SetupDetail detail = null; // _sTypes = new List(); // _nTypes = new List(); // _sqlRelationtoEmp = new List(); // if (items != null && items.Length > 0) // { // _SetupDetails = new List(); // foreach (string item in items) // { // switch (item.ToLower().Trim()) // { // case "grade": // _sTypes.Add("Grade"); // _nTypes.Add(EnmSetupManagerTranType.Grade); // _totalType++; // _sqlRelationtoEmp.Add(" SD.TranType=1 AND E.GradeID= SD.TranID"); // List oGrades = Grade.Get(EnumStatus.Active); // foreach (Grade grade in oGrades) // { // detail = new SetupDetail(); // detail.Code = grade.Code; // detail.Name = grade.Name; // detail.IsSelected = false; // detail.TranID = grade.ID; // detail.TranType = EnmSetupManagerTranType.Grade; // _SetupDetails.Add(detail); // } // break; // case "location": // _totalType++; // _sTypes.Add("Location"); // _nTypes.Add(EnmSetupManagerTranType.Location); // _sqlRelationtoEmp.Add(" SD.TranType=2 AND E.LocationID= SD.TranID"); // List oLocations = Location.GetByTier(3); // foreach (Location olocation in oLocations) // { // detail = new SetupDetail(); // detail.Code = olocation.Code; // detail.Name = olocation.Name; // detail.IsSelected = false; // detail.TranID = olocation.ID; // detail.TranType = EnmSetupManagerTranType.Location; // _SetupDetails.Add(detail); // } // break; // case "category": // _sTypes.Add("Category"); // _nTypes.Add(EnmSetupManagerTranType.Category); // _totalType++; // _sqlRelationtoEmp.Add(" SD.TranType=3 AND E.CategoryID= SD.TranID"); // List oCategorys = Category.Get(EnumStatus.Active); // foreach (Category ocat in oCategorys) // { // detail = new SetupDetail(); // detail.Code = ocat.Code; // detail.Name = ocat.Name; // detail.IsSelected = false; // detail.TranID = ocat.ID; // detail.TranType = EnmSetupManagerTranType.Category; // _SetupDetails.Add(detail); // } // break; // case "designation": // _sTypes.Add("Designation"); // _nTypes.Add(EnmSetupManagerTranType.Designation); // _totalType++; // _sqlRelationtoEmp.Add(" SD.TranType=4 AND E.DesignationID= SD.TranID"); // List oDesignations = Designation.Get(EnumStatus.Active); // foreach (Designation oDesg in oDesignations) // { // detail = new SetupDetail(); // detail.Code = oDesg.Code; // detail.Name = oDesg.Name; // detail.IsSelected = false; // detail.TranID = oDesg.ID; // detail.TranType = EnmSetupManagerTranType.Designation; // _SetupDetails.Add(detail); // } // break; // } // } // } //} } }