EchoTex_Payroll/HRM.BO/Common/SystemDataUpload.cs
2024-10-14 10:01:49 +06:00

5194 lines
344 KiB
C#

using Ease.Core.Model;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.BO
{
public abstract class ImportFileBase
{
}
public class SystemDataUpload : ImportFileBase
{
private List<UploadErrorOrSuccess> _errorOrSuccessList;
private DataTable _uplodedData;
private DataSet _uploadHRData;
private DataSet _upLoadCVData;
private BonusProcess _BonusProcess = null;
private List<EmpLifeCycle> _EmpLifeCycles = null;
private HREmployee _HREmployee = new HREmployee();
private CV _CV = new CV();
//public event ProgressStatus ProgressStatus;
//public event ProcessStatus ProcessStatus;
private List<HREmployee> _HREmployees = null;
//private List<Religion> _Religions = null;
//private List<Category> _Categories = null;
private List<Occupation> _Occupations = null;
private List<Nationality> _Nationalites = null;
private List<District> _Districts = null;
private List<Thana> _Thanas = null;
private List<Relation> _Relations = null;
private List<EducationLevel> _EducationLevels = null;
private List<NatureOfTraining> _NatureOfTrainings = null;
private List<Institution> _Institutions = null;
private List<Country> _Contries = null;
private List<EducationType> _EducationTypes = null;
private List<Discipline> _Disciplines = null;
private List<ResultType> _ResultTypes = null;
private List<NominationPurpose> _NominationPurposes = null;
private List<GuarantorDocumentType> _GuarantorDocumentTypes = null;
private List<TrainingType> _TrainingTypes = null;
private List<HRJoiningQuestionary> _HRJoiningQuestionaries = null;
private List<EmployeeTaxInvestment> _EmployeeTaxInvestments = null;
private List<TaxChallan> _TaxChallans = null;
//private List<Designation> _Designations = null;
private List<EmpLifeCycle> _oLifeCyles = null;
//List<Department> _oDepartments = new List<Department>();
//List<Grade> _oGrades = new List<Grade>();
//List<GradeSegment> _oGradeSegments = new List<GradeSegment>();
//List<Location> _oLocations = new List<Location>();
//List<Designation> _oDesignations = new List<Designation>();
//List<Company> _oCompanys = new List<Company>();
//List<Category> _oCategorys = new List<Category>();
//List<Costcenter> _oCostcenters = new List<Costcenter>();
//List<Function> _oFunctions = new List<Function>();
List<OrganogramBasic> _oOrganogramNodes = new List<OrganogramBasic>();
List<HREmployee> oExistingHREmployees = new List<HREmployee>();
int nOrgRowCount;
List<HREmployee> _CheckHREmployees = null;
private BonusProcess _ProssBonus;
//private void UpdateProgressStatus(EnumProcessStatus status)
//{
// if (ProgressStatus != null) ProgressStatus(status);
//}
//private void UpdateprocessStatus(string statusString)
//{
// if (ProcessStatus != null) ProcessStatus(statusString);
//}
//public List<HREmployee> UploadEmployeeData(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, bool fromView, DataUploadColumnDefinition columnDefination, string sFileName, int nType)
//{
// List<HREmployee> oHREmployees = new List<HREmployee>();
// List<HREmployee> oTempHREmployees = new List<HREmployee>();
// List<EmpSpouse> oTempEmpSpouses = new List<EmpSpouse>();
// DataTable dt = null;
// DataTable oDTable = new DataTable();
// UpdateprocessStatus("Read data from view ....");
// this.GetUploadData(oErrorLogDetails, oSuccessLogDetails, columnDefination, sFileName, fromView, nType);
// if (nType == 5)
// {
// UpdateprocessStatus("Checking column validation ....");
// CheckValidation(oErrorLogDetails, oSuccessLogDetails);
// //CheckOrganogramValidation(oErrorLogDetails, oSuccessLogDetails);
// //CheckChangeNodePositionValidation(oErrorLogDetails, oSuccessLogDetails);
// //CheckOrganogramPostingValidation(oErrorLogDetails, oSuccessLogDetails);
// //CheckAssignMatrixLineAuthority(oErrorLogDetails, oSuccessLogDetails);
// }
// else
// {
// UpdateprocessStatus("Checking column validation ....");
// if (nType == 1)
// CheckValidation(oErrorLogDetails, oSuccessLogDetails);
// else if (nType == 2)
// CheckOrganogramValidation(oErrorLogDetails, oSuccessLogDetails);
// else if (nType == 3)
// CheckChangeNodePositionValidation(oErrorLogDetails, oSuccessLogDetails);
// else if (nType == 4)
// CheckOrganogramPostingValidation(oErrorLogDetails, oSuccessLogDetails);
// else
// CheckAssignMatrixLineAuthority(oErrorLogDetails, oSuccessLogDetails);
// }
// if (oErrorLogDetails.Count > 0)
// {
// return new List<HREmployee>();
// }
// UpdateprocessStatus("Checking basic data ....");
// string ss = "";
// try
// {
// if (nType == 5)
// {
// #region Excel Code
// //this.CheckBasicData(oErrorLogDetails, oSuccessLogDetails, fromView);
// //if (oErrorLogDetails.Count > 0)
// //{
// // return new List<HREmployee>();
// //}
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 25;
// //PayrollPayrollGlobalFunctions.TotalEmployeeCount = _uploadHRData.Tables[0].Rows.Count;
// //UpdateprocessStatus("Collecting existing basic data ....");
// //this.UpdateProgressStatus(EnumProcessStatus.Start);
// //oExistingHREmployees = HREmployee.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Religions = Religion.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Categories = Category.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Occupations = Occupation.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Nationalites = Nationality.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Districts = District.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Thanas = Thana.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Relations = Relation.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_EducationLevels = EducationLevel.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_NatureOfTrainings = NatureOfTraining.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Institutions = Institution.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Contries = Country.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_EducationTypes = EducationType.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_Disciplines = Discipline.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_ResultTypes = ResultType.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_NominationPurposes = NominationPurpose.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_GuarantorDocumentTypes = GuarantorDocumentType.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_TrainingTypes = TrainingType.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_HRJoiningQuestionaries = HRJoiningQuestionary.Get(EnumStatus.Active);
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_HREmployee = new HREmployee();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_oDepartments = Department.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_oDesignations = Designation.Get(EnumStatus.Regardless);
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_oLocations = Location.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_oGrades = Grade.Get(EnumStatus.Regardless);
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //_oGradeSegments = GradeSegment.Get(EnumStatus.Regardless);
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //this.UpdateProgressStatus(EnumProcessStatus.End);
// //UpdateprocessStatus("Checking data validation....");
// //if (fromView)
// // oDTable = _uploadHRData.Tables["View_General"];
// //else
// // oDTable = _uploadHRData.Tables["General"];
// //ss = "None";
// //oTempHREmployees = this.ImportEmpGeneralInfoForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// //ss = "Employee Passed";
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 1;
// //UpdateprocessStatus("Collecting organogram data ....");
// //this.UpdateProgressStatus(EnumProcessStatus.Start);
// //_oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //this.UpdateProgressStatus(EnumProcessStatus.End);
// //this.ImportOrganogramForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// //ss = "Create Organogram Passed";
// ////new List<HREmployee>();
// ////_oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// ////this.ImportAssignMatrixLineAuthorityForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// //_oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// //this.ImportChangePositionForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// //ss = "Change Node Passed";
// //new List<HREmployee>();
// ////_oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// ////this.CheckOrganogramData(oErrorLogDetails, oSuccessLogDetails, fromView);
// ////this.ImportPostingForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// ////ss = "Posting Passed";
// ////new List<HREmployee>();
// ////string sQuery = "UPDATE EMPLOYEE SET [STATUS] = 2 WHERE EMPLOYEEID NOT IN(SELECT EMPLOYEEID FROM OrganEmployee)";
// ////new HREmployee().UpdateQuery(sQuery);
// ////if (oErrorLogDetails.Count > 0)
// ////{
// // return new List<HREmployee>();
// //}
// #endregion
// }
// else
// {
// if (nType == 1)
// {
// UpdateprocessStatus("Checking data validation....");
// if (oErrorLogDetails.Count > 0)
// {
// return new List<HREmployee>();
// }
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 24;
// PayrollPayrollGlobalFunctions.TotalEmployeeCount = _uploadHRData.Tables[0].Rows.Count;
// UpdateprocessStatus("Collecting existing basic data ....");
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// _Religions = Religion.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Categories = Category.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Occupations = Occupation.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Nationalites = Nationality.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Districts = District.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Thanas = Thana.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Relations = Relation.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _EducationLevels = EducationLevel.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _NatureOfTrainings = NatureOfTraining.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Institutions = Institution.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Contries = Country.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _EducationTypes = EducationType.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Disciplines = Discipline.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _ResultTypes = ResultType.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _NominationPurposes = NominationPurpose.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _GuarantorDocumentTypes = GuarantorDocumentType.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _TrainingTypes = TrainingType.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _HRJoiningQuestionaries = HRJoiningQuestionary.Get(EnumStatus.Active);
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _HREmployee = new HREmployee();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oDepartments = Department.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oDesignations = Designation.Get(EnumStatus.Regardless);
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oLocations = Location.Get();
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oGrades = Grade.Get(EnumStatus.Active);
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oGradeSegments = GradeSegment.Get(EnumStatus.Regardless);
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// this.UpdateProgressStatus(EnumProcessStatus.End);
// if (fromView)
// oDTable = _uploadHRData.Tables["View_General"];
// else
// oDTable = _uploadHRData.Tables["General"];
// }
// if (oErrorLogDetails.Count == 0 && nType == 1)
// {
// this.ImportEmpGeneralInfoForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// oTempHREmployees=new List<HREmployee>();
// }
// else if (oErrorLogDetails.Count == 0 && nType == 2)
// {
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 1;
// UpdateprocessStatus("Collecting organogram data ....");
// this.ImportOrganogramForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// //_oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// //this.CheckOrganogramData(oErrorLogDetails, oSuccessLogDetails, fromView);
// //if (oErrorLogDetails.Count > 0)
// //{
// // return new List<HREmployee>();
// //}
// //this.ImportPostingForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// //oTempHREmployees = new List<HREmployee>();
// //new List<HREmployee>();
// }
// else if (oErrorLogDetails.Count == 0 && nType == 4)
// {
// _oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// this.ImportChangePositionForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// oTempHREmployees = new List<HREmployee>();
// }
// else if (oErrorLogDetails.Count == 0 && nType == 3)
// {
// _oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// //this.CheckOrganogramData(oErrorLogDetails, oSuccessLogDetails, fromView);
// //if (oErrorLogDetails.Count > 0)
// //{
// // return new List<HREmployee>();
// //}
// this.ImportPostingForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// oTempHREmployees = new List<HREmployee>();
// }
// else if (oErrorLogDetails.Count == 0 && nType == 9)
// {
// _oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// this.ImportAssignMatrixLineAuthorityForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, fromView);
// oTempHREmployees = new List<HREmployee>();
// }
// }
// return oTempHREmployees;
// }
// catch (Exception exp)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + exp.Message + ss, new HREmployee(), EnumErrorType.Exception);
// return oTempHREmployees;
// }
//}
//public List<HREmployee> UploadEmployeeData2(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataUploadColumnDefinition columnDefination)
//{
// List<HREmployee> oHREmployees = new List<HREmployee>();
// List<HREmployee> oTempHREmployees = new List<HREmployee>();
// List<EmpSpouse> oTempEmpSpouses = new List<EmpSpouse>();
// DataTable dt = null;
// DataTable oDTable = new DataTable();
// // UpdateprocessStatus("Read data from view ....");
// this.GetUploadData2(oErrorLogDetails, oSuccessLogDetails, columnDefination);
// //if (nType == 1)
// CheckValidation(oErrorLogDetails, oSuccessLogDetails);
// //else if (nType == 2)
// CheckOrganogramValidation(oErrorLogDetails, oSuccessLogDetails);
// // else if (nType == 3)
// CheckChangeNodePositionValidation(oErrorLogDetails, oSuccessLogDetails);
// //else if (nType == 4)
// CheckOrganogramPostingValidation(oErrorLogDetails, oSuccessLogDetails);
// if (oErrorLogDetails.Count > 0)
// {
// return new List<HREmployee>();
// }
// //UpdateprocessStatus("Checking basic data ....");
// try
// {
// //if (nType == 1)
// //{
// this.CheckBasicData2(oErrorLogDetails, oSuccessLogDetails);
// if (oErrorLogDetails.Count > 0)
// {
// return new List<HREmployee>();
// }
// // PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 24;
// // PayrollPayrollGlobalFunctions.TotalEmployeeCount = _uploadHRData.Tables[0].Rows.Count;
// //UpdateprocessStatus("Collecting existing basic data ....");
// //this.UpdateProgressStatus(EnumProcessStatus.Start);
// oExistingHREmployees = HREmployee.Get();
// _Religions = Religion.Get();
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Categories = Category.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Occupations = Occupation.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Nationalites = Nationality.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Districts = District.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Thanas = Thana.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Relations = Relation.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _EducationLevels = EducationLevel.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _NatureOfTrainings = NatureOfTraining.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Institutions = Institution.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Contries = Country.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _EducationTypes = EducationType.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _Disciplines = Discipline.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _ResultTypes = ResultType.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _NominationPurposes = NominationPurpose.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _GuarantorDocumentTypes = GuarantorDocumentType.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _TrainingTypes = TrainingType.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _HRJoiningQuestionaries = HRJoiningQuestionary.Get(EnumStatus.Active);
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _HREmployee = new HREmployee();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oDepartments = Department.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oDesignations = Designation.Get(EnumStatus.Regardless);
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oLocations = Location.Get();
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oGrades = Grade.Get(EnumStatus.Regardless);
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// _oGradeSegments = GradeSegment.Get(EnumStatus.Regardless);
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// // this.UpdateProgressStatus(EnumProcessStatus.End);
// // UpdateprocessStatus("Checking data validation....");
// // if (fromView)
// oDTable = _uploadHRData.Tables["View_General"];
// //else
// // oDTable = _uploadHRData.Tables["General"];
// //}
// //if (oErrorLogDetails.Count == 0 && nType == 1)
// //{
// oTempHREmployees = this.ImportEmpGeneralInfoForBRAC2(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData);
// //}
// //else if (oErrorLogDetails.Count == 0 && nType == 2)
// //{
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 1;
// //UpdateprocessStatus("Collecting organogram data ....");
// //this.UpdateProgressStatus(EnumProcessStatus.Start);
// _oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //this.UpdateProgressStatus(EnumProcessStatus.End);
// this.ImportOrganogramForBRAC2(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData);
// //new List<HREmployee>();
// //}
// //else if (oErrorLogDetails.Count == 0 && nType == 3)
// //{
// //_oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// this.ImportChangePositionForBRAC2(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData);
// //new List<HREmployee>();
// //}
// //else if (oErrorLogDetails.Count == 0 && nType == 4)
// //{
// //_oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// this.CheckOrganogramData2(oErrorLogDetails, oSuccessLogDetails, true);
// if (oErrorLogDetails.Count > 0)
// {
// return new List<HREmployee>();
// }
// this.ImportPostingForBRAC(oDTable, oErrorLogDetails, oSuccessLogDetails, _uploadHRData, true);
// new List<HREmployee>();
// //}
// return oTempHREmployees;
// }
// catch (Exception exp)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + exp.Message, new HREmployee(), EnumErrorType.Exception);
// return oTempHREmployees;
// }
//}
////public void GetUploadData(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataUploadColumnDefinition oColumnDefination, string path, bool fromView, int nType)
////{
//// try
//// {
//// _uploadHRData = new DataSet();
//// if (fromView)
//// {
//// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 100;
//// UpdateProgressStatus(EnumProcessStatus.Start);
//// UpdateprocessStatus("Collecting data from view....");
//// _uploadHRData = RegularDataUpload.Service.LoadViewData();
//// UpdateProgressStatus(EnumProcessStatus.End);
//// #region Remove leading zeros
//// if (nType == 1)
//// {
//// foreach (DataRow dr in _uploadHRData.Tables["View_General"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["View_Academic"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["View_Punishment"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["View_PublicationAward"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["View_Training"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["View_Experience"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// }
//// else if(nType == 2)
//// {
//// foreach (DataRow dr in _uploadHRData.Tables["View_Organogram"].Rows)
//// {
//// try
//// {
//// if (dr["Position_No"].ToString() != "")
//// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
//// if (dr["Parent_Position_No"].ToString() != "")
//// dr["Parent_Position_No"] = (Convert.ToInt64(dr["Parent_Position_No"].ToString())).ToString();
//// }
//// catch { }
//// }
//// }
//// else if (nType == 3)
//// {
//// foreach (DataRow dr in _uploadHRData.Tables["View_OrganogramPosting"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// if (dr["Position_No"].ToString() != "")
//// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
//// }
//// catch { }
//// }
//// }
//// else if (nType == 4)
//// {
//// foreach (DataRow dr in _uploadHRData.Tables["View_ChangeNodePosition"].Rows)
//// {
//// try
//// {
//// if (dr["Position_No"].ToString() != "")
//// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
//// if (dr["Parent_Position_No"].ToString() != "")
//// dr["Parent_Position_No"] = (Convert.ToInt64(dr["Parent_Position_No"].ToString())).ToString();
//// }
//// catch { }
//// }
//// }
//// else if (nType == 9)
//// {
//// foreach (DataRow dr in _uploadHRData.Tables["View_AssignMatrixLineAuthority"].Rows)
//// {
//// try
//// {
//// if (dr["Position_No"].ToString() != "")
//// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
//// if (dr["Matrix_Position_No"].ToString() != "")
//// dr["Matrix_Position_No"] = (Convert.ToInt64(dr["Matrix_Position_No"].ToString())).ToString();
//// }
//// catch { }
//// }
//// }
//// #endregion
//// }
//// else
//// {
//// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 8;
//// UpdateProgressStatus(EnumProcessStatus.Start);
//// UpdateprocessStatus("Collecting data from file : " + path);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "General");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "SpouseWorkingBRAC");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "Academic");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "Experience");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "Training");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "PublicationAward");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "Punishment");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "PromotionTransferHistory");
//// _uploadHRData.Tables.Add(_uplodedData);
//// foreach (DataRow dr in _uploadHRData.Tables["General"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["Academic"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["Experience"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["Training"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["PublicationAward"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// foreach (DataRow dr in _uploadHRData.Tables["Punishment"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// }
//// catch { }
//// }
//// UpdateProgressStatus(EnumProcessStatus.End);
//// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 1;
//// UpdateProgressStatus(EnumProcessStatus.Start);
//// UpdateprocessStatus("Collecting data from file : " + path);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "Organogram");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// foreach (DataRow dr in _uploadHRData.Tables["Organogram"].Rows)
//// {
//// try
//// {
//// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
//// dr["Parent_Position_No"] = (Convert.ToInt64(dr["Parent_Position_No"].ToString())).ToString();
//// }
//// catch { }
//// }
//// UpdateProgressStatus(EnumProcessStatus.End);
//// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 1;
//// UpdateProgressStatus(EnumProcessStatus.Start);
//// UpdateprocessStatus("Collecting data from file : " + path);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "ChangeNodePosition");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// foreach (DataRow dr in _uploadHRData.Tables["ChangeNodePosition"].Rows)
//// {
//// try
//// {
//// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
//// dr["Parent_Position_No"] = (Convert.ToInt64(dr["Parent_Position_No"].ToString())).ToString();
//// }
//// catch { }
//// }
//// UpdateProgressStatus(EnumProcessStatus.End);
//// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = 1;
//// UpdateProgressStatus(EnumProcessStatus.Start);
//// UpdateprocessStatus("Collecting data from file : " + path);
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "OrganogramPosting");
//// UpdateProgressStatus(EnumProcessStatus.PerformStep);
//// _uploadHRData.Tables.Add(_uplodedData);
//// foreach (DataRow dr in _uploadHRData.Tables["OrganogramPosting"].Rows)
//// {
//// try
//// {
//// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
//// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
//// }
//// catch { }
//// }
//// _uplodedData = RegularDataUpload.Service.LoadExcelData(path, "AssignMatrixLineAuthority");
//// _uploadHRData.Tables.Add(_uplodedData);
//// UpdateProgressStatus(EnumProcessStatus.End);
//// }
//// }
//// catch (Exception exp)
//// {
//// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + exp.Message, new HREmployee(), EnumErrorType.SystemError);
//// }
////}
//public void GetUploadData2(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataUploadColumnDefinition oColumnDefination)
//{
// try
// {
// _uploadHRData = new DataSet();
// _uploadHRData = RegularDataUpload.Service.LoadViewData();
// #region Remove leading zeros
// foreach (DataRow dr in _uploadHRData.Tables["View_General"].Rows)
// {
// try
// {
// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
// }
// catch { }
// }
// foreach (DataRow dr in _uploadHRData.Tables["View_Organogram"].Rows)
// {
// try
// {
// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
// dr["Parent_Position_No"] = (Convert.ToInt64(dr["Parent_Position_No"].ToString())).ToString();
// }
// catch { }
// }
// foreach (DataRow dr in _uploadHRData.Tables["View_OrganogramPosting"].Rows)
// {
// try
// {
// dr["Employee_PIN"] = (Convert.ToInt64(dr["Employee_PIN"].ToString())).ToString();
// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
// }
// catch { }
// }
// foreach (DataRow dr in _uploadHRData.Tables["View_ChangeNodePosition"].Rows)
// {
// try
// {
// dr["Position_No"] = (Convert.ToInt64(dr["Position_No"].ToString())).ToString();
// dr["Parent_Position_No"] = (Convert.ToInt64(dr["Parent_Position_No"].ToString())).ToString();
// }
// catch { }
// }
// #endregion
// }
// catch (Exception exp)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + exp.Message, new HREmployee(), EnumErrorType.SystemError);
// }
//}
//private void CheckValidation(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// CheckGeneralSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckSpouseWorkingBRACSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckAcademicSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckExperienceSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckTrainingSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckPublicationAwardSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckPunishmentSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckPromotionTransferHistorySheet(oErrorLogDetails, oSuccessLogDetails);
//}
//private void CheckValidation2(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// CheckGeneralSheet(oErrorLogDetails, oSuccessLogDetails);
// //CheckSpouseWorkingBRACSheet(oErrorLogDetails, oSuccessLogDetails);
// CheckAcademicSheet(oErrorLogDetails, oSuccessLogDetails);
// //CheckExperienceSheet(oErrorLogDetails, oSuccessLogDetails);
// //CheckTrainingSheet(oErrorLogDetails, oSuccessLogDetails);
// //CheckPublicationAwardSheet(oErrorLogDetails, oSuccessLogDetails);
// //CheckPunishmentSheet(oErrorLogDetails, oSuccessLogDetails);
// //CheckPromotionTransferHistorySheet(oErrorLogDetails, oSuccessLogDetails);
//}
//private void CheckOrganogramValidation(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// CheckOrganogramSheet(oErrorLogDetails, oSuccessLogDetails);
//}
//private void CheckAssignMatrixLineAuthority(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// CheckAssignMatrixLineAuthoritySheet(oErrorLogDetails, oSuccessLogDetails);
//}
//private void CheckOrganogramPostingValidation(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// CheckOrganogramPostingSheet(oErrorLogDetails, oSuccessLogDetails);
//}
//private void CheckChangeNodePositionValidation(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// CheckChangeNodePositionSheet(oErrorLogDetails, oSuccessLogDetails);
//}
//private void CheckGeneralSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("First_Name");
// OriginalTable.Columns.Add("Middle_Name");
// OriginalTable.Columns.Add("Last_Name");
// OriginalTable.Columns.Add("Fathers_Name");
// OriginalTable.Columns.Add("Mothers_Name");
// OriginalTable.Columns.Add("Fathers_Occupation");
// OriginalTable.Columns.Add("Mothers_Occupation");
// OriginalTable.Columns.Add("Nationality");
// OriginalTable.Columns.Add("Date_of_Birth");
// OriginalTable.Columns.Add("Place_of_Birth");
// OriginalTable.Columns.Add("Gender");
// OriginalTable.Columns.Add("Religion");
// OriginalTable.Columns.Add("Blood_Group");
// OriginalTable.Columns.Add("Passport_No");
// OriginalTable.Columns.Add("Tax_Identification_No");
// OriginalTable.Columns.Add("National_ID");
// OriginalTable.Columns.Add("Joining_Date");
// OriginalTable.Columns.Add("Date_of_Confirmation");
// OriginalTable.Columns.Add("Designation_Code");
// OriginalTable.Columns.Add("Designation_Name");
// OriginalTable.Columns.Add("Employee_Type_Code");
// OriginalTable.Columns.Add("Employee_Type_Name");
// OriginalTable.Columns.Add("Project_Code");
// OriginalTable.Columns.Add("Project_Name");
// OriginalTable.Columns.Add("Program_Code");
// OriginalTable.Columns.Add("Program_Name");
// OriginalTable.Columns.Add("District_Code");
// OriginalTable.Columns.Add("District_Name");
// //OriginalTable.Columns.Add("Thana_Code");
// //OriginalTable.Columns.Add("Thana_Name");
// OriginalTable.Columns.Add("Location_Code");
// OriginalTable.Columns.Add("Location_Name");
// OriginalTable.Columns.Add("Salary_Group_Code");
// OriginalTable.Columns.Add("Salary_Group_Name");
// OriginalTable.Columns.Add("Level_Code");
// OriginalTable.Columns.Add("Level_Name");
// OriginalTable.Columns.Add("Company");
// OriginalTable.Columns.Add("Email_Address ");
// OriginalTable.Columns.Add("Mobile_Number");
// OriginalTable.Columns.Add("Last_Date_Of_Promotion");
// OriginalTable.Columns.Add("Contract_End_Date");
// OriginalTable.Columns.Add("Last_Contract_Renuwal_Date");
// OriginalTable.Columns.Add("Joining_Date_of_BRAC_Int");
// OriginalTable.Columns.Add("Last_Salary_Increase_Date");
// OriginalTable.Columns.Add("IsDiscontinued");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_General"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_General", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckSpouseWorkingBRACSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("Date_of_Marriage");
// OriginalTable.Columns.Add("Spouse_Name");
// OriginalTable.Columns.Add("Spouse_Level_of_Education");
// OriginalTable.Columns.Add("Spouse_Occupation");
// OriginalTable.Columns.Add("Spouse_PIN");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_SpouseWorkingBRAC"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_SpouseWorkingBRAC", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckAcademicSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// //OriginalTable.Columns.Add("Level_of_Education_Code");
// OriginalTable.Columns.Add("Level_of_Education");
// //OriginalTable.Columns.Add("Discipline_Code");
// OriginalTable.Columns.Add("Discipline");
// OriginalTable.Columns.Add("Institution");
// OriginalTable.Columns.Add("Institution_Name");
// OriginalTable.Columns.Add("Year_of_Exam");
// OriginalTable.Columns.Add("Passing_Year");
// OriginalTable.Columns.Add("Div/Class");
// OriginalTable.Columns.Add("CGPA/Total_Marks");
// OriginalTable.Columns.Add("Highest_Education");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_Academic"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_Academic", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckExperienceSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("Employer");
// OriginalTable.Columns.Add("Contact_Person");
// OriginalTable.Columns.Add("Address");
// OriginalTable.Columns.Add("Telephone_No");
// OriginalTable.Columns.Add("Brief_Activity_of_Employer_Organization");
// OriginalTable.Columns.Add("Designation");
// OriginalTable.Columns.Add("Job_Description");
// OriginalTable.Columns.Add("Employed_From_Date");
// OriginalTable.Columns.Add("Employed_To_Date");
// OriginalTable.Columns.Add("Last_Job");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_Experience"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_Experience", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckTrainingSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("Training_Name");
// OriginalTable.Columns.Add("Training_Description");
// OriginalTable.Columns.Add("Country_of_Training");
// OriginalTable.Columns.Add("Training_Institution");
// OriginalTable.Columns.Add("Place_of_Training");
// OriginalTable.Columns.Add("From_Date");
// OriginalTable.Columns.Add("To_Date");
// OriginalTable.Columns.Add("Month");
// OriginalTable.Columns.Add("Hour");
// OriginalTable.Columns.Add("Days");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_Training"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_Training", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckPublicationAwardSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("Publication_Title");
// OriginalTable.Columns.Add("Publication_Type");
// OriginalTable.Columns.Add("Description");
// OriginalTable.Columns.Add("Remarks");
// OriginalTable.Columns.Add("Date_of_Publication");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_PublicationAward"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_PublicationAward", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckPunishmentSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("Punishment_Date");
// OriginalTable.Columns.Add("Type");
// OriginalTable.Columns.Add("Description");
// OriginalTable.Columns.Add("Action");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_Punishment"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_Punishment", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckPromotionTransferHistorySheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("Effect_Date");
// OriginalTable.Columns.Add("Effect_Type");
// OriginalTable.Columns.Add("Department");
// OriginalTable.Columns.Add("Location");
// OriginalTable.Columns.Add("Designation");
// OriginalTable.Columns.Add("Grade");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_PromotionTransferHistory"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_PromotionTransferHistory", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckOrganogramSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Position_No");
// OriginalTable.Columns.Add("Position_Name");
// OriginalTable.Columns.Add("Parent_Position_No");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_Organogram"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_Organogram", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckAssignMatrixLineAuthoritySheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Position_No");
// OriginalTable.Columns.Add("Matrix_Position_No");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_AssignMatrixLineAuthority"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_AssignMatrixLineAuthority", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckOrganogramPostingSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Employee_PIN");
// OriginalTable.Columns.Add("Position_No");
// OriginalTable.Columns.Add("Assign_Date");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_OrganogramPosting"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_OrganogramPosting", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
//private void CheckChangeNodePositionSheet(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dt = null;
// DataTable OriginalTable = new DataTable();
// OriginalTable.Columns.Add("Position_No");
// OriginalTable.Columns.Add("Parent_Position_No");
// bool bFound = false;
// dt = _uploadHRData.Tables["View_ChangeNodePosition"];
// foreach (DataColumn dc in OriginalTable.Columns)
// {
// if (dt != null)
// {
// foreach (DataColumn dc1 in dt.Columns)
// {
// if (dc.ColumnName.Trim().ToLower() == dc1.ColumnName.Trim().ToLower())
// {
// bFound = true;
// break;
// }
// else
// bFound = false;
// }
// }
// if (!bFound && dt != null)
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Column " + dc.ColumnName + " not found. Sheet /View name=View_ChangeNodePosition", new HREmployee(), EnumErrorType.ColumnMissing);
// }
//}
public void SetErrorSuccessObjects(EnumReceiveStatus status, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, string errorSuccessDescription, HREmployee oHREmployee, EnumErrorType oErrorType)
{
if (status == EnumReceiveStatus.Error)
{
ErrorLogDetail oErrorLogDetail = new ErrorLogDetail();
oErrorLogDetail.EmployeePIN = oHREmployee.EmployeeNo;
oErrorLogDetail.EmployeeName = oHREmployee.FirstName + " " + oHREmployee.MiddleName + " " + oHREmployee.LastName;
oErrorLogDetail.ErrorDescription = errorSuccessDescription;
oErrorLogDetail.ErrorType = oErrorType;
oErrorLogDetails.Add(oErrorLogDetail);
}
else
{
SuccessLogDetail oSuccessDetail = new SuccessLogDetail();
oSuccessDetail.EmployeePIN = oHREmployee.EmployeeNo;
oSuccessDetail.EmployeeName = oHREmployee.FirstName + " " + oHREmployee.MiddleName + " " + oHREmployee.LastName;
oSuccessDetail.SuccessDescription = errorSuccessDescription;
oSuccessLogDetails.Add(oSuccessDetail);
}
}
//private bool IsUpdateNeeded(DataRow oDr, HREmployee oEmp)
//{
// bool IsNeeded = false;
// Designation oDesignation = _oDesignations.Find(delegate(Designation oItem) { return oItem.Code.ToUpper().Trim() == oDr["Designation_Code"].ToString().ToUpper().Trim(); });
// if (oDesignation != null)
// {
// if (oEmp.DesignationID != oDesignation.ID)
// IsNeeded = true;
// }
// Category oCategory = _Categories.Find(delegate(Category oItem) { return oItem.Code.ToUpper().Trim() == oDr["Employee_Type_Code"].ToString().ToUpper().Trim(); });
// if (oCategory != null)
// {
// if (oEmp.CategoryID != oCategory.ID)
// IsNeeded = true;
// }
// Department oDepartment = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Project_Code"].ToString().ToUpper().Trim(); });
// if (oDepartment != null)
// {
// if (oEmp.DepartmentID != oDepartment.ID)
// IsNeeded = true;
// }
// Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["District_Code"].ToString().ToUpper().Trim(); });
// if (oLocation != null)
// {
// if (oEmp.LocationID != oLocation.ID)
// IsNeeded = true;
// }
// Grade oGrade = _oGrades.Find(delegate(Grade oItem) { return oItem.Code.ToUpper().Trim() == oDr["Level_Code"].ToString().ToUpper().Trim(); });
// if (oGrade != null)
// {
// if (oEmp.GradeID != oGrade.ID)
// IsNeeded = true;
// }
// bool sCom = oDr["Company"].ToString().ToLower() == "brac" ? false : true;
// if (oEmp.ForeignExPat != sCom)
// IsNeeded = true;
// if (oEmp.MobileNo != oDr["Mobile_Number"].ToString())
// IsNeeded = true;
// if (oEmp.EmailAddress.ToLower() != oDr["Email_Address"].ToString().ToLower())
// IsNeeded = true;
// DateTime dLastDateOfPromotion;
// if (DateTime.TryParse(oDr["Last_Date_Of_Promotion"].ToString(), out dLastDateOfPromotion))
// {
// if (oEmp.LastPromotionDate != DateTime.MinValue)
// {
// if (oEmp.LastPromotionDate != dLastDateOfPromotion)
// IsNeeded = true;
// }
// }
// DateTime dLastSalaryIncreaseDate;
// if (DateTime.TryParse(oDr["Last_Salary_Increase_Date"].ToString(), out dLastSalaryIncreaseDate))
// {
// if (oEmp.LastSalaryIncreaseDate != DateTime.MinValue)
// {
// if (oEmp.LastSalaryIncreaseDate != dLastSalaryIncreaseDate)
// IsNeeded = true;
// }
// }
// return IsNeeded;
//}
//public List<HREmployee> ImportEmpGeneralInfoForBRAC(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT, bool fromView)
//{
// int ncount = 0;
// string sEmpNos = "";
// List<HREmployee> oExistingHREmployees = HREmployee.Get();
// List<HREmployee> oHREmployees = new List<HREmployee>();
// HREmployee oHREmployee = null;
// try
// {
// UpdateprocessStatus("Checking and Creating New Basic Data....");
// SaveBasicData(oDTable, oErrorLogDetails, oSuccessLogDetails);
// DataTable dtAcademic = null;
// if (fromView)
// dtAcademic = oDT.Tables["View_Academic"];
// else
// dtAcademic = oDT.Tables["Academic"];
// SaveEducationBasicData(dtAcademic, oErrorLogDetails, oSuccessLogDetails);
// DataTable dtExperience = null;
// if (fromView)
// dtExperience = oDT.Tables["View_Experience"];
// else
// dtExperience = oDT.Tables["Experience"];
// DataTable dtTraining = null;
// if (fromView)
// dtTraining = oDT.Tables["View_Training"];
// else
// dtTraining = oDT.Tables["Training"];
// DataTable dtPublication = null;
// if (fromView)
// dtPublication = oDT.Tables["View_Publication"];
// else
// dtPublication = oDT.Tables["PublicationAward"];
// //DataTable dtTransfer = null;
// //if (fromView)
// // dtTransfer = oDT.Tables["View_PromotionTransferHistory"];
// //else
// // dtTransfer = oDT.Tables["PromotionTransferHistory"];
// DataTable dtEmpPunishment = null;
// if (fromView)
// dtEmpPunishment = oDT.Tables["View_Punishment"];
// else
// dtEmpPunishment = oDT.Tables["Punishment"];
// int nGeneralCount = 1;
// List<User> oUsers = User.Get(EnumSystemType.Web);
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// UpdateProgressStatus(EnumProcessStatus.Start);
// string sDisEmps = "";
// foreach (DataRow oDr in oDTable.Rows)
// {
// ncount++;
// if (sEmpNos == "")
// sEmpNos = "'" + oDr["Employee_PIN"].ToString() + "'";
// else
// sEmpNos += "," + "'" + oDr["Employee_PIN"].ToString() + "'";
// //if (oDr["Employee_PIN"].ToString() == "122416")
// // ncount++;
// if (this.CheckGeneralBasicData(oErrorLogDetails, oSuccessLogDetails, oDr) == false)
// continue;
// UpdateprocessStatus("Preparing Data For Employee : " + oDr["Employee_PIN"].ToString() + ". Record fetched " + nGeneralCount.ToString() + "/" + oDTable.Rows.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// if (oDr["First_Name"].ToString().Trim() != string.Empty)
// {
// oHREmployee = new HREmployee();
// HREmployee oIsOld = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo == oDr["Employee_PIN"].ToString(); });
// if (oIsOld == null)
// {
// oHREmployee.EmployeeNo = oDr["Employee_PIN"].ToString();
// }
// else
// {
// oHREmployee = oIsOld;
// }
// if (oIsOld != null)
// {
// if (!IsUpdateNeeded(oDr, oHREmployee))
// continue;
// }
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employee_PIN: " + oDr["Employee_PIN"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.BirthPlace = oDr["Place_Of_Birth"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Place of birth: " + oDr["Place_Of_Birth"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //_HREmployee.NickName = oDr["Nick Name"].ToString();
// oHREmployee.FirstName = oDr["First_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "First name: " + oDr["First_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.MiddleName = oDr["Middle_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Middle name: " + oDr["Middle_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.LastName = oDr["Last_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last name: " + oDr["Last_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// _HREmployee.Gender = (oDr["Gender"].ToString().Trim().ToUpper().Trim() == "MALE") ? EnumGender.Male : EnumGender.Female;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Gender: " + oDr["Gender"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.Name = oHREmployee.FirstName + " " + oHREmployee.MiddleName + " " + oHREmployee.LastName;
// Religion oReligion = _Religions.Find(delegate(Religion oItem) { return oItem.Name.ToUpper().Trim() == oDr["Religion"].ToString().ToUpper().Trim(); });
// if (oReligion != null)
// {
// oHREmployee.ReligionID = oReligion.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Religion: " + oDr["Religion"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Religion: " + oDr["Religion"].ToString().Trim() + " is not found.Sheetname=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// //}
// if (oDr["Blood_Group"].ToString().ToUpper() == "B+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.BPos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "B-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.BNeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "A+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.APos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "A-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ANeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "O+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.OPos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "O-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ONeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "AB+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ABPos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "AB-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ABNeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "Undefined".ToUpper())
// {
// oHREmployee.BloodGroup = EnumBloodGroup.OPos;
// }
// else
// oHREmployee.BloodGroup = EnumBloodGroup.None;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Blood Group: " + oDr["Blood_Group"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.PassportNo = oDr["Passport_No"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Passport No: " + oDr["Passport_No"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.TinNo = oDr["Tax_Identification_No"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Tax Identification No: " + oDr["Tax_Identification_No"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// Nationality oNationality = _Nationalites.Find(delegate(Nationality oItem) { return oItem.Description.ToUpper().Trim() == oDr["Nationality"].ToString().ToUpper().Trim(); });
// if (oNationality != null)
// {
// oHREmployee.NationalityID = oNationality.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Nationality: " + oDr["Nationality"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Nationality: " + oDr["Nationality"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// oHREmployee.NationalID = oDr["National_ID"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "National ID: " + oDr["National_ID"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// DateTime dTemFDate;
// if (DateTime.TryParse(oDr["Joining_Date"].ToString(), out dTemFDate))
// {
// oHREmployee.JoiningDate = dTemFDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Joining Date: " + oDr["Joining_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Joining date: invalid date.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// DateTime dTemBDate;
// if (DateTime.TryParse(oDr["Date_of_Birth"].ToString(), out dTemBDate))
// {
// oHREmployee.BirthDate = dTemBDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Date of Birth: " + oDr["Date_of_Birth"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Birth date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// DateTime dTemConfirmDate;
// if (DateTime.TryParse(oDr["Date_of_Confirmation"].ToString(), out dTemConfirmDate))
// {
// oHREmployee.ConfirDate = dTemConfirmDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Date of Confirmation: " + oDr["Date_of_Confirmation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Confirmation date: invalid date.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// oHREmployee.FatherName = oDr["Fathers_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Fathers Name: " + oDr["Fathers_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.MotherName = oDr["Mothers_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Mothers Name: " + oDr["Mothers_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// Occupation oFOccupation = _Occupations.Find(delegate(Occupation oItem) { return oItem.Description.ToUpper().Trim() == oDr["Fathers_Occupation"].ToString().ToUpper().Trim(); });
// if (oFOccupation != null)
// {
// oHREmployee.FatherOccupationID = oFOccupation.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Fathers Occupation: " + oDr["Fathers_Occupation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Father's Occupation: " + oDr["Father's_Occupation"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// //}
// Occupation oMOccupation = _Occupations.Find(delegate(Occupation oItem) { return oItem.Description.ToUpper().Trim() == oDr["Mothers_Occupation"].ToString().ToUpper().Trim(); });
// if (oMOccupation != null)
// {
// oHREmployee.MotherOccupationID = oMOccupation.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Mothers Occupation: " + oDr["Mothers_Occupation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Mother's Occupation: " + oDr["Mother's_Occupation"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// //}
// Designation oDesignation = _oDesignations.Find(delegate(Designation oItem) { return oItem.Code.ToUpper().Trim() == oDr["Designation_Code"].ToString().ToUpper().Trim(); });
// if (oDesignation != null)
// {
// oHREmployee.DesignationID = oDesignation.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDr["Designation_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDr["Designation_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Category oCategory = _Categories.Find(delegate(Category oItem) { return oItem.Code.ToUpper().Trim() == oDr["Employee_Type_Code"].ToString().ToUpper().Trim(); });
// if (oCategory != null)
// {
// oHREmployee.CategoryID = oCategory.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employee_Type_Code: " + oDr["Employee_Type_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee_Type_Code: " + oDr["Employee_Type_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Department oDepartment = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Project_Code"].ToString().ToUpper().Trim(); });
// if (oDepartment != null)
// {
// oHREmployee.DepartmentID = oDepartment.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Project_Code: " + oDr["Project_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project_Code: " + oDr["Project_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// //Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Location_Code"].ToString().ToUpper().Trim(); });
// //if (oLocation != null)
// //{
// oHREmployee.LocationID = (1);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Location: " + oDr["Location_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //}
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location: " + oDr["Location_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// //}
// Grade oGrade = _oGrades.Find(delegate(Grade oItem) { return oItem.Name.ToUpper().Trim() == oDr["Level_Name"].ToString().ToUpper().Trim(); });
// if (oGrade != null)
// {
// oHREmployee.GradeID = oGrade.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level_Code: " + oDr["Level_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level_Code: " + oDr["Level_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// oHREmployee.ForeignExPat = oDr["Company"].ToString().ToLower() == "brac" ? false : true;
// oHREmployee.EmailAddress = oDr["Email_Address"].ToString();
// oHREmployee.MobileNo = oDr["Mobile_Number"].ToString();
// DateTime dLastDateOfPromotion;
// if (DateTime.TryParse(oDr["Last_Date_Of_Promotion"].ToString(), out dLastDateOfPromotion))
// {
// oHREmployee.LastPromotionDate = dLastDateOfPromotion;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last Promotion Date: " + oDr["Last_Date_Of_Promotion"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dContractEndDate;
// if (DateTime.TryParse(oDr["Contract_End_Date"].ToString(), out dContractEndDate))
// {
// oHREmployee.ContractEndDate = dContractEndDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Contract End Date: " + oDr["Contract_End_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dLastContractRenuwalDate;
// if (DateTime.TryParse(oDr["Last_Contract_Renuwal_Date"].ToString(), out dLastContractRenuwalDate))
// {
// oHREmployee.LastContractRenewalDate = dLastContractRenuwalDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last Contract Renuwal Date: " + oDr["Last_Contract_Renuwal_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dLastSalaryIncreaseDate;
// if (DateTime.TryParse(oDr["Last_Salary_Increase_Date"].ToString(), out dLastSalaryIncreaseDate))
// {
// oHREmployee.LastSalaryIncreaseDate = dLastSalaryIncreaseDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last Salary Increase Date: " + oDr["Last_Salary_Increase_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dJoiningDateofBRACInt;
// if (DateTime.TryParse(oDr["Joining_Date_of_BRAC_Int"].ToString(), out dJoiningDateofBRACInt))
// {
// oHREmployee.JoinDateBracInt = dJoiningDateofBRACInt;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Joining Date of BRAC Int: " + oDr["Joining_Date_of_BRAC_Int"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //Fixed Values
// oHREmployee.PayrollTypeID = (1);
// oHREmployee.Status = oDr["IsDiscontinued"].ToString().ToLower() == "no" ? EnumEmployeeStatus.Live : EnumEmployeeStatus.Discontinued;
// if (oDr["IsDiscontinued"].ToString().ToLower() == "no")
// sDisEmps += "'"+oDr["Employee_PIN"].ToString()+"'" + ",";
// oHREmployees.Add(oHREmployee);
// User oUsr = oUsers.Find(delegate(User usr) { return usr.LoginID == oHREmployee.EmployeeNo; });
// if (oUsr == null)
// {
// User oUser = new User();
// oUser.LoginID = oHREmployee.EmployeeNo;
// oUser.Name = oHREmployee.Name;
// oUser.PasswordHints = oHREmployee.EmployeeNo;
// oUser.ParentID = (1);
// string sPass = oHREmployee.BirthDate.Day.ToString() + oHREmployee.BirthDate.Month.ToString() + oHREmployee.BirthDate.Year.ToString();
// oUser.Password = Ease.CoreV35.Utility.Global.CipherFunctions.Encrypt("CeLiMiTeD.AdMIn", sPass);
// oUser.SISU = false;
// oUser.UserType = EnumSystemType.Web;
// oUser.Status = EnumStatus.Active;
// oUser.Save();
// oUsers.Add(oUser);
// }
// nGeneralCount++;
// }
// }
// //sEmpNos = "Create User Passed";
// this.SaveHREmpData(oHREmployees);
// //sEmpNos = "Save Employee Passed";
// #region update discontinue employee
// oExistingHREmployees = new List<HREmployee>();
// oExistingHREmployees = HREmployee.Get();
// string sQuery = "";
// sQuery = "Update Employee set status =2 WHERE EMPLOYEENO NOT IN('"+sDisEmps.Trim(',')+"')";
// HREmployee.UpdateQuery(sQuery);
// #endregion
// UpdateProgressStatus(EnumProcessStatus.End);
// //Find Academic
// DataTable table = new DataTable("ACADEMIC");
// // construct DataTable
// table.Columns.Add(new DataColumn("ACADEMICID", typeof(Int64)));
// table.Columns.Add(new DataColumn("EMPLOYEEID", typeof(Int64)));
// table.Columns.Add(new DataColumn("EDUCATIONLEVELID", typeof(int)));
// table.Columns.Add(new DataColumn("DISCIPLINEID", typeof(int)));
// table.Columns.Add(new DataColumn("INSTITUTIONID", typeof(int)));
// table.Columns.Add(new DataColumn("PASSINGYEAR", typeof(int)));
// table.Columns.Add(new DataColumn("CLASSORDIVISION", typeof(string)));
// table.Columns.Add(new DataColumn("GPAORMARKS", typeof(double)));
// table.Columns.Add(new DataColumn("LASTLEVEL", typeof(int)));
// table.Columns.Add(new DataColumn("OUTOF", typeof(double)));
// table.Columns.Add(new DataColumn("RESULTTYPEID", typeof(int)));
// table.Columns.Add(new DataColumn("INSTITUTENAME", typeof(string)));
// table.Columns.Add(new DataColumn("EducationTypeID", typeof(int)));
// table.Columns.Add(new DataColumn("ExamYear", typeof(int)));
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = dtAcademic == null ? 0 : dtAcademic.Rows.Count;
// UpdateProgressStatus(EnumProcessStatus.Start);
// EmpAcademic oEmpAcademic = null;
// List<EmpAcademic> oEmpAcademics = new List<EmpAcademic>();
// //oHREmployee.Academics = new List<EmpAcademic>();
// //var accItems = dtAcademic.AsEnumerable().Where(x => x["Employee_PIN"].ToString().ToLower() == oDr["Employee_PIN"].ToString().ToLower());
// //if (accItems.Count() > 0)
// // dtAcademic2 = accItems.CopyToDataTable();
// sQuery = "";
// if (dtAcademic != null)
// {
// //long nMaxID = new HREmployee().GetMaxID("EMPACADEMIC", "ACADEMICID");
// long nMaxID = 1;
// int nAcaCount = 1;
// foreach (DataRow oDrAcademic in dtAcademic.Rows)
// {
// UpdateprocessStatus("Preparing Academic Data For Employee : " + oDrAcademic["Employee_PIN"].ToString() + ". Record fetched " + nAcaCount.ToString() + "/" + dtAcademic.Rows.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// HREmployee oExists = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo.ToLower() == oDrAcademic["Employee_PIN"].ToString().ToLower(); });
// //if (oDr["Employee_PIN"].ToString().ToLower() == oDrAcademic["Employee_PIN"].ToString().ToLower())
// // {
// //if (oDrAcademic["Education_Type"].ToString().Trim() != string.Empty)
// //{
// if (oExists != null)
// {
// oEmpAcademic = new EmpAcademic();
// oEmpAcademic.EmployeeID = oExists.ID;
// //EducationType oEDType = _EducationTypes.Find(delegate(EducationType oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Education_Type"].ToString().ToUpper().Trim(); });
// //if (oEDType != null)
// //{
// // oEmpAcademic.EducationTypeID = oEDType.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Education_Type: " + oDrAcademic["Education_Type"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //}
// //else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Education_Type: " + oDrAcademic["Education_Type"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// oEmpAcademic.EducationTypeID = (1);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Education_Type: " + oDrAcademic["Education_Type"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// EducationLevel oEducLevel = _EducationLevels.Find(delegate(EducationLevel oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Level_of_Education"].ToString().ToUpper().Trim(); });
// if (oEducLevel != null)
// {
// oEmpAcademic.EducationLevelID = oEducLevel.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level_of_Education: " + oDrAcademic["Level_of_Education"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Education level: " + oDrAcademic["Level_of_Education"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oExists, EnumErrorType.BasicData);
// continue;
// }
// Discipline oDis = _Disciplines.Find(delegate(Discipline oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Discipline"].ToString().ToUpper().Trim(); });
// if (oDis != null)
// {
// oEmpAcademic.DisciplineID = oDis.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Discipline: " + oDrAcademic["Discipline"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// oEmpAcademic.DisciplineID = (1);
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Discipline: " + oDrAcademic["Discipline"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Institution oIns = _Institutions.Find(delegate(Institution oItem) { return oItem.Name.ToUpper().Trim() == oDrAcademic["Institution"].ToString().ToUpper().Trim(); });
// if (oIns != null)
// {
// oEmpAcademic.InstitutionID = oIns.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Institution: " + oDrAcademic["Institution"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// oEmpAcademic.InstitutionID = (1);
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Institution (Board/University): " + oDrAcademic["Institution"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// oEmpAcademic.InstituteName = oDrAcademic["Institution_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Institution_Name: " + oDrAcademic["Institution_Name"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// int dExamYear = 0;
// if (oDrAcademic["Year_of_Exam"].ToString() != "")
// {
// dExamYear = Convert.ToInt16(oDrAcademic["Year_of_Exam"]);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Year_of_Exam: " + oDrAcademic["Year_of_Exam"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpAcademic.ExamDate = dExamYear;
// }
// else
// oEmpAcademic.ExamDate = DateTime.Today.Year;
// int dPassingYear = 0;
// if (oDrAcademic["Passing_Year"].ToString() != "")
// {
// dPassingYear = Convert.ToInt16(oDrAcademic["Passing_Year"]);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Passing_Year: " + oDrAcademic["Passing_Year"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpAcademic.PassingYear = dPassingYear;
// }
// else
// oEmpAcademic.PassingYear = DateTime.Today.Year;
// if (oDrAcademic["Div/Class"].ToString() == "")
// oDrAcademic["Div/Class"] = "Passed";
// ResultType oRType = _ResultTypes.Find(delegate(ResultType oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Div/Class"].ToString().ToUpper().Trim(); });
// if (oRType != null)
// {
// oEmpAcademic.ResultTypeID = oRType.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Div/Class: " + oDrAcademic["Div/Class"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Div/Class: " + oDrAcademic["Div/Class"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oExists, EnumErrorType.BasicData);
// continue;
// }
// if (oDrAcademic["CGPA/Total_Marks"].ToString() != string.Empty || oDrAcademic["CGPA/Total_Marks"].ToString().Length > 0)
// {
// oEmpAcademic.GPAOrMarks = Convert.ToDouble(oDrAcademic["CGPA/Total_Marks"]);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "CGPA/Total_Marks: " + oDrAcademic["CGPA/Total_Marks"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// oEmpAcademic.LastLevel = (oDrAcademic["Highest_Education"].ToString().ToUpper().Trim() == "Y".ToUpper().Trim()) ? true : false;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Highest_Education: No", oExists, EnumErrorType.BasicData);
// table.Rows.Add(nMaxID, oEmpAcademic.EmployeeID.Integer, oEmpAcademic.EducationLevelID.Integer, oEmpAcademic.DisciplineID.Integer,
// oEmpAcademic.InstitutionID.Integer, oEmpAcademic.PassingYear, oEmpAcademic.ClassOrDivision, oEmpAcademic.GPAOrMarks,
// oEmpAcademic.LastLevel == true ? 1 : 0, oEmpAcademic.OutOf, oEmpAcademic.ResultTypeID.Integer, oEmpAcademic.InstituteName,
// oEmpAcademic.EducationTypeID.Integer, oEmpAcademic.ExamDate);
// nMaxID++;
// }
// //}
// //}
// nAcaCount++;
// }
// UpdateProgressStatus(EnumProcessStatus.End);
// this.UpdateprocessStatus("Saving Academic Data.It Takes Several Minutes.");
// sQuery = "Delete from EMPACADEMIC";
// HREmployee.UpdateQuery(sQuery);
// string sConnectionString = ConfigurationSettings.AppSettings["DBConnection"];
// using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sConnectionString))
// {
// bulkCopy.BulkCopyTimeout = 600; // in seconds
// bulkCopy.DestinationTableName = "EMPACADEMIC";
// bulkCopy.WriteToServer(table);
// }
// }
// //For Experience
// DataTable tableExperience = new DataTable("EXPERIENCE");
// // construct DataTable
// tableExperience.Columns.Add(new DataColumn("EMPLOYEEID", typeof(Int64)));
// tableExperience.Columns.Add(new DataColumn("EXPERIENCEID", typeof(Int64)));
// tableExperience.Columns.Add(new DataColumn("EMPLOYER", typeof(string)));
// tableExperience.Columns.Add(new DataColumn("CONTACTPERSON", typeof(string)));
// tableExperience.Columns.Add(new DataColumn("ADDRESS", typeof(string)));
// tableExperience.Columns.Add(new DataColumn("TELEPHONE", typeof(string)));
// tableExperience.Columns.Add(new DataColumn("EMPLOYERACTIVITY", typeof(string)));
// tableExperience.Columns.Add(new DataColumn("DESIGNATION", typeof(string)));
// tableExperience.Columns.Add(new DataColumn("JOBDESCRIPTION", typeof(string)));
// tableExperience.Columns.Add(new DataColumn("FROMDATE", typeof(DateTime)));
// tableExperience.Columns.Add(new DataColumn("TODATE", typeof(DateTime)));
// tableExperience.Columns.Add(new DataColumn("LASTJOB", typeof(int)));
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = dtExperience == null ? 0 : dtExperience.Rows.Count;
// UpdateProgressStatus(EnumProcessStatus.Start);
// EmpExperience oEmpExperience = null;
// //DataTable dtExperience2 = null;
// //oHREmployee.Experiences = new List<EmpExperience>();
// //var exItems = dtExperience.AsEnumerable().Where(x => x["Employee_PIN"].ToString().ToLower() == oDr["Employee_PIN"].ToString().ToLower());
// //if (exItems.Count() > 0)
// // dtExperience2 = exItems.CopyToDataTable();
// if (dtExperience != null)
// {
// long nMaxExperienceID = 1;// new HREmployee().GetMaxID("EMPEXPERIENCE", "EXPERIENCEID");
// int nexCount = 1;
// foreach (DataRow oDrExperience in dtExperience.Rows)
// {
// UpdateprocessStatus("Preparing Experience Data For Employee : " + oDrExperience["Employee_PIN"].ToString() + ". Record fetched " + nexCount.ToString() + "/" + dtExperience.Rows.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// HREmployee oExists = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo.ToLower() == oDrExperience["Employee_PIN"].ToString().ToLower(); });
// if (oExists != null)
// {
// oEmpExperience = new EmpExperience();
// oEmpExperience.EmployeeID = oExists.ID;
// oEmpExperience.Employer = oDrExperience["Employer"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employer: " + oDrExperience["Employer"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpExperience.ContactPerson = oDrExperience["Contact_Person"].ToString() != string.Empty ? oDrExperience["Contact_Person"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Contact_Person: " + oDrExperience["Contact_Person"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpExperience.Address = oDrExperience["Address"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Address: " + oDrExperience["Address"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpExperience.Telephone = oDrExperience["Telephone_No"].ToString() != string.Empty ? oDrExperience["Telephone_No"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Telephone_No: " + oDrExperience["Telephone_No"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// //oEmpExperience.EmployerActivity = oDrExperience["Brief Activity_of_Employer_Organization"].ToString();
// //SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Brief Activity_of_Employer_Organization: " + oDrExperience["Brief Activity_of_Employer_Organization"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpExperience.Designation = oDrExperience["Designation"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDrExperience["Designation"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpExperience.JobDescription = oDrExperience["Job_Description"].ToString() != string.Empty ? oDrExperience["Job_Description"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Job_Description: " + oDrExperience["Job_Description"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// DateTime dExpFDate;
// if (DateTime.TryParse(oDrExperience["Employed_From_Date"].ToString(), out dExpFDate))
// {
// oEmpExperience.FromDate = dExpFDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employed_From_Date: " + oDrExperience["Employed_From_Date"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// oEmpExperience.FromDate = DateTime.Today;
// //else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employed_From_Date: " + oDrExperience["Employed_From_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtExperience.TableName + ", Row no=" + nexCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// DateTime dTempDate;
// if (DateTime.TryParse(oDrExperience["Employed_To_Date"].ToString(), out dTempDate))
// {
// oEmpExperience.ToDate = dTempDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employed_To_Date: " + oDrExperience["Employed_To_Date"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// oEmpExperience.ToDate = DateTime.Today;
// oEmpExperience.LastJob = false;// oDrExperience["Last_Job"].ToString().ToLower() == "y" ? true : false;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last_Job: " + oDrExperience["Last_Job"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// tableExperience.Rows.Add(oEmpExperience.EmployeeID.Integer, nMaxExperienceID, oEmpExperience.Employer, oEmpExperience.ContactPerson,
// oEmpExperience.Address, oEmpExperience.Telephone, oEmpExperience.EmployerActivity, oEmpExperience.Designation, oEmpExperience.JobDescription,
// oEmpExperience.FromDate, oEmpExperience.ToDate, oEmpExperience.LastJob ? 1 : 0);
// nMaxExperienceID++;
// }
// // }
// nexCount++;
// }
// UpdateProgressStatus(EnumProcessStatus.End);
// this.UpdateprocessStatus("Saving Experience Data.It Takes Several Minutes.");
// sQuery = "Delete from EMPEXPERIENCE";
// HREmployee.UpdateQuery(sQuery);
// string sConnectionString = ConfigurationSettings.AppSettings["DBConnection"];
// using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sConnectionString))
// {
// bulkCopy.BulkCopyTimeout = 600; // in seconds
// bulkCopy.DestinationTableName = "EMPEXPERIENCE";
// bulkCopy.WriteToServer(tableExperience);
// }
// }
// //For Training
// DataTable tableTraining = new DataTable("Training");
// // construct DataTable
// tableTraining.Columns.Add(new DataColumn("EMPTRAININGID", typeof(Int64)));
// tableTraining.Columns.Add(new DataColumn("EMPLOYEEID", typeof(Int64)));
// tableTraining.Columns.Add(new DataColumn("NAME", typeof(string)));
// tableTraining.Columns.Add(new DataColumn("DESCRIPTION", typeof(string)));
// tableTraining.Columns.Add(new DataColumn("COUNTRYID", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("INSTITUTIONID", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGPLACE", typeof(string)));
// tableTraining.Columns.Add(new DataColumn("ACHIEVEMENT", typeof(string)));
// tableTraining.Columns.Add(new DataColumn("FEES", typeof(double)));
// tableTraining.Columns.Add(new DataColumn("OTHERCOST", typeof(double)));
// tableTraining.Columns.Add(new DataColumn("FROMDATE", typeof(DateTime)));
// tableTraining.Columns.Add(new DataColumn("TODATE", typeof(DateTime)));
// tableTraining.Columns.Add(new DataColumn("CONFIRMATIONDATE", typeof(DateTime)));
// tableTraining.Columns.Add(new DataColumn("SPONSOREDTYPE", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("NATUREOFTRAININGID", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGTYPEID", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGCOMPLETEDFROM", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGID", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGSCHEDULEID", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGMONTH", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGDAY", typeof(int)));
// tableTraining.Columns.Add(new DataColumn("TRAININGHOUR", typeof(int)));
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = dtTraining == null ? 0 : dtTraining.Rows.Count;
// UpdateProgressStatus(EnumProcessStatus.Start);
// EmpTraining oEmpTraining = null;
// List<EmpTraining> oEmpTrainings = new List<EmpTraining>();
// if (dtTraining != null)
// {
// long nTrainingMaxID =1;// new HREmployee().GetMaxID("EMPTRAINING", "EMPTRAININGID");
// int nTrCount = 1;
// foreach (DataRow oDrTraining in dtTraining.Rows)
// {
// UpdateprocessStatus("Preparing Training Data For Employee : " + oDrTraining["Employee_PIN"].ToString() + ". Record fetched " + nTrCount.ToString() + "/" + dtTraining.Rows.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// HREmployee oExists = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo.ToLower() == oDrTraining["Employee_PIN"].ToString().ToLower(); });
// if (oExists != null)
// {
// oEmpTraining = new EmpTraining();
// oEmpTraining.EmployeeID = oExists.ID;
// oEmpTraining.Name = oDrTraining["Training_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Name: " + oDrTraining["Training_Name"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpTraining.TrainingTypeID = (1);
// oEmpTraining.NatureOfTrainingID = (1);
// oEmpTraining.Description = oDrTraining["Training_Description"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Description: " + oDrTraining["Training_Description"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// Institution oIns = _Institutions.Find(delegate(Institution oItem) { return oItem.Name.ToUpper().Trim() == oDrTraining["Training_Institution"].ToString().ToUpper().Trim(); });
// if (oIns != null)
// {
// oEmpTraining.InstitutionID = oIns.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Institution: " + oDrTraining["Training_Institution"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// oEmpTraining.InstitutionID = (1);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Institution: " + oDrTraining["Training_Institution"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// oEmpTraining.Place = oDrTraining["Place_of_Training"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Place_of_Training: " + oDrTraining["Place_of_Training"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// Country oCountry = _Contries.Find(delegate(Country oItem) { return oItem.Name.ToUpper().Trim() == oDrTraining["Country_of_Training"].ToString().ToUpper().Trim(); });
// if (oCountry != null)
// {
// oEmpTraining.CountryID = oCountry.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Country_of_Training: " + oDrTraining["Country_of_Training"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// oEmpTraining.CountryID = (1);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Country_of_Training: " + oDrTraining["Country_of_Training"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// oEmpTraining.Achievements = "";
// oEmpTraining.TrainingCompletedFrom = EnumTrainingCompletedFrom.Own;
// oEmpTraining.Fees = 0.0;
// oEmpTraining.OtherCost = 0.0;
// DateTime dTempFdate;
// if (oDrTraining["From_Date"].ToString() == "")
// oDrTraining["From_Date"] = "1 Jan 2013";
// if (DateTime.TryParse(oDrTraining["From_Date"].ToString(), out dTempFdate))
// {
// oEmpTraining.FromDate = dTempFdate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "From_Date: " + oDrTraining["From_Date"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "From_Date: " + oDrTraining["From_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtTraining.TableName + ", Row no=" + nTrCount.ToString(), oExists, EnumErrorType.DateTimeFormat);
// continue;
// }
// DateTime oTEmpDate;
// if (oDrTraining["To_Date"].ToString() == "")
// oDrTraining["To_Date"] = "2 Jan 2013";
// if (DateTime.TryParse(oDrTraining["To_Date"].ToString(), out oTEmpDate))
// {
// oEmpTraining.ToDate = oTEmpDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "To_Date: " + oDrTraining["To_Date"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "To_Date: " + oDrTraining["To_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtTraining.TableName + ", Row no=" + nTrCount.ToString(), oExists, EnumErrorType.DateTimeFormat);
// continue;
// }
// TimeSpan ts = oEmpTraining.ToDate - oEmpTraining.FromDate;
// oEmpTraining.TrainingHour = ts.Hours == 0 ? 8 : 8 * ts.Hours;
// tableTraining.Rows.Add(nTrainingMaxID, oEmpTraining.EmployeeID.Integer, oEmpTraining.Name, oEmpTraining.Description, oEmpTraining.CountryID.Integer,
// oEmpTraining.InstitutionID.Integer, oEmpTraining.Place, oEmpTraining.Achievements, oEmpTraining.Fees, oEmpTraining.OtherCost, oEmpTraining.FromDate,
// oEmpTraining.ToDate, DateTime.Today, (int)oEmpTraining.TrainingCompletedFrom, oEmpTraining.NatureOfTrainingID.Integer,
// oEmpTraining.TrainingTypeID.Integer, (int)oEmpTraining.TrainingCompletedFrom, 0, 0, oEmpTraining.TrainingMonth, oEmpTraining.TrainingHour, oEmpTraining.TrainingDay);
// nTrainingMaxID++;
// }
// // }
// nTrCount++;
// }
// UpdateProgressStatus(EnumProcessStatus.End);
// this.UpdateprocessStatus("Saving Training Data.It Takes Several Minutes.");
// sQuery = "Delete from EMPTRAINING";
// HREmployee.UpdateQuery(sQuery);
// string sConnectionString = ConfigurationSettings.AppSettings["DBConnection"];
// using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sConnectionString))
// {
// bulkCopy.BulkCopyTimeout = 600; // in seconds
// bulkCopy.DestinationTableName = "EMPTRAINING";
// bulkCopy.WriteToServer(tableTraining);
// }
// }
// //For Publication
// DataTable tablePUBLICATION = new DataTable("PUBLICATION");
// // construct DataTable
// tablePUBLICATION.Columns.Add(new DataColumn("PUBLICATIONID", typeof(Int64)));
// tablePUBLICATION.Columns.Add(new DataColumn("EMPLOYEEID", typeof(Int64)));
// tablePUBLICATION.Columns.Add(new DataColumn("TITLE", typeof(string)));
// tablePUBLICATION.Columns.Add(new DataColumn("DESCRIPTION", typeof(string)));
// tablePUBLICATION.Columns.Add(new DataColumn("REMARKS", typeof(string)));
// tablePUBLICATION.Columns.Add(new DataColumn("PUBLICATIONDATE", typeof(DateTime)));
// tablePUBLICATION.Columns.Add(new DataColumn("PUBLICATIONTYPE", typeof(string)));
// tablePUBLICATION.Columns.Add(new DataColumn("PUBLISHERSNAME", typeof(string)));
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = dtPublication == null ? 0 : dtPublication.Rows.Count;
// UpdateProgressStatus(EnumProcessStatus.Start);
// EmpPublication oEmpPublication = null;
// List<EmpPublication> oEmpPublications = new List<EmpPublication>();
// if (dtPublication != null)
// {
// long nPublicationMaxID =1;// new HREmployee().GetMaxID("EMPPUBLICATION", "PUBLICATIONID");
// int nPubCount = 1;
// foreach (DataRow oDrPublication in dtPublication.Rows)
// {
// UpdateprocessStatus("Preparing Publication Data For Employee : " + oDrPublication["Employee_PIN"].ToString() + ". Record fetched " + nPubCount.ToString() + "/" + dtPublication.Rows.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// HREmployee oExists = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo.ToLower() == oDrPublication["Employee_PIN"].ToString().ToLower(); });
// if (oExists != null)
// {
// oEmpPublication = new EmpPublication();
// oEmpPublication.EmployeeID = oExists.ID;
// oEmpPublication.Title = oDrPublication["Publication_Title"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Publication_Title: " + oDrPublication["Publication_Title"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpPublication.PublicationType = oDrPublication["Publication_Type"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Publication_Type: " + oDrPublication["Publication_Type"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpPublication.Description = oDrPublication["Description"].ToString() != string.Empty ? oDrPublication["Description"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Description :" + oDrPublication["Description"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// oEmpPublication.Remarks = oDrPublication["Remarks"].ToString() != string.Empty ? oDrPublication["Remarks"].ToString() : "N/A";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Remarks: " + oDrPublication["Remarks"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// DateTime dTempDate;
// if (DateTime.TryParse(oDrPublication["Date_of_Publication"].ToString(), out dTempDate))
// {
// oEmpPublication.PublicationDate = dTempDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Date_of_Publication: " + oDrPublication["Date_of_Publication"].ToString().Trim(), oExists, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Date_of_Publication: " + oDrPublication["Date_of_Publication"].ToString().Trim() + " is invalid date.Sheet name=" + dtPublication.TableName + ", Row no=" + nPubCount.ToString(), oExists, EnumErrorType.DateTimeFormat);
// continue;
// }
// tablePUBLICATION.Rows.Add(nPublicationMaxID, oEmpPublication.EmployeeID.Integer, oEmpPublication.Title, oEmpPublication.Description, oEmpPublication.Remarks,
// oEmpPublication.PublicationDate, oEmpPublication.PublicationType, oEmpPublication.PublishersName);
// nPublicationMaxID++;
// }
// // }
// nPubCount++;
// }
// UpdateProgressStatus(EnumProcessStatus.End);
// this.UpdateprocessStatus("Saving Publication Data.It Takes Several Minutes.");
// sQuery = "Delete from EMPPUBLICATION";
// HREmployee.UpdateQuery(sQuery);
// string sConnectionString = ConfigurationSettings.AppSettings["DBConnection"];
// using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sConnectionString))
// {
// bulkCopy.BulkCopyTimeout = 600; // in seconds
// bulkCopy.DestinationTableName = "EMPPUBLICATION";
// bulkCopy.WriteToServer(tablePUBLICATION);
// }
// }
// //For Punishment
// //DataTable tablePunishment = new DataTable("EmpPunishment");
// //// construct DataTable
// //tablePunishment.Columns.Add(new DataColumn("EmpPunishmentID", typeof(Int64)));
// //tablePunishment.Columns.Add(new DataColumn("EmpID", typeof(Int64)));
// //tablePunishment.Columns.Add(new DataColumn("PunishmentDate", typeof(DateTime)));
// //tablePunishment.Columns.Add(new DataColumn("Type", typeof(string)));
// //tablePunishment.Columns.Add(new DataColumn("Description", typeof(string)));
// //tablePunishment.Columns.Add(new DataColumn("Action", typeof(string)));
// //tablePunishment.Columns.Add(new DataColumn("CreatedBy", typeof(int)));
// //tablePunishment.Columns.Add(new DataColumn("CreationDate", typeof(DateTime)));
// //tablePunishment.Columns.Add(new DataColumn("ModifiedBy", typeof(int)));
// //tablePunishment.Columns.Add(new DataColumn("ModifiedDate", typeof(DateTime)));
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = dtEmpPunishment == null ? 0 : dtEmpPunishment.Rows.Count;
// //UpdateProgressStatus(EnumProcessStatus.Start);
// //EmpPunishment oEmpPunishment = null;
// //List<EmpPunishment> oEmpPunishments = new List<EmpPunishment>();
// //if (dtEmpPunishment != null)
// //{
// // sQuery = "Delete from EmpPunishment";
// // new HREmployee().UpdateQuery(sQuery);
// // long nPublicationMaxID = new HREmployee().GetMaxID("EmpPunishment", "EmpPunishmentID");
// // int nPunishCount = 1;
// // // oHREmployee.EmpPunishments = new List<EmpPunishment>();
// // foreach (DataRow oDrPunishment in dtEmpPunishment.Rows)
// // {
// // UpdateprocessStatus("Preparing Punishment Data For Employee : " + oDrPunishment["Employee_PIN"].ToString() + ". Record fetched " + nPunishCount.ToString() + "/" + dtEmpPunishment.Rows.Count.ToString());
// // UpdateProgressStatus(EnumProcessStatus.PerformStep);
// // HREmployee oExists = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo.ToLower() == oDrPunishment["Employee_PIN"].ToString().ToLower(); });
// // DateTime dTempDate;
// // oEmpPunishment = new EmpPunishment();
// // if (oExists != null)
// // {
// // oEmpPunishment.EmpID = oExists.ID;
// // if (DateTime.TryParse(oDrPunishment["Punishment_Date"].ToString(), out dTempDate))
// // {
// // oEmpPunishment.PunishmentDate = dTempDate;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Punishment_Date: " + oDrPunishment["Punishment_Date"].ToString().Trim(), oExists, EnumErrorType.Punishment);
// // }
// // else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Punishment_Date: " + oDrPunishment["Punishment_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtEmpPunishment.TableName + ", Row no=" + nPunishCount.ToString(), oExists, EnumErrorType.DateTimeFormat);
// // oEmpPunishment.Type = oDrPunishment["Type"].ToString().Trim();
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Type: " + oDrPunishment["Type"].ToString().Trim(), oExists, EnumErrorType.Punishment);
// // oEmpPunishment.Description = oDrPunishment["Description"].ToString().Trim();
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Description: " + oDrPunishment["Description"].ToString().Trim(), oExists, EnumErrorType.Punishment);
// // oEmpPunishment.Action = oDrPunishment["Action"].ToString().Trim();
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Action: " + oDrPunishment["Action"].ToString().Trim(), oExists, EnumErrorType.Punishment);
// // tablePunishment.Rows.Add(nPublicationMaxID, oEmpPunishment.EmpID.Integer, oEmpPunishment.PunishmentDate, oEmpPunishment.Type,
// // oEmpPunishment.Description, oEmpPunishment.Action, 1, DateTime.Today, 1, DateTime.Today);
// // nPublicationMaxID++;
// // }
// // //}
// // nPunishCount++;
// // }
// // UpdateProgressStatus(EnumProcessStatus.End);
// // this.UpdateprocessStatus("Saving Punishment Data.It Takes Several Minutes.");
// // string sConnectionString = ConfigurationSettings.AppSettings["DBConnection"];
// // using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sConnectionString))
// // {
// // bulkCopy.BulkCopyTimeout = 600; // in seconds
// // bulkCopy.DestinationTableName = "EmpPunishment";
// // bulkCopy.WriteToServer(tablePunishment);
// // }
// //}
// }
// catch (Exception ex)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message + sEmpNos, new HREmployee(), EnumErrorType.SystemError);
// throw new ServiceException(ex.Message);
// }
// return oHREmployees;
//}
//public List<HREmployee> ImportEmpGeneralInfoForBRAC2(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT)
//{
// List<HREmployee> oHREmployees = new List<HREmployee>();
// HREmployee oHREmployee = null;
// try
// {
// Console.WriteLine("Total employee found:" + oDTable.Rows.Count.ToString() + ".Uploading Employee data.It takes several minutes................");
// //UpdateprocessStatus("Creating new basic data....");
// SaveBasicData2(oDTable, oErrorLogDetails, oSuccessLogDetails);
// DataTable dtAcademic = null;
// //if (fromView)
// dtAcademic = oDT.Tables["View_Academic"];
// //else
// // dtAcademic = oDT.Tables["Academic"];
// SaveEducationBasicData2(dtAcademic, oErrorLogDetails, oSuccessLogDetails);
// DataTable dTSpouse = null;
// // if (fromView)
// dTSpouse = oDT.Tables["View_SpouseWorkingBrac"];
// //else
// // dTSpouse = oDT.Tables["SpouseWorkingBRAC"];
// DataTable dtExperience = null;
// //if (fromView)
// dtExperience = oDT.Tables["View_Experience"];
// //else
// // dtExperience = oDT.Tables["Experience"];
// DataTable dtTraining = null;
// //if (fromView)
// dtTraining = oDT.Tables["View_Training"];
// //else
// // dtTraining = oDT.Tables["Training"];
// DataTable dtPublication = null;
// // if (fromView)
// dtPublication = oDT.Tables["View_Publication"];
// //else
// // dtPublication = oDT.Tables["PublicationAward"];
// DataTable dtTransfer = null;
// // if (fromView)
// dtTransfer = oDT.Tables["View_PromotionTransferHistory"];
// //else
// // dtTransfer = oDT.Tables["PromotionTransferHistory"];
// DataTable dtEmpPunishment = null;
// //if (fromView)
// dtEmpPunishment = oDT.Tables["View_Punishment"];
// //else
// // dtEmpPunishment = oDT.Tables["Punishment"];
// int nGeneralCount = 1;
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// // UpdateProgressStatus(EnumProcessStatus.Start);
// foreach (DataRow oDr in oDTable.Rows)
// {
// // UpdateprocessStatus("Collecting data for employee : " + oDr["Employee_PIN"].ToString() + ". Record fetched " + nGeneralCount.ToString() + "/" + oDTable.Rows.Count.ToString());
// // UpdateProgressStatus(EnumProcessStatus.PerformStep);
// if (oDr["First_Name"].ToString().Trim() != string.Empty)
// {
// oHREmployee = new HREmployee();
// //_HREmployee.GlobalID = oDr["GDDB ID"].ToString();
// HREmployee oIsOld = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo == oDr["Employee_PIN"].ToString(); });
// if (oIsOld == null)
// oHREmployee.EmployeeNo = oDr["Employee_PIN"].ToString();
// else
// oHREmployee = oIsOld;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employee_PIN: " + oDr["Employee_PIN"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.BirthPlace = oDr["Place_Of_Birth"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Place of birth: " + oDr["Place_Of_Birth"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //_HREmployee.NickName = oDr["Nick Name"].ToString();
// oHREmployee.FirstName = oDr["First_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "First name: " + oDr["First_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.MiddleName = oDr["Middle_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Middle name: " + oDr["Middle_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.LastName = oDr["Last_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last name: " + oDr["Last_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// _HREmployee.Gender = (oDr["Gender"].ToString().Trim().ToUpper().Trim() == "MALE") ? EnumGender.Male : EnumGender.Female;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Gender: " + oDr["Gender"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// Religion oReligion = _Religions.Find(delegate(Religion oItem) { return oItem.Name.ToUpper().Trim() == oDr["Religion"].ToString().ToUpper().Trim(); });
// if (oReligion != null)
// {
// oHREmployee.ReligionID = oReligion.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Religion: " + oDr["Religion"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Religion: " + oDr["Religion"].ToString().Trim() + " is not found.Sheetname=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// if (oDr["Blood_Group"].ToString().ToUpper() == "B+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.BPos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "B-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.BNeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "A+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.APos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "A-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ANeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "O+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.OPos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "O-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ONeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "AB+")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ABPos;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "AB-")
// {
// oHREmployee.BloodGroup = EnumBloodGroup.ABNeg;
// }
// else if (oDr["Blood_Group"].ToString().ToUpper() == "Undefined".ToUpper())
// {
// oHREmployee.BloodGroup = EnumBloodGroup.OPos;
// }
// else
// oHREmployee.BloodGroup = EnumBloodGroup.None;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Blood Group: " + oDr["Blood_Group"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.PassportNo = oDr["Passport_No"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Passport No: " + oDr["Passport_No"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.TinNo = oDr["Tax_Identification_No"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Tax Identification No: " + oDr["Tax_Identification_No"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// Nationality oNationality = _Nationalites.Find(delegate(Nationality oItem) { return oItem.Description.ToUpper().Trim() == oDr["Nationality"].ToString().ToUpper().Trim(); });
// if (oNationality != null)
// {
// oHREmployee.NationalityID = oNationality.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Nationality: " + oDr["Nationality"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Nationality: " + oDr["Nationality"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// oHREmployee.NationalID = oDr["National_ID"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "National ID: " + oDr["National_ID"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// DateTime dTemFDate;
// if (DateTime.TryParse(oDr["Joining_Date"].ToString(), out dTemFDate))
// {
// oHREmployee.JoiningDate = dTemFDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Joining Date: " + oDr["Joining_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Joining date: invalid date.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// DateTime dTemBDate;
// if (DateTime.TryParse(oDr["Date_of_Birth"].ToString(), out dTemBDate))
// {
// oHREmployee.BirthDate = dTemBDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Date of Birth: " + oDr["Date_of_Birth"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Birth date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// DateTime dTemConfirmDate;
// if (DateTime.TryParse(oDr["Date_of_Confirmation"].ToString(), out dTemConfirmDate))
// {
// oHREmployee.ConfirDate = dTemConfirmDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Date of Confirmation: " + oDr["Date_of_Confirmation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Confirmation date: invalid date.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// oHREmployee.FatherName = oDr["Fathers_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Fathers Name: " + oDr["Fathers_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.MotherName = oDr["Mothers_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Mothers Name: " + oDr["Mothers_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// Occupation oFOccupation = _Occupations.Find(delegate(Occupation oItem) { return oItem.Description.ToUpper().Trim() == oDr["Fathers_Occupation"].ToString().ToUpper().Trim(); });
// if (oFOccupation != null)
// {
// oHREmployee.FatherOccupationID = oFOccupation.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Fathers Occupation: " + oDr["Fathers_Occupation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Father's Occupation: " + oDr["Father's_Occupation"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// //}
// Occupation oMOccupation = _Occupations.Find(delegate(Occupation oItem) { return oItem.Description.ToUpper().Trim() == oDr["Mothers_Occupation"].ToString().ToUpper().Trim(); });
// if (oMOccupation != null)
// {
// oHREmployee.MotherOccupationID = oMOccupation.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Mothers Occupation: " + oDr["Mothers_Occupation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Mother's Occupation: " + oDr["Mother's_Occupation"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// //}
// Designation oDesignation = _oDesignations.Find(delegate(Designation oItem) { return oItem.Code.ToUpper().Trim() == oDr["Designation_Code"].ToString().ToUpper().Trim(); });
// if (oDesignation != null)
// {
// oHREmployee.DesignationID = oDesignation.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDr["Designation_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDr["Designation_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Category oCategory = _Categories.Find(delegate(Category oItem) { return oItem.Code.ToUpper().Trim() == oDr["Employee_Type_Code"].ToString().ToUpper().Trim(); });
// if (oCategory != null)
// {
// oHREmployee.CategoryID = oCategory.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employee_Type_Code: " + oDr["Employee_Type_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee_Type_Code: " + oDr["Employee_Type_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Department oDepartment = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Program_Code"].ToString().ToUpper().Trim(); });
// if (oDepartment != null)
// {
// oHREmployee.DepartmentID = oDepartment.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Program_Code: " + oDr["Program_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program_Code: " + oDr["Program_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["District_Code"].ToString().ToUpper().Trim(); });
// if (oLocation != null)
// {
// oHREmployee.LocationID = oLocation.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Location: " + oDr["District_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location: " + oDr["District_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Grade oGrade = _oGrades.Find(delegate(Grade oItem) { return oItem.Code.ToUpper().Trim() == oDr["Level_Code"].ToString().ToUpper().Trim(); });
// if (oGrade != null)
// {
// oHREmployee.GradeID = oGrade.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level_Code: " + oDr["Level_Code"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level_Code: " + oDr["Level_Code"].ToString().Trim() + " is not found.Sheet name=" + oDTable.TableName + ", Row no=" + nGeneralCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// oHREmployee.ForeignExPat = oDr["Company"].ToString().ToLower() == "brac" ? false : true;
// oHREmployee.EmailAddress = oDr["Email_Address"].ToString();
// oHREmployee.MobileNo = oDr["Mobile_Number"].ToString();
// DateTime dLastDateOfPromotion;
// if (DateTime.TryParse(oDr["Last_Date_Of_Promotion"].ToString(), out dLastDateOfPromotion))
// {
// oHREmployee.LastPromotionDate = dLastDateOfPromotion;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last Promotion Date: " + oDr["Last_Date_Of_Promotion"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dContractEndDate;
// if (DateTime.TryParse(oDr["Contract_End_Date"].ToString(), out dContractEndDate))
// {
// oHREmployee.ContractEndDate = dContractEndDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Contract End Date: " + oDr["Contract_End_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dLastContractRenuwalDate;
// if (DateTime.TryParse(oDr["Last_Contract_Renuwal_Date"].ToString(), out dLastContractRenuwalDate))
// {
// oHREmployee.LastContractRenewalDate = dLastContractRenuwalDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last Contract Renuwal Date: " + oDr["Last_Contract_Renuwal_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dLastSalaryIncreaseDate;
// if (DateTime.TryParse(oDr["Last_Salary_Increase_Date"].ToString(), out dLastSalaryIncreaseDate))
// {
// oHREmployee.LastSalaryIncreaseDate = dLastSalaryIncreaseDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last Salary Increase Date: " + oDr["Last_Salary_Increase_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// DateTime dJoiningDateofBRACInt;
// if (DateTime.TryParse(oDr["Joining_Date_of_BRAC_Int"].ToString(), out dJoiningDateofBRACInt))
// {
// oHREmployee.JoinDateBracInt = dJoiningDateofBRACInt;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Joining Date of BRAC Int: " + oDr["Joining_Date_of_BRAC_Int"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// //Fixed Values
// oHREmployee.PayrollTypeID = (1);
// oHREmployee.Status = oDr["IsDiscontinued"].ToString().ToLower() == "no" ? EnumEmployeeStatus.Live : EnumEmployeeStatus.Discontinued;
// //Find Spouse
// EmpSpouse oEmpSpouse = null;
// oHREmployee.Spouses = new List<EmpSpouse>();
// if (dTSpouse != null)
// {
// int nSCount = 1;
// foreach (DataRow drSpouse in dTSpouse.Rows)
// {
// if (oDr["Employee_PIN"].ToString().ToLower() == drSpouse["Employee_PIN"].ToString().ToLower())
// {
// oEmpSpouse = new EmpSpouse();
// oEmpSpouse.Name = drSpouse["Spouse_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Spouse Name: " + drSpouse["Spouse_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpSpouse.SpousePIN = drSpouse["Spouse_PIN"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Spouse PIN: " + drSpouse["Spouse_PIN"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// if (drSpouse["Spouse_Level_of_Education"].ToString() != string.Empty)
// {
// EducationLevel oEdLevel = _EducationLevels.Find(delegate(EducationLevel oItem) { return oItem.Description.ToUpper().Trim() == drSpouse["Spouse_Level_of_Education"].ToString().ToUpper().Trim(); });
// if (oEdLevel != null)
// {
// oEmpSpouse.EducationLevelID = oEdLevel.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Spouse Level_of_Education: " + drSpouse["Spouse_Level_of_Education"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// }
// else
// {
// oEmpSpouse.EducationLevelID = (1);
// }
// Occupation oOccup = _Occupations.Find(delegate(Occupation oItem) { return oItem.Description.ToUpper().Trim() == drSpouse["Spouse_Occupation"].ToString().ToUpper().Trim(); });
// if (oOccup != null)
// {
// oEmpSpouse.OccupationID = oOccup.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Spouse Occupation: " + drSpouse["Spouse_Occupation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// oEmpSpouse.OccupationID = (1);
// DateTime dSpouseBDate;
// if (DateTime.TryParse(drSpouse["Date_of_Marriage"].ToString(), out dSpouseBDate))
// {
// oEmpSpouse.MarriageDate = dSpouseBDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Date of Marriage:" + drSpouse["Date_of_Marriage"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Date of Marriage: " + drSpouse["Date_of_Marriage"].ToString().Trim() + " is an invalid date.Sheet name=" + dTSpouse.TableName + ", Row no=" + nSCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// oHREmployee.Spouses.Add(oEmpSpouse);
// }
// nSCount++;
// }
// }
// //Find Academic
// EmpAcademic oEmpAcademic = null;
// oHREmployee.Academics = new List<EmpAcademic>();
// if (dtAcademic != null)
// {
// int nAcaCount = 1;
// foreach (DataRow oDrAcademic in dtAcademic.Rows)
// {
// if (oDr["Employee_PIN"].ToString().ToLower() == oDrAcademic["Employee_PIN"].ToString().ToLower())
// {
// //if (oDrAcademic["Education_Type"].ToString().Trim() != string.Empty)
// //{
// oEmpAcademic = new EmpAcademic();
// //EducationType oEDType = _EducationTypes.Find(delegate(EducationType oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Education_Type"].ToString().ToUpper().Trim(); });
// //if (oEDType != null)
// //{
// // oEmpAcademic.EducationTypeID = oEDType.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Education_Type: " + oDrAcademic["Education_Type"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //}
// //else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Education_Type: " + oDrAcademic["Education_Type"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// oEmpAcademic.EducationTypeID = (1);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Education_Type: " + oDrAcademic["Education_Type"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// EducationLevel oEducLevel = _EducationLevels.Find(delegate(EducationLevel oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Level_of_Education"].ToString().ToUpper().Trim(); });
// if (oEducLevel != null)
// {
// oEmpAcademic.EducationLevelID = oEducLevel.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level_of_Education: " + oDrAcademic["Level_of_Education"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Education level: " + oDrAcademic["Level_of_Education"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// Discipline oDis = _Disciplines.Find(delegate(Discipline oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Discipline"].ToString().ToUpper().Trim(); });
// if (oDis != null)
// {
// oEmpAcademic.DisciplineID = oDis.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Discipline: " + oDrAcademic["Discipline"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// oEmpAcademic.DisciplineID = (1);
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Discipline: " + oDrAcademic["Discipline"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// Institution oIns = _Institutions.Find(delegate(Institution oItem) { return oItem.Name.ToUpper().Trim() == oDrAcademic["Institution"].ToString().ToUpper().Trim(); });
// if (oIns != null)
// {
// oEmpAcademic.InstitutionID = oIns.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Institution: " + oDrAcademic["Institution"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// oEmpAcademic.InstitutionID = (1);
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Institution (Board/University): " + oDrAcademic["Institution"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// }
// oEmpAcademic.InstituteName = oDrAcademic["Institution_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Institution_Name: " + oDrAcademic["Institution_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// int dExamYear = 0;
// if (oDrAcademic["Year_of_Exam"].ToString() != "")
// {
// dExamYear = Convert.ToInt16(oDrAcademic["Year_of_Exam"]);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Year_of_Exam: " + oDrAcademic["Year_of_Exam"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpAcademic.ExamDate = dExamYear;
// }
// int dPassingYear = 0;
// if (oDrAcademic["Passing_Year"].ToString() != "")
// {
// dPassingYear = Convert.ToInt16(oDrAcademic["Passing_Year"]);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Passing_Year: " + oDrAcademic["Passing_Year"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpAcademic.PassingYear = dPassingYear;
// }
// ResultType oRType = _ResultTypes.Find(delegate(ResultType oItem) { return oItem.Description.ToUpper().Trim() == oDrAcademic["Div/Class"].ToString().ToUpper().Trim(); });
// if (oRType != null)
// {
// oEmpAcademic.ResultTypeID = oRType.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Div/Class: " + oDrAcademic["Div/Class"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Div/Class: " + oDrAcademic["Div/Class"].ToString().Trim() + " is not found.Sheet name=" + dtAcademic.TableName + ", Row no=" + nAcaCount.ToString(), oHREmployee, EnumErrorType.BasicData);
// if (oDrAcademic["CGPA/Total_Marks"].ToString() != string.Empty || oDrAcademic["CGPA/Total_Marks"].ToString().Length > 0)
// {
// oEmpAcademic.GPAOrMarks = Convert.ToDouble(oDrAcademic["CGPA/Total_Marks"]);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "CGPA/Total_Marks: " + oDrAcademic["CGPA/Total_Marks"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// oEmpAcademic.LastLevel = (oDrAcademic["Highest_Education"].ToString().ToUpper().Trim() == "Y".ToUpper().Trim()) ? true : false;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Highest_Education: No", oHREmployee, EnumErrorType.BasicData);
// oHREmployee.Academics.Add(oEmpAcademic);
// //}
// }
// nAcaCount++;
// }
// }
// //For Experience
// EmpExperience oEmpExperience = null;
// oHREmployee.Experiences = new List<EmpExperience>();
// if (dtExperience != null)
// {
// int nexCount = 1;
// foreach (DataRow oDrExperience in dtExperience.Rows)
// {
// if (oDr["Employee_PIN"].ToString().ToLower() == oDrExperience["Employee_PIN"].ToString().ToLower())
// {
// if (oDrExperience["Employer"].ToString().Trim() != string.Empty)
// {
// oEmpExperience = new EmpExperience();
// oEmpExperience.Employer = oDrExperience["Employer"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employer: " + oDrExperience["Employer"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpExperience.ContactPerson = oDrExperience["Contact_Person"].ToString() != string.Empty ? oDrExperience["Contact_Person"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Contact_Person: " + oDrExperience["Contact_Person"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpExperience.Address = oDrExperience["Address"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Address: " + oDrExperience["Address"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpExperience.Telephone = oDrExperience["Telephone_No"].ToString() != string.Empty ? oDrExperience["Telephone_No"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Telephone_No: " + oDrExperience["Telephone_No"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //oEmpExperience.EmployerActivity = oDrExperience["Brief Activity_of_Employer_Organization"].ToString();
// //SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Brief Activity_of_Employer_Organization: " + oDrExperience["Brief Activity_of_Employer_Organization"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpExperience.Designation = oDrExperience["Designation"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDrExperience["Designation"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpExperience.JobDescription = oDrExperience["Job_Description"].ToString() != string.Empty ? oDrExperience["Job_Description"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Job_Description: " + oDrExperience["Job_Description"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// DateTime dExpFDate;
// if (DateTime.TryParse(oDrExperience["Employed_From_Date"].ToString(), out dExpFDate))
// {
// oEmpExperience.FromDate = dExpFDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employed_From_Date: " + oDrExperience["Employed_From_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// oEmpExperience.FromDate = DateTime.Today;
// //else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employed_From_Date: " + oDrExperience["Employed_From_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtExperience.TableName + ", Row no=" + nexCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// DateTime dTempDate;
// if (DateTime.TryParse(oDrExperience["Employed_To_Date"].ToString(), out dTempDate))
// {
// oEmpExperience.ToDate = dTempDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employed_To_Date: " + oDrExperience["Employed_To_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// oEmpExperience.ToDate = DateTime.Today;
// oEmpExperience.LastJob = false;// oDrExperience["Last_Job"].ToString().ToLower() == "y" ? true : false;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Last_Job: " + oDrExperience["Last_Job"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oHREmployee.Experiences.Add(oEmpExperience);
// }
// }
// nexCount++;
// }
// }
// //For Training
// EmpTraining oEmpTraining = null;
// oHREmployee.Trainings = new List<EmpTraining>();
// if (dtTraining != null)
// {
// int nTrCount = 1;
// foreach (DataRow oDrTraining in dtTraining.Rows)
// {
// if (oDr["Employee_PIN"].ToString().ToLower() == oDrTraining["Employee_PIN"].ToString().ToLower())
// {
// if (oDrTraining["Training_Name"].ToString().Trim() != string.Empty)
// {
// oEmpTraining = new EmpTraining();
// oEmpTraining.Name = oDrTraining["Training_Name"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Name: " + oDrTraining["Training_Name"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpTraining.TrainingTypeID = (1);
// oEmpTraining.NatureOfTrainingID = (1);
// oEmpTraining.Description = oDrTraining["Training_Description"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Description: " + oDrTraining["Training_Description"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// Institution oIns = _Institutions.Find(delegate(Institution oItem) { return oItem.Name.ToUpper().Trim() == oDrTraining["Training_Institution"].ToString().ToUpper().Trim(); });
// if (oIns != null)
// {
// oEmpTraining.InstitutionID = oIns.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Institution: " + oDrTraining["Training_Institution"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// oEmpTraining.InstitutionID = (1);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Training_Institution: " + oDrTraining["Training_Institution"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// oEmpTraining.Place = oDrTraining["Place_of_Training"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Place_of_Training: " + oDrTraining["Place_of_Training"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// Country oCountry = _Contries.Find(delegate(Country oItem) { return oItem.Name.ToUpper().Trim() == oDrTraining["Country_of_Training"].ToString().ToUpper().Trim(); });
// if (oCountry != null)
// {
// oEmpTraining.CountryID = oCountry.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Country_of_Training: " + oDrTraining["Country_of_Training"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// {
// oEmpTraining.CountryID = (1);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Country_of_Training: " + oDrTraining["Country_of_Training"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// oEmpTraining.Achievements = "";
// oEmpTraining.TrainingCompletedFrom = EnumTrainingCompletedFrom.Own;
// oEmpTraining.Fees = 0.0;
// oEmpTraining.OtherCost = 0.0;
// DateTime dTempFdate;
// if (oDrTraining["From_Date"].ToString() == "")
// oDrTraining["From_Date"] = "1 Jan 2013";
// if (DateTime.TryParse(oDrTraining["From_Date"].ToString(), out dTempFdate))
// {
// oEmpTraining.FromDate = dTempFdate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "From_Date: " + oDrTraining["From_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "From_Date: " + oDrTraining["From_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtTraining.TableName + ", Row no=" + nTrCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// DateTime oTEmpDate;
// if (oDrTraining["To_Date"].ToString() == "")
// oDrTraining["To_Date"] = "2 Jan 2013";
// if (DateTime.TryParse(oDrTraining["To_Date"].ToString(), out oTEmpDate))
// {
// oEmpTraining.ToDate = oTEmpDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "To_Date: " + oDrTraining["To_Date"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "To_Date: " + oDrTraining["To_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtTraining.TableName + ", Row no=" + nTrCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// int nMonths;
// int nDays;
// int nHours;
// //if (int.TryParse(oDrTraining["Month"].ToString().Trim(), out nMonths))
// //{
// // oEmpTraining.TrainingMonth = Convert.ToInt16(oDrTraining["Month"].ToString().Trim());
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Month: " + oDrTraining["Month"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //}
// //if (int.TryParse(oDrTraining["Days"].ToString().Trim(), out nDays))
// //{
// // oEmpTraining.TrainingDay = Convert.ToInt16(oDrTraining["Days"].ToString().Trim());
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Days: " + oDrTraining["Days"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //}
// //if (int.TryParse(oDrTraining["Hour"].ToString().Trim(), out nHours))
// //{
// // oEmpTraining.TrainingHour = Convert.ToInt16(oDrTraining["Hour"].ToString().Trim());
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Hour: " + oDrTraining["Hour"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// //}
// TimeSpan ts = oEmpTraining.ToDate - oEmpTraining.FromDate;
// oEmpTraining.TrainingHour = ts.Hours == 0 ? 8 : 8 * ts.Hours;
// oHREmployee.Trainings.Add(oEmpTraining);
// }
// }
// nTrCount++;
// }
// }
// //For Publication
// EmpPublication oEmpPublication = null;
// oHREmployee.Publications = new List<EmpPublication>();
// if (dtPublication != null)
// {
// int nPubCount = 1;
// foreach (DataRow oDrPublication in dtPublication.Rows)
// {
// if (oDr["Employee_PIN"].ToString().ToLower() == oDrPublication["Employee_PIN"].ToString().ToLower())
// {
// if (oDrPublication["Publication_Title"].ToString().Trim() != string.Empty)
// {
// oEmpPublication = new EmpPublication();
// oEmpPublication.Title = oDrPublication["Publication_Title"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Publication_Title: " + oDrPublication["Publication_Title"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpPublication.PublicationType = oDrPublication["Publication_Type"].ToString();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Publication_Type: " + oDrPublication["Publication_Type"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpPublication.Description = oDrPublication["Description"].ToString() != string.Empty ? oDrPublication["Description"].ToString() : "";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Description :" + oDrPublication["Description"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// oEmpPublication.Remarks = oDrPublication["Remarks"].ToString() != string.Empty ? oDrPublication["Remarks"].ToString() : "N/A";
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Remarks: " + oDrPublication["Remarks"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// DateTime dTempDate;
// if (DateTime.TryParse(oDrPublication["Date_of_Publication"].ToString(), out dTempDate))
// {
// oEmpPublication.PublicationDate = dTempDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Date_of_Publication: " + oDrPublication["Date_of_Publication"].ToString().Trim(), oHREmployee, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Date_of_Publication: " + oDrPublication["Date_of_Publication"].ToString().Trim() + " is invalid date.Sheet name=" + dtPublication.TableName + ", Row no=" + nPubCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// oHREmployee.Publications.Add(oEmpPublication);
// }
// }
// nPubCount++;
// }
// }
// //For Promotion, Transfer History
// //EmpLifeCycle oEmpLifeCycle = null;
// //oHREmployee.EmpLifeCycles = new List<EmpLifeCycle>();
// //if (dtTransfer != null)
// //{
// // int nLCCount = 1;
// // oHREmployee.EmpLifeCycles = new List<EmpLifeCycle>();
// // foreach (DataRow oDrTransfer in dtTransfer.Rows)
// // {
// // if (oDr["Employee_PIN"].ToString().ToLower() == oDrTransfer["Employee_PIN"].ToString().ToLower())
// // {
// // DateTime dTempDate;
// // oEmpLifeCycle = new EmpLifeCycle();
// // if (oDrTransfer["Effect_Type"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Effect_Type not found.Sheet name=" + dtTransfer.TableName + ", Row no=" + nLCCount.ToString(), oHREmployee, EnumErrorType.Transfer);
// // }
// // else
// // {
// // if (oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer")
// // oEmpLifeCycle.StatusDetailID = (5);
// // else
// // oEmpLifeCycle.StatusDetailID = (2);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Effect_Type: " + oDrTransfer["Effect_Type"].ToString().Trim(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // if (DateTime.TryParse(oDrTransfer["Effect_Date"].ToString(), out dTempDate))
// // {
// // oEmpLifeCycle.EffectDate = dTempDate;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Effect_Date: " + oDrTransfer["Effect_Date"].ToString().Trim(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Effect_Date: " + oDrTransfer["Effect_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtTransfer.TableName + ", Row no=" + nLCCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// // Department oDepartment3 = _oDepartments.Find(delegate(Department oItem) { return oItem.Name.ToUpper().Trim() == oDrTransfer["Department"].ToString().ToUpper().Trim(); });
// // if (oDepartment3 != null)
// // {
// // oEmpLifeCycle.DepartmentID = oDepartment3.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Department: " + oDrTransfer["Department"].ToString().Trim(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // else
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Department: " + oDrTransfer["Department"].ToString().Trim() + " is not found.Sheet name=" + dtTransfer.TableName + ", Row no=" + nLCCount.ToString(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // Location oLocation3 = _oLocations.Find(delegate(Location oItem) { return oItem.Name.ToUpper().Trim() == oDrTransfer["Location"].ToString().ToUpper().Trim(); });
// // if (oLocation != null)
// // {
// // oEmpLifeCycle.LocationID = oLocation3.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Location: " + oDrTransfer["Location"].ToString().Trim(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // else
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location: " + oDrTransfer["Location"].ToString().Trim() + " is not found.Sheet name=" + dtTransfer.TableName + ", Row no=" + nLCCount.ToString(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // Designation oDesignation3 = _oDesignations.Find(delegate(Designation oItem) { return oItem.Name.ToUpper().Trim() == oDrTransfer["Designation"].ToString().ToUpper().Trim(); });
// // if (oDesignation != null)
// // {
// // oEmpLifeCycle.DesignationID = oDesignation3.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDrTransfer["Designation"].ToString().Trim(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // else
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation: " + oDrTransfer["Designation"].ToString().Trim() + " is not found.Sheet name=" + dtTransfer.TableName + ", Row no=" + nLCCount.ToString(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // Grade oGrade3 = _oGrades.Find(delegate(Grade oItem) { return oItem.Name.ToUpper().Trim() == oDrTransfer["Grade"].ToString().ToUpper().Trim(); });
// // if (oGrade != null)
// // {
// // oEmpLifeCycle.GradeID = oGrade3.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Grade: " + oDrTransfer["Grade"].ToString().Trim(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // else
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Grade: " + oDrTransfer["Grade"].ToString().Trim() + " is not found.Sheet name=" + dtTransfer.TableName + ", Row no=" + nLCCount.ToString(), oHREmployee, oDrTransfer["Effect_Type"].ToString().ToLower() == "transfer" ? EnumErrorType.Transfer : EnumErrorType.Promotion);
// // }
// // oHREmployee.EmpLifeCycles.Add(oEmpLifeCycle);
// // }
// // nLCCount++;
// // }
// //}
// //For Punishment
// EmpPunishment oEmpPunishment = null;
// oHREmployee.EmpPunishments = new List<EmpPunishment>();
// if (dtEmpPunishment != null)
// {
// oHREmployee.EmpPunishments = new List<EmpPunishment>();
// foreach (DataRow oDrPunishment in dtEmpPunishment.Rows)
// {
// int nPunishCount = 1;
// if (oDr["Employee_PIN"].ToString().ToLower() == oDrPunishment["Employee_PIN"].ToString().ToLower())
// {
// DateTime dTempDate;
// oEmpPunishment = new EmpPunishment();
// if (DateTime.TryParse(oDrPunishment["Punishment_Date"].ToString(), out dTempDate))
// {
// oEmpPunishment.PunishmentDate = dTempDate;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Punishment_Date: " + oDrPunishment["Punishment_Date"].ToString().Trim(), oHREmployee, EnumErrorType.Punishment);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Punishment_Date: " + oDrPunishment["Punishment_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtEmpPunishment.TableName + ", Row no=" + nPunishCount.ToString(), oHREmployee, EnumErrorType.DateTimeFormat);
// oEmpPunishment.Type = oDrPunishment["Type"].ToString().Trim();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Type: " + oDrPunishment["Type"].ToString().Trim(), oHREmployee, EnumErrorType.Punishment);
// oEmpPunishment.Description = oDrPunishment["Description"].ToString().Trim();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Description: " + oDrPunishment["Description"].ToString().Trim(), oHREmployee, EnumErrorType.Punishment);
// oEmpPunishment.Action = oDrPunishment["Action"].ToString().Trim();
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Action: " + oDrPunishment["Action"].ToString().Trim(), oHREmployee, EnumErrorType.Punishment);
// oHREmployee.EmpPunishments.Add(oEmpPunishment);
// }
// nPunishCount++;
// }
// }
// oHREmployees.Add(oHREmployee);
// }
// nGeneralCount++;
// }
// this.SaveHREmpData(oHREmployees);
// List<HREmployee> oOldEmps = new List<HREmployee>();
// foreach (HREmployee oEmp in oExistingHREmployees)
// {
// HREmployee oIsExists = oHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo == oEmp.EmployeeNo; });
// if (oIsExists == null)
// oOldEmps.Add(oEmp);
// }
// new HREmployee().UpdateEmployeesStatus2(oOldEmps);
// oExistingHREmployees = new List<HREmployee>();
// oExistingHREmployees = oHREmployees;
// }
// catch (Exception ex)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.SystemError);
// throw new ServiceException(ex.Message);
// }
// return oHREmployees;
//}
public void ImportOrganogram(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT, bool fromView)
{
try
{
DataTable dTOrganogram = null;
if (fromView)
dTOrganogram = oDT.Tables["View_Organogram"];
else
dTOrganogram = oDT.Tables["Organogram"];
//SaveOrganogram(dTOrganogram, oErrorLogDetails, oSuccessLogDetails);
}
catch (Exception ex)
{
SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.Exception);
throw new ServiceException(ex.Message);
}
}
//public void ImportOrganogramForBRAC2(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT)
//{
// try
// {
// DataTable dTOrganogram = null;
// //if (fromView)
// dTOrganogram = oDT.Tables["View_Organogram"];
// //else
// // dTOrganogram = oDT.Tables["Organogram"];
// //UpdateprocessStatus("Creating organogram ....");
// Console.WriteLine("Total record found:" + dTOrganogram.Rows.Count.ToString() + ".Uploading Organogram data.It takes several minutes................");
// SaveOrganogram2(dTOrganogram, oErrorLogDetails, oSuccessLogDetails);
// //UpdateProgressStatus(EnumProcessStatus.End);
// }
// catch (Exception ex)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.SystemError);
// throw new ServiceException(ex.Message);
// }
//}
//public void ImportChangePositionForBRAC(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT, bool fromView)
//{
// try
// {
// DataTable dTCOrganogram = null;
// if (fromView)
// dTCOrganogram = oDT.Tables["View_ChangeNodePosition"];
// else
// dTCOrganogram = oDT.Tables["ChangeNodePosition"];
// UpdateprocessStatus("Performing reposition nodes....");
// SaveRepositionOrganogram(dTCOrganogram, oErrorLogDetails, oSuccessLogDetails);
// }
// catch (Exception ex)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.SystemError);
// throw new ServiceException(ex.Message);
// }
//}
//public void ImportChangePositionForBRAC2(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT)
//{
// try
// {
// DataTable dTCOrganogram = null;
// //if (fromView)
// dTCOrganogram = oDT.Tables["View_ChangeNodePosition"];
// //else
// // dTCOrganogram = oDT.Tables["ChangeNodePosition"];
// //UpdateprocessStatus("Performing reposition nodes....");
// Console.WriteLine("Total record found:" + dTCOrganogram.Rows.Count.ToString() + ".Uploading Changenode data.It takes several minutes................");
// SaveRepositionOrganogram(dTCOrganogram, oErrorLogDetails, oSuccessLogDetails);
// }
// catch (Exception ex)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.SystemError);
// throw new ServiceException(ex.Message);
// }
//}
//public void ImportPosting(List<Employee> Emps)
//{
// try
// {
// //new OrganogramEmployee().DeleteAll();
// DataTable tablePosting = new DataTable("OrganEmployee");
// // construct DataTable
// tablePosting.Columns.Add(new DataColumn("OrganEmpID", typeof(Int64)));
// tablePosting.Columns.Add(new DataColumn("NodeID", typeof(Int64)));
// tablePosting.Columns.Add(new DataColumn("EmployeeID", typeof(Int64)));
// tablePosting.Columns.Add(new DataColumn("AssignDate", typeof(string)));
// tablePosting.Columns.Add(new DataColumn("CreatedBy", typeof(int)));
// tablePosting.Columns.Add(new DataColumn("CreationDate", typeof(DateTime)));
// tablePosting.Columns.Add(new DataColumn("ModifiedBy", typeof(int)));
// tablePosting.Columns.Add(new DataColumn("ModifiedDate", typeof(DateTime)));
// List<OrganogramEmployee> oPostings = OrganogramEmployee.Get();
// List<HREmployee> oExistingHREmployees = HREmployee.Get();
// //DataTable dtOrganogramEmployee = null;
// //if (fromView)
// // dtOrganogramEmployee = oDT.Tables["View_OrganogramPosting"];
// //else
// // dtOrganogramEmployee = oDT.Tables["OrganogramPosting"];
// List<OrganogramEmployee> AssignOrganograms = OrganogramEmployee.Get();
// List<OrganogramEmployee> AssignOrganogramsNew = new List<OrganogramEmployee>();
// OrganogramEmployee oOrganogramEmployee = null;
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = Emps.Count;
// PayrollPayrollGlobalFunctions.TotalEmployeeCount = Emps.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// if (Emps != null)
// {
// int nPosCount = 1;
// long nID = 1;
// _oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// foreach (Employee emp in Emps)
// {
// HREmployee oIsOld = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo == emp.EmployeeNo; });
// OrganogramEmployee oOldOrganogramEmployee = AssignOrganograms.Find(delegate(OrganogramEmployee oee1) { return oee1.Position.PositionNo == emp.EmployeeNo.ToString(); });
// if (oIsOld != null)
// {
// UpdateprocessStatus("Collecting Posting data for employee : " + emp.EmployeeNo + ". Record fetched " + nPosCount.ToString() + "/" + Emps.Count);
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// DateTime dTempDate;
// if(oOldOrganogramEmployee==null)
// oOrganogramEmployee = new OrganogramEmployee();
// else
// oOrganogramEmployee = oOldOrganogramEmployee;
// oOrganogramEmployee.AssignDate = DateTime.Today;
// oOrganogramEmployee.EmployeeID = oIsOld.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Assign_Date: " + oDrOrg["Assign_Date"].ToString().Trim(), oIsOld, EnumErrorType.Exception);
// //}
// //else
// //{
// // oOrganogramEmployee.AssignDate = DateTime.Today;
// // oOrganogramEmployee.EmployeeID = oIsOld.ID;
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Assign_Date: " + oDrOrg["Assign_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtOrganogramEmployee.TableName + ", Row no=" + nPosCount.ToString(), oIsOld, EnumErrorType.Exception);
// //}
// OrganogramBasic oOrg = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == emp.EmployeeNo.ToUpper().Trim(); });
// if (oOrg != null)
// {
// oOrganogramEmployee.NodeID = oOrg.ID;
// //if (oOrg.DepartmentID != oIsOld.DepartmentID)
// //{
// // oOrg.DepartmentID = oIsOld.DepartmentID;
// // oOrg.CompanyID = oIsOld.CompanyID;
// // oOrg.DesignationID = oIsOld.DesignationID;
// // oOrg.LocationID = oIsOld.LocationID;
// // oOrg.GradeID = oIsOld.GradeID;
// // oOrg.FunctionID = oIsOld.FunctionID;
// // oOrg.Save();
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employee posting at: " + oDrOrg["Position_No"].ToString().Trim(), oIsOld, EnumErrorType.Organogram);
// //}
// //tablePosting.Rows.Add(nID, oOrganogramEmployee.NodeID.Integer, oOrganogramEmployee.EmployeeID.Integer, oOrganogramEmployee.AssignDate,
// //1, DateTime.Today, 1, DateTime.Today);
// //nID++;
// AssignOrganogramsNew.Add(oOrganogramEmployee);
// }
// //else
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + oDrOrg["Position_No"].ToString().Trim() + " not found.Sheet name=" + dtOrganogramEmployee.TableName + ", Row no=" + nPosCount.ToString(), oIsOld, EnumErrorType.BasicData);
// }
// else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee PIN: " + oDrOrg["Employee_PIN"].ToString().Trim() + " not found.Sheet name=" + dtOrganogramEmployee.TableName + ", Row no=" + nPosCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// nPosCount++;
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// }
// this.UpdateProgressStatus(EnumProcessStatus.End);
// this.UpdateprocessStatus("Saving posting data.It takes several minutes.");
// //new HREmployee().UpdateQuery("Delete from OrganEmployeeTemp");
// //string sConnectionString = ConfigurationSettings.AppSettings["DBConnection"];
// //using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sConnectionString))
// //{
// // bulkCopy.BulkCopyTimeout = 600; // in seconds
// // bulkCopy.DestinationTableName = "OrganEmployeeTemp";
// // bulkCopy.WriteToServer(tablePosting);
// //}
// //new HREmployee().RunQuery("OrganEmployeeTemp", "OrganEmployee");
// OrganogramEmployee.Save(AssignOrganogramsNew);
// this.UpdateprocessStatus("Updating Employee Line Manager.It takes several minutes.");
// Employee.UpdateLineManager(Emps);
// }
// }
// catch (Exception ex)
// {
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.Exception);
// throw new ServiceException(ex.Message);
// }
//}
//public void ImportAssignMatrixLineAuthorityForBRAC(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT, bool fromView)
//{
// try
// {
// DataTable tablePosting = new DataTable("OrganAuthority");
// // construct DataTable
// tablePosting.Columns.Add(new DataColumn("OrganAuthorityID", typeof(Int64)));
// tablePosting.Columns.Add(new DataColumn("NodeID", typeof(Int64)));
// tablePosting.Columns.Add(new DataColumn("AuthorityType", typeof(string)));
// tablePosting.Columns.Add(new DataColumn("ChildNodeID", typeof(Int64)));
// tablePosting.Columns.Add(new DataColumn("EmployeeID", typeof(Int64)));
// tablePosting.Columns.Add(new DataColumn("ModifiedBy", typeof(int)));
// tablePosting.Columns.Add(new DataColumn("ModifiedDate", typeof(DateTime)));
// List<OrganogramEmployee> oPostings = OrganogramEmployee.Get();
// //List<HREmployee> oExistingHREmployees = HREmployee.Get();
// DataTable dtOrganogramAuthority = null;
// if (fromView)
// dtOrganogramAuthority = oDT.Tables["View_AssignMatrixLineAuthority"];
// else
// dtOrganogramAuthority = oDT.Tables["AssignMatrixLineAuthority"];
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = dtOrganogramAuthority.Rows.Count;
// PayrollPayrollGlobalFunctions.TotalEmployeeCount = dtOrganogramAuthority.Rows.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// if (dtOrganogramAuthority != null)
// {
// int nPosCount = 1;
// long nID = 1;
// foreach (DataRow oDrOrg in dtOrganogramAuthority.Rows)
// {
// UpdateprocessStatus("Collecting Matrix data for node : " + oDrOrg["Position_NO"].ToString() + ". Record fetched " + nPosCount.ToString() + "/" + dtOrganogramAuthority.Rows.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// OrganogramBasic oOrg = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDrOrg["Position_No"].ToString().ToUpper().Trim(); });
// if (oOrg != null)
// {
// OrganogramBasic oOrgMatrix = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDrOrg["Matrix_Position_No"].ToString().ToUpper().Trim(); });
// if (oOrgMatrix != null)
// {
// OrganogramEmployee oOrgEmployee = oPostings.Find(delegate(OrganogramEmployee oItem) { return oItem.NodeID == oOrg.ID; });
// if (oOrgEmployee != null)
// {
// tablePosting.Rows.Add(nID, oOrgMatrix.ID.Integer, (int)EnumAuthorityType.Reporting, oOrg.ID.Integer, oOrgEmployee.EmployeeID.Integer, Payroll.BO.User.CurrentUser.ID.Integer, DateTime.Today);
// nID++;
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "No employee posting at: " + oDrOrg["Position_No"].ToString().Trim() + " not found.Sheet name=" + dtOrganogramAuthority.TableName + ", Row no=" + nPosCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Matrix_Position_No: " + oDrOrg["Matrix_Position_No"].ToString().Trim() + " not found.Sheet name=" + dtOrganogramAuthority.TableName + ", Row no=" + nPosCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + oDrOrg["Position_No"].ToString().Trim() + " not found.Sheet name=" + dtOrganogramAuthority.TableName + ", Row no=" + nPosCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// nPosCount++;
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// }
// this.UpdateProgressStatus(EnumProcessStatus.End);
// this.UpdateprocessStatus("Saving posting data.It takes several minutes.");
// string sConnectionString = ConfigurationSettings.AppSettings["DBConnection"];
// if(tablePosting.Rows.Count>0)
// new OrganogramBasic().DeleteAllAuthority();
// using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sConnectionString))
// {
// bulkCopy.BulkCopyTimeout = 600; // in seconds
// bulkCopy.DestinationTableName = "OrganAuthority";
// bulkCopy.WriteToServer(tablePosting);
// }
// }
// }
// catch (Exception ex)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.SystemError);
// throw new ServiceException(ex.Message);
// }
//}
//public void ImportPostingForBRAC2(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataSet oDT)
//{
// try
// {
// //new OrganogramEmployee().DeleteAll();
// List<OrganogramEmployee> oPostings = OrganogramEmployee.Get();
// //List<HREmployee> oExistingHREmployees = HREmployee.Get();
// DataTable dtOrganogramEmployee = null;
// //if (fromView)
// dtOrganogramEmployee = oDT.Tables["View_OrganogramPosting"];
// //else
// // dtOrganogramEmployee = oDT.Tables["OrganogramPosting"];
// Console.WriteLine("Total record found:" + dtOrganogramEmployee.Rows.Count.ToString() + ".Uploading Organogram posting data.It takes several minutes................");
// List<OrganogramEmployee> AssignOrganograms = OrganogramEmployee.Get();
// OrganogramEmployee oOrganogramEmployee = null;
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = dtOrganogramEmployee.Rows.Count;
// PayrollPayrollGlobalFunctions.TotalEmployeeCount = dtOrganogramEmployee.Rows.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// if (dtOrganogramEmployee != null)
// {
// int nPosCount = 1;
// foreach (DataRow oDrOrg in dtOrganogramEmployee.Rows)
// {
// HREmployee oIsOld = oExistingHREmployees.Find(delegate(HREmployee oee) { return oee.EmployeeNo == oDrOrg["Employee_PIN"].ToString(); });
// //OrganogramEmployee oOldOrganogramEmployee = AssignOrganograms.Find(delegate(OrganogramEmployee oee1) { return oee1.Position.PositionNo == oDrOrg["Position_No"].ToString(); });
// if (oIsOld != null)
// {
// DateTime dTempDate;
// //if(oOldOrganogramEmployee==null)
// oOrganogramEmployee = new OrganogramEmployee();
// // else
// // oOrganogramEmployee = oOldOrganogramEmployee;
// if (DateTime.TryParse(oDrOrg["Assign_Date"].ToString(), out dTempDate))
// {
// oOrganogramEmployee.AssignDate = dTempDate;
// oOrganogramEmployee.EmployeeID = oIsOld.ID;
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Assign_Date: " + oDrOrg["Assign_Date"].ToString().Trim(), oIsOld, EnumErrorType.Organogram);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Assign_Date: " + oDrOrg["Assign_Date"].ToString().Trim() + " is invalid date.Sheet name=" + dtOrganogramEmployee.TableName + ", Row no=" + nPosCount.ToString(), oIsOld, EnumErrorType.DateTimeFormat);
// OrganogramBasic oOrg = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDrOrg["Position_No"].ToString().ToUpper().Trim(); });
// if (oOrg != null)
// {
// //UpdateprocessStatus("Performing Posting.... " + nPosCount.ToString() + "/" + dtOrganogramEmployee.Rows.Count.ToString());
// oOrganogramEmployee.NodeID = oOrg.ID;
// oOrg.DepartmentID = oIsOld.DepartmentID;
// oOrg.CompanyID = oIsOld.CompanyID;
// oOrg.DesignationID = oIsOld.DesignationID;
// oOrg.LocationID = oIsOld.LocationID;
// oOrg.GradeID = oIsOld.GradeID;
// oOrg.FunctionID = oIsOld.FunctionID;
// oOrg.Save();
// if (oDrOrg["Position_No"].ToString() == "81")
// {
// string s = "df";
// }
// OrganogramEmployee oOrgEmp = oPostings.Find(delegate(OrganogramEmployee oee) { return oee.EmployeeID == oOrganogramEmployee.EmployeeID; });
// if (oOrgEmp == null)
// {
// oOrganogramEmployee.Save();
// }
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Employee posting at: " + oDrOrg["Position_No"].ToString().Trim(), oIsOld, EnumErrorType.Organogram);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + oDrOrg["Position_No"].ToString().Trim() + " not found.Sheet name=" + dtOrganogramEmployee.TableName + ", Row no=" + nPosCount.ToString(), oIsOld, EnumErrorType.BasicData);
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee PIN: " + oDrOrg["Employee_PIN"].ToString().Trim() + " not found.Sheet name=" + dtOrganogramEmployee.TableName + ", Row no=" + nPosCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// nPosCount++;
// //this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// }
// //this.UpdateProgressStatus(EnumProcessStatus.End);
// }
// }
// catch (Exception ex)
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "System Error: " + ex.Message, new HREmployee(), EnumErrorType.SystemError);
// throw new ServiceException(ex.Message);
// }
//}
//public void SaveBasicData(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// //save Parent
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// int nRowCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// foreach (DataRow oDr in oDTable.Rows)
// {
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// Designation oDesignation = _oDesignations.Find(delegate(Designation oItem) { return oItem.Code.ToUpper().Trim() == oDr["Designation_Code"].ToString().ToUpper().Trim(); });
// if (oDesignation == null)
// {
// if (oDr["Designation_Code"].ToString() == "" || oDr["Designation_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oDesignation = new Designation();
// oDesignation.Code = oDr["Designation_Code"].ToString();
// oDesignation.Name = oDr["Designation_Name"].ToString();
// oDesignation.Save();
// _oDesignations.Add(oDesignation);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Designation Code: " + oDr["Designation_Code"].ToString().Trim() + ",Designation Name: " + oDr["Designation_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// Category oCategory = _Categories.Find(delegate(Category oItem) { return oItem.Code.ToUpper().Trim() == oDr["Employee_Type_Code"].ToString().ToUpper().Trim(); });
// if (oCategory == null)
// {
// if (oDr["Employee_Type_Code"].ToString() == "" || oDr["Employee_Type_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Category Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oCategory = new Category();
// oCategory.Code = oDr["Employee_Type_Code"].ToString();
// oCategory.Name = oDr["Employee_Type_Name"].ToString();
// oCategory.Save();
// _Categories.Add(oCategory);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Category Code: " + oDr["Employee_Type_Code"].ToString().Trim() + ",Category Name: " + oDr["Employee_Type_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// Department oDepartment = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Program_Code"].ToString().ToUpper().Trim(); });
// if (oDepartment == null)
// {
// if (oDr["Program_Code"].ToString() == "" || oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oDepartment = new Department();
// oDepartment.Code = oDr["Program_Code"].ToString();
// oDepartment.Name = oDr["Program_Name"].ToString();
// oDepartment.Tier = 1;
// oDepartment.Save();
// _oDepartments.Add(oDepartment);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Program Code: " + oDr["Program_Code"].ToString().Trim() + ",Program Name: " + oDr["Program_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// //Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Location_Code"].ToString().ToUpper().Trim(); });
// //if (oLocation == null)
// //{
// // if (oDr["Location_Code"].ToString() == "" || oDr["Location_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // else
// // {
// // oLocation = new Location();
// // oLocation.Code = oDr["Location_Code"].ToString();
// // oLocation.Name = oDr["Location_Name"].ToString();
// // oLocation.Tier = 1;
// // oLocation.Save();
// // _oLocations.Add(oLocation);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "District Code: " + oDr["District_Code"].ToString().Trim() + ",District Name: " + oDr["District_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// //GradeSegment oGradeSegment = _oGradeSegments.Find(delegate(GradeSegment oItem) { return oItem.Code.ToUpper().Trim() == oDr["Salary_Group_Code"].ToString().ToUpper().Trim(); });
// //if (oGradeSegment == null)
// //{
// // if (oDr["Salary_Group_Code"].ToString() == "" || oDr["Salary_Group_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Grade Group Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // else
// // {
// // oGradeSegment = new GradeSegment();
// // oGradeSegment.Code = oDr["Salary_Group_Code"].ToString();
// // oGradeSegment.Name = oDr["Salary_Group_Name"].ToString();
// // oGradeSegment.Save();
// // _oGradeSegments.Add(oGradeSegment);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Salary Group Code: " + oDr["Salary_Group_Code"].ToString().Trim() + ",Name: " + oDr["Salary_Group_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// nRowCount++;
// }
// //save child
// nRowCount = 1;
// foreach (DataRow oDr in oDTable.Rows)
// {
// Department oDepartment = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Project_Code"].ToString().ToUpper().Trim(); });
// if (oDepartment == null)
// {
// if (oDr["Project_Code"].ToString() == "" || oDr["Project_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// Department oDepartment2 = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Program_Code"].ToString().ToUpper().Trim(); });
// oDepartment = new Department();
// oDepartment.Code = oDr["Project_Code"].ToString();
// oDepartment.Name = oDr["Project_Name"].ToString();
// //oDepartment.Code = oDr["Program_Code"].ToString();
// //oDepartment.Name = oDr["Program_Name"].ToString();
// if (oDepartment2 != null)
// oDepartment.ParentID = oDepartment2.ID;
// oDepartment.Tier = 2;
// oDepartment.Save();
// _oDepartments.Add(oDepartment);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Project Code: " + oDr["Project_Code"].ToString().Trim() + ",Name: " + oDr["Project_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// //Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Thana_Code"].ToString().ToUpper().Trim(); });
// //if (oLocation == null)
// //{
// // if (oDr["Thana_Code"].ToString() == "" || oDr["Thana_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // else
// // {
// // Location oLocation2 = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["District_Code"].ToString().ToUpper().Trim(); });
// // oLocation = new Location();
// // oLocation.Code = oDr["Thana_Code"].ToString();
// // oLocation.Name = oDr["Thana_Name"].ToString();
// // if (oLocation2 != null)
// // oLocation.ParentID = oLocation2.ID;
// // oLocation.Tier = 2;
// // oLocation.Save();
// // _oLocations.Add(oLocation);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Thana Code: " + oDr["Thana_Code"].ToString().Trim() + ",Name: " + oDr["Thana_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// Grade oGrade = _oGrades.Find(delegate(Grade oItem) { return oItem.Code.ToUpper().Trim() == oDr["Level_Code"].ToString().ToUpper().Trim(); });
// if (oGrade == null)
// {
// if (oDr["Level_Code"].ToString() == "" || oDr["Level_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// //GradeSegment oGradeSegment = _oGradeSegments.Find(delegate(GradeSegment oItem) { return oItem.Code.ToUpper().Trim() == oDr["Salary_Group_Code"].ToString().ToUpper().Trim(); });
// oGrade = new Grade();
// oGrade.Code = oDr["Level_Code"].ToString();
// oGrade.Name = oDr["Level_Name"].ToString();
// //if (oGradeSegment != null)
// oGrade.GradeSegmentID = (1);
// oGrade.Save();
// _oGrades.Add(oGrade);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level Code: " + oDr["Level_Code"].ToString().Trim() + ",Name: " + oDr["Level_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// }
// //save tier 3 data
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Location_Code"].ToString().ToUpper().Trim(); });
// // if (oLocation == null)
// // {
// // if (oDr["Location_Code"].ToString() == "" || oDr["Location_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // else
// // {
// // Location oLocation2 = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Thana_Code"].ToString().ToUpper().Trim(); });
// // oLocation = new Location();
// // oLocation.Code = oDr["Location_Code"].ToString();
// // oLocation.Name = oDr["Location_Name"].ToString();
// // if (oLocation2 != null)
// // oLocation.ParentID = oLocation2.ID;
// // oLocation.Tier = 3;
// // oLocation.Save();
// // _oLocations.Add(oLocation);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Location Code: " + oDr["Location_Code"].ToString().Trim() + ",Name: " + oDr["Location_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // }
// //}
// this.UpdateProgressStatus(EnumProcessStatus.End);
//}
//public void SaveBasicData2(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// //save Parent
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// //this.UpdateProgressStatus(EnumProcessStatus.Start);
// int nRowCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// foreach (DataRow oDr in oDTable.Rows)
// {
// // this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// Designation oDesignation = _oDesignations.Find(delegate(Designation oItem) { return oItem.Code.ToUpper().Trim() == oDr["Designation_Code"].ToString().ToUpper().Trim(); });
// if (oDesignation == null)
// {
// if (oDr["Designation_Code"].ToString() == "" || oDr["Designation_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oDesignation = new Designation();
// oDesignation.Code = oDr["Designation_Code"].ToString();
// oDesignation.Name = oDr["Designation_Name"].ToString();
// oDesignation.Save();
// _oDesignations.Add(oDesignation);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Designation Code: " + oDr["Designation_Code"].ToString().Trim() + ",Designation Name: " + oDr["Designation_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// Category oCategory = _Categories.Find(delegate(Category oItem) { return oItem.Code.ToUpper().Trim() == oDr["Employee_Type_Code"].ToString().ToUpper().Trim(); });
// if (oCategory == null)
// {
// if (oDr["Employee_Type_Code"].ToString() == "" || oDr["Employee_Type_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Category Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oCategory = new Category();
// oCategory.Code = oDr["Employee_Type_Code"].ToString();
// oCategory.Name = oDr["Employee_Type_Name"].ToString();
// oCategory.Save();
// _Categories.Add(oCategory);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Category Code: " + oDr["Employee_Type_Code"].ToString().Trim() + ",Category Name: " + oDr["Employee_Type_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// Department oDepartment = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Program_Code"].ToString().ToUpper().Trim(); });
// if (oDepartment == null)
// {
// if (oDr["Program_Code"].ToString() == "" || oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oDepartment = new Department();
// oDepartment.Code = oDr["Program_Code"].ToString();
// oDepartment.Name = oDr["Program_Name"].ToString();
// oDepartment.Tier = 1;
// oDepartment.Save();
// _oDepartments.Add(oDepartment);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Program Code: " + oDr["Program_Code"].ToString().Trim() + ",Program Name: " + oDr["Program_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["District_Code"].ToString().ToUpper().Trim(); });
// if (oLocation == null)
// {
// if (oDr["District_Code"].ToString() == "" || oDr["District_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "District Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oLocation = new Location();
// oLocation.Code = oDr["District_Code"].ToString();
// oLocation.Name = oDr["District_Name"].ToString();
// oLocation.Tier = 1;
// oLocation.Save();
// _oLocations.Add(oLocation);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "District Code: " + oDr["District_Code"].ToString().Trim() + ",District Name: " + oDr["District_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// GradeSegment oGradeSegment = _oGradeSegments.Find(delegate(GradeSegment oItem) { return oItem.Code.ToUpper().Trim() == oDr["Salary_Group_Code"].ToString().ToUpper().Trim(); });
// if (oGradeSegment == null)
// {
// if (oDr["Salary_Group_Code"].ToString() == "" || oDr["Salary_Group_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Grade Group Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// oGradeSegment = new GradeSegment();
// oGradeSegment.Code = oDr["Salary_Group_Code"].ToString();
// oGradeSegment.Name = oDr["Salary_Group_Name"].ToString();
// oGradeSegment.Save();
// _oGradeSegments.Add(oGradeSegment);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Salary Group Code: " + oDr["Salary_Group_Code"].ToString().Trim() + ",Name: " + oDr["Salary_Group_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// nRowCount++;
// }
// //save child
// nRowCount = 1;
// foreach (DataRow oDr in oDTable.Rows)
// {
// Department oDepartment = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Project_Code"].ToString().ToUpper().Trim(); });
// if (oDepartment == null)
// {
// if (oDr["Project_Code"].ToString() == "" || oDr["Project_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// Department oDepartment2 = _oDepartments.Find(delegate(Department oItem) { return oItem.Code.ToUpper().Trim() == oDr["Program_Code"].ToString().ToUpper().Trim(); });
// oDepartment = new Department();
// oDepartment.Code = oDr["Project_Code"].ToString();
// oDepartment.Name = oDr["Project_Name"].ToString();
// //oDepartment.Code = oDr["Program_Code"].ToString();
// //oDepartment.Name = oDr["Program_Name"].ToString();
// if (oDepartment2 != null)
// oDepartment.ParentID = oDepartment2.ID;
// oDepartment.Tier = 2;
// oDepartment.Save();
// _oDepartments.Add(oDepartment);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Project Code: " + oDr["Project_Code"].ToString().Trim() + ",Name: " + oDr["Project_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// //Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Thana_Code"].ToString().ToUpper().Trim(); });
// //if (oLocation == null)
// //{
// // if (oDr["Thana_Code"].ToString() == "" || oDr["Thana_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // else
// // {
// // Location oLocation2 = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["District_Code"].ToString().ToUpper().Trim(); });
// // oLocation = new Location();
// // oLocation.Code = oDr["Thana_Code"].ToString();
// // oLocation.Name = oDr["Thana_Name"].ToString();
// // if (oLocation2 != null)
// // oLocation.ParentID = oLocation2.ID;
// // oLocation.Tier = 2;
// // oLocation.Save();
// // _oLocations.Add(oLocation);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Thana Code: " + oDr["Thana_Code"].ToString().Trim() + ",Name: " + oDr["Thana_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// Grade oGrade = _oGrades.Find(delegate(Grade oItem) { return oItem.Code.ToUpper().Trim() == oDr["Level_Code"].ToString().ToUpper().Trim(); });
// if (oGrade == null)
// {
// if (oDr["Level_Code"].ToString() == "" || oDr["Level_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// GradeSegment oGradeSegment = _oGradeSegments.Find(delegate(GradeSegment oItem) { return oItem.Code.ToUpper().Trim() == oDr["Salary_Group_Code"].ToString().ToUpper().Trim(); });
// oGrade = new Grade();
// oGrade.Code = oDr["Level_Code"].ToString();
// oGrade.Name = oDr["Level_Name"].ToString();
// if (oGradeSegment != null)
// oGrade.GradeSegmentID = oGradeSegment.ID;
// oGrade.Save();
// _oGrades.Add(oGrade);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level Code: " + oDr["Level_Code"].ToString().Trim() + ",Name: " + oDr["Level_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// }
// //save tier 3 data
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // Location oLocation = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Location_Code"].ToString().ToUpper().Trim(); });
// // if (oLocation == null)
// // {
// // if (oDr["Location_Code"].ToString() == "" || oDr["Location_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location Code and name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // else
// // {
// // Location oLocation2 = _oLocations.Find(delegate(Location oItem) { return oItem.Code.ToUpper().Trim() == oDr["Thana_Code"].ToString().ToUpper().Trim(); });
// // oLocation = new Location();
// // oLocation.Code = oDr["Location_Code"].ToString();
// // oLocation.Name = oDr["Location_Name"].ToString();
// // if (oLocation2 != null)
// // oLocation.ParentID = oLocation2.ID;
// // oLocation.Tier = 3;
// // oLocation.Save();
// // _oLocations.Add(oLocation);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Location Code: " + oDr["Location_Code"].ToString().Trim() + ",Name: " + oDr["Location_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // }
// //}
// this.UpdateProgressStatus(EnumProcessStatus.End);
//}
//public void SaveOrganogram(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// string ss = "";
// try
// {
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// PayrollPayrollGlobalFunctions.TotalEmployeeCount = oDTable.Rows.Count;
// UpdateProgressStatus(EnumProcessStatus.Start);
// OrganogramBasic oOrg = new OrganogramBasic();
// //oOrg.DeleteAll();
// _oOrganogramNodes = new List<OrganogramBasic>();
// _oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// List<OrganogramBasic> oParentOrganogramNodes = new List<OrganogramBasic>();
// //oParentOrganogramNodes = _oOrganogramNodes.FindAll(delegate(OrganogramBasic oItem) { return oItem.ParentID == null || oItem.ParentID.IsUnassigned; });
// nOrgRowCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// DataTable dtOrg = null;
// var accItems = oDTable.AsEnumerable().Where(x => x["Position_No"].ToString().Trim() == "1");
// if (accItems.Count() > 0)
// dtOrg = accItems.CopyToDataTable();
// foreach (DataRow oDr in dtOrg.Rows)
// {
// ss = oDr["Position_No"].ToString().Trim();
// UpdateprocessStatus("Creating node : " + oDr["Position_No"].ToString() + ". Record fetched " + nOrgRowCount.ToString() + "/" + dtOrg.Rows.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// if (oDr["Position_No"].ToString() == "" || oDr["Position_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Position_No and Position Name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nOrgRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// OrganogramBasic oOrganogramBasic = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDr["Position_No"].ToString().ToUpper().Trim(); });
// //if (oDr["Parent_Position_No"].ToString() == "")
// //{
// if (oOrganogramBasic == null)
// {
// oOrganogramBasic = new OrganogramBasic();
// oOrganogramBasic.PositionNo = oDr["Position_No"].ToString().Trim();
// oOrganogramBasic.PositionName = oDr["Position_Name"].ToString().Trim();
// oOrganogramBasic.DepartmentID = (1);
// oOrganogramBasic.LocationID = (1);
// oOrganogramBasic.GradeID = (1);
// oOrganogramBasic.DesignationID = (1);
// oOrganogramBasic.RevisionDate = DateTime.Today;
// oOrganogramBasic.ParentID = null;
// oOrganogramBasic.Tier = 1;
// oOrganogramBasic.FunctionID = (1);
// oOrganogramBasic.CompanyID = (1);
// oOrganogramBasic.Save();
// _oOrganogramNodes.Add(oOrganogramBasic);
// oParentOrganogramNodes.Add(oOrganogramBasic);
// //SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + oDr["Position_No"].ToString().Trim() + ",Name: " + oDr["Position_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// //nOrgRowCount++;
// }
// else
// {
// oParentOrganogramNodes.Add(oOrganogramBasic);
// }
// //}
// }
// nOrgRowCount++;
// }
// //DataView view = new DataView(oDTable);
// //DataTable dtParents = view.ToTable(true, "Parent_Position_No");
// //int nCount = 1;
// foreach (OrganogramBasic org in oParentOrganogramNodes)
// {
// CreateChildNodes(org.PositionNo, oDTable, oErrorLogDetails, oSuccessLogDetails);
// }
// //new HREmployee().RunQuery("OrganogramTemp", "Organogram");
// UpdateProgressStatus(EnumProcessStatus.End);
// }
// catch (Exception exp)
// {
// throw new Exception(exp.Message + ss);
// }
// #region Create rest of the nodes
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // if (oDr["Parent_Position_No"].ToString() != "")
// // {
// // OrganogramBasic oOrganogramBasic = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDr["Position_No"].ToString().ToUpper().Trim(); });
// // if (oOrganogramBasic == null)
// // {
// // oOrganogramBasic = new OrganogramBasic();
// // oOrganogramBasic.PositionNo = oDr["Position_No"].ToString();
// // oOrganogramBasic.PositionName = oDr["Position_Name"].ToString();
// // oOrganogramBasic.DepartmentID = (1);
// // oOrganogramBasic.LocationID = (1);
// // oOrganogramBasic.GradeID = (1);
// // oOrganogramBasic.DesignationID = (1);
// // OrganogramBasic oOrganogramBasic2 = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDr["Parent_Position_No"].ToString().ToUpper().Trim(); });
// // if (oOrganogramBasic2 != null)
// // {
// // oOrganogramBasic.ParentID = oOrganogramBasic2.ID;
// // oOrganogramBasic.Tier = oOrganogramBasic2.Tier + 1;
// // }
// // else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Parent position no:" + oDr["Parent_Position_No"].ToString().Trim() + " not found.Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// // oOrganogramBasic.RevisionDate = DateTime.Today;
// // oOrganogramBasic.Save();
// // _oOrganogramNodes.Add(oOrganogramBasic);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + oDr["Position_No"].ToString().Trim() + ",Name: " + oDr["Position_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// // nCount++;
// // }
// // }
// //}
// #endregion
//}
//public void SaveOrganogram(List<Employee> employees, List<Designation> designations)
//{
// string ss = "";
// try
// {
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = employees.Count;
// PayrollPayrollGlobalFunctions.TotalEmployeeCount = employees.Count;
// UpdateProgressStatus(EnumProcessStatus.Start);
// OrganogramBasic oOrg = new OrganogramBasic();
// //oOrg.DeleteAll();
// _oOrganogramNodes = new List<OrganogramBasic>();
// _oOrganogramNodes = OrganogramBasic.Get(EnumStatus.Regardless);
// List<OrganogramBasic> oParentOrganogramNodes = new List<OrganogramBasic>();
// //oParentOrganogramNodes = _oOrganogramNodes.FindAll(delegate(OrganogramBasic oItem) { return oItem.ParentID == null || oItem.ParentID.IsUnassigned; });
// nOrgRowCount = 1;
// if (employees == null) return;
// if (employees.Count == 0) return;
// //DataTable dtOrg = null;
// List<Employee> accItems = employees.Where(x => x.LineManagerNo == null).ToObjectsTemplate();
// //if (accItems.Count > 0)
// // dtOrg = accItems.CopyToDataTable();
// Designation designation = null;
// foreach (Employee emp in accItems)
// {
// designation = designations.FirstOrDefault(x => x.int == emp.DesignationID);
// ss = emp.EmployeeNo.ToString().Trim();
// UpdateprocessStatus("Creating node : " + emp.EmployeeNo.ToString() + ". Record fetched " + nOrgRowCount.ToString() + "/" + accItems.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// if (emp.EmployeeNo.ToString() == "" || designation == null)
// {
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, "Position_No and Position Name must have value. Sheet name=" + emp.EmployeeNo + ", Row no=" + nOrgRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// OrganogramBasic oOrganogramBasic = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == emp.EmployeeNo.ToUpper().Trim(); });
// //if (oDr["Parent_Position_No"].ToString() == "")
// //{
// if (oOrganogramBasic == null)
// {
// oOrganogramBasic = new OrganogramBasic();
// oOrganogramBasic.PositionNo = emp.EmployeeNo;
// oOrganogramBasic.PositionName = designation.Name;
// oOrganogramBasic.DepartmentID = emp.DepartmentID;
// oOrganogramBasic.LocationID = emp.LocationID;
// oOrganogramBasic.GradeID = emp.GradeID;
// oOrganogramBasic.DesignationID = emp.DesignationID;
// oOrganogramBasic.RevisionDate = DateTime.Today;
// oOrganogramBasic.ParentID = null;
// oOrganogramBasic.Tier = 1;
// oOrganogramBasic.FunctionID = (1);
// oOrganogramBasic.CompanyID = (1);
// oOrganogramBasic.Save();
// _oOrganogramNodes.Add(oOrganogramBasic);
// oParentOrganogramNodes.Add(oOrganogramBasic);
// //SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + oDr["Position_No"].ToString().Trim() + ",Name: " + oDr["Position_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.BasicData);
// //nOrgRowCount++;
// }
// else
// {
// oParentOrganogramNodes.Add(oOrganogramBasic);
// }
// //}
// }
// nOrgRowCount++;
// }
// //DataView view = new DataView(oDTable);
// //DataTable dtParents = view.ToTable(true, "Parent_Position_No");
// //int nCount = 1;
// foreach (OrganogramBasic org in oParentOrganogramNodes)
// {
// CreateChildNodes(org.PositionNo, employees, designations);
// }
// //new HREmployee().RunQuery("OrganogramTemp", "Organogram");
// UpdateProgressStatus(EnumProcessStatus.End);
// }
// catch (Exception exp)
// {
// throw new Exception(exp.Message + ss);
// }
// #region Create rest of the nodes
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // if (oDr["Parent_Position_No"].ToString() != "")
// // {
// // OrganogramBasic oOrganogramBasic = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDr["Position_No"].ToString().ToUpper().Trim(); });
// // if (oOrganogramBasic == null)
// // {
// // oOrganogramBasic = new OrganogramBasic();
// // oOrganogramBasic.PositionNo = oDr["Position_No"].ToString();
// // oOrganogramBasic.PositionName = oDr["Position_Name"].ToString();
// // oOrganogramBasic.DepartmentID = (1);
// // oOrganogramBasic.LocationID = (1);
// // oOrganogramBasic.GradeID = (1);
// // oOrganogramBasic.DesignationID = (1);
// // OrganogramBasic oOrganogramBasic2 = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDr["Parent_Position_No"].ToString().ToUpper().Trim(); });
// // if (oOrganogramBasic2 != null)
// // {
// // oOrganogramBasic.ParentID = oOrganogramBasic2.ID;
// // oOrganogramBasic.Tier = oOrganogramBasic2.Tier + 1;
// // }
// // else
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Parent position no:" + oDr["Parent_Position_No"].ToString().Trim() + " not found.Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// // oOrganogramBasic.RevisionDate = DateTime.Today;
// // oOrganogramBasic.Save();
// // _oOrganogramNodes.Add(oOrganogramBasic);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + oDr["Position_No"].ToString().Trim() + ",Name: " + oDr["Position_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// // nCount++;
// // }
// // }
// //}
// #endregion
//}
//private void CreateChildNodes(string parentPositionNo, List<Employee> emps, List<Designation> designations)
//{
// string ss = "";
// try
// {
// int nRowCount = 1;
// //DataTable dtChilds = dtOld.Clone();
// //DataTable dtChilds = null;
// Employee lm = emps.FirstOrDefault(x => x.EmployeeNo == parentPositionNo);
// List<Employee> accItems = emps.Where(x => x.LineManagerNo == parentPositionNo).ToObjectsTemplate();
// //if (accItems.Count() > 0)
// // dtChilds = accItems.CopyToDataTable();
// //dtChilds = GetChilds(parentPositionNo, dtOld);
// if (accItems.Count>0)
// {
// Designation designation = null;
// foreach (Employee emp in accItems)
// {
// emp.LineManagerID = lm.ID;
// designation = designations.FirstOrDefault(x => x.int == emp.DesignationID);
// //ss = dr["Position_No"].ToString();
// UpdateprocessStatus("Creating node : " + emp.EmployeeNo.ToString() + ". Record fetched " + nRowCount.ToString() + "/" + accItems.Count.ToString());
// UpdateProgressStatus(EnumProcessStatus.PerformStep);
// OrganogramBasic oOrganogramBasic3 = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == emp.EmployeeNo.ToUpper().Trim(); });
// if (oOrganogramBasic3 == null)
// {
// OrganogramBasic oOrganogramBasic = new OrganogramBasic();
// oOrganogramBasic.PositionNo = emp.EmployeeNo;
// oOrganogramBasic.PositionName = designation.Name;
// oOrganogramBasic.DepartmentID = emp.DepartmentID;
// oOrganogramBasic.LocationID = emp.LocationID;
// oOrganogramBasic.GradeID = emp.GradeID;
// oOrganogramBasic.DesignationID = emp.DesignationID;
// oOrganogramBasic.FunctionID = (1);
// oOrganogramBasic.CompanyID = (1);
// OrganogramBasic oOrganogramBasic2 = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == emp.LineManagerNo.ToUpper().Trim(); });
// if (oOrganogramBasic2 != null)
// {
// oOrganogramBasic.ParentID = oOrganogramBasic2.ID;
// oOrganogramBasic.Tier = oOrganogramBasic2.Tier + 1;
// }
// else
// //SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Parent position no:" + dr["Parent_Position_No"].ToString().Trim() + " not found.Sheet name=" + dtOld.TableName + " ,Row no=" + nOrgRowCount.ToString(), new HREmployee(), EnumErrorType.Exception);
// oOrganogramBasic.RevisionDate = DateTime.Today;
// oOrganogramBasic.Save();
// _oOrganogramNodes.Add(oOrganogramBasic);
// //SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + dr["Position_No"].ToString().Trim() + ",Name: " + dr["Position_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// CreateChildNodes(emp.EmployeeNo, emps, designations);
// //CreateChildNodes(dr["Position_No"].ToString().Trim(), dtOld, oErrorLogDetails, oSuccessLogDetails);
// nOrgRowCount++;
// }
// }
// }
// catch (Exception exp)
// {
// throw new Exception(exp.Message + ss);
// }
//}
//private void CreateChildNodes2(string parentPositionNo, DataTable dtOld, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable dtChilds = dtOld.Clone();
// dtChilds = GetChilds(parentPositionNo, dtOld);
// foreach (DataRow dr in dtChilds.Rows)
// {
// //UpdateprocessStatus("Creating node : " + dr["Position_No"].ToString() + ". Record fetched " + nOrgRowCount.ToString() + "/" + dtOld.Rows.Count.ToString());
// //UpdateProgressStatus(EnumProcessStatus.PerformStep);
// OrganogramBasic oOrganogramBasic = new OrganogramBasic();
// oOrganogramBasic.PositionNo = dr["Position_No"].ToString();
// oOrganogramBasic.PositionName = dr["Position_Name"].ToString();
// oOrganogramBasic.DepartmentID = (1);
// oOrganogramBasic.LocationID = (1);
// oOrganogramBasic.GradeID = (1);
// oOrganogramBasic.DesignationID = (1);
// OrganogramBasic oOrganogramBasic2 = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == dr["Parent_Position_No"].ToString().ToUpper().Trim(); });
// if (oOrganogramBasic2 != null)
// {
// oOrganogramBasic.ParentID = oOrganogramBasic2.ID;
// oOrganogramBasic.Tier = oOrganogramBasic2.Tier + 1;
// }
// else
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Parent position no:" + dr["Parent_Position_No"].ToString().Trim() + " not found.Sheet name=" + dtOld.TableName + " ,Row no=" + nOrgRowCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// oOrganogramBasic.RevisionDate = DateTime.Today;
// OrganogramBasic oOrganogramBasic3 = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oOrganogramBasic.PositionNo.ToUpper().Trim(); });
// if (oOrganogramBasic3 == null)
// {
// oOrganogramBasic.Save();
// _oOrganogramNodes.Add(oOrganogramBasic);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Position_No: " + dr["Position_No"].ToString().Trim() + ",Name: " + dr["Position_Name"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// CreateChildNodes2(oOrganogramBasic.PositionNo, dtOld, oErrorLogDetails, oSuccessLogDetails);
// nOrgRowCount++;
// }
//}
//private DataTable GetChilds(string parentPositionNo, DataTable dtOld)
//{
// DataTable dtNew = dtOld.Clone();
// foreach (DataRow dr in dtOld.Rows)
// {
// if (dr["Parent_Position_No"].ToString() == parentPositionNo)
// {
// dtNew.ImportRow(dr);
// }
// }
// return dtNew;
//}
//private bool IsRecordMatch(DataTable dtRecord, string sPositionNo)
//{
// bool bFound = false;
// foreach (DataRow dr in dtRecord.Rows)
// {
// if (dr["Parent_Position_No"].ToString() == sPositionNo)
// {
// bFound = true;
// break;
// }
// }
// return bFound;
//}
//private bool IsRecordMatch2(DataTable dtRecord, string sPositionNo)
//{
// bool bFound = false;
// foreach (DataRow dr in dtRecord.Rows)
// {
// if (dr["Parent_Position_No"].ToString() != sPositionNo)
// {
// bFound = true;
// break;
// }
// }
// return bFound;
//}
//public void SaveRepositionOrganogram(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// string ss = "";
// try
// {
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// int nCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// foreach (DataRow oDr in oDTable.Rows)
// {
// UpdateprocessStatus("Node reposition done : " + nCount.ToString() + "/" + oDTable.Rows.Count.ToString());
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// if (oDr["Position_No"].ToString().Trim() != "")
// {
// ss = oDr["Position_No"].ToString().Trim();
// OrganogramBasic oOrganogramBasic = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDr["Position_No"].ToString().ToUpper().Trim(); });
// if (oOrganogramBasic != null)
// {
// OrganogramBasic oParentOrganogramBasic = _oOrganogramNodes.Find(delegate(OrganogramBasic oItem) { return oItem.PositionNo.ToUpper().Trim() == oDr["Parent_Position_No"].ToString().ToUpper().Trim(); });
// if (oParentOrganogramBasic != null)
// {
// if (oOrganogramBasic.ParentID != oParentOrganogramBasic.ID)
// {
// _oOrganogramNodes.Remove(oOrganogramBasic);
// oOrganogramBasic.ParentID = oParentOrganogramBasic.ID;
// oOrganogramBasic.Save();
// _oOrganogramNodes.Add(oOrganogramBasic);
// //SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "New Parent no:" + oDr["Position_No"].ToString().Trim() + " assigned to Position_No: " + oDr["Position_No"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Parent position no:" + oDr["Parent_Position_No"].ToString().Trim() + " not found..Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// }
// }
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Position no:" + oDr["Position_No"].ToString().Trim() + " not found..Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// }
// nCount++;
// }
// }
// catch (Exception exp)
// {
// throw new Exception(exp.Message + ss);
// }
// this.UpdateProgressStatus(EnumProcessStatus.End);
//}
//public void SaveEducationBasicData(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// int nCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// foreach (DataRow oDr in oDTable.Rows)
// {
// if (oDr["Level_of_Education"].ToString() != "")
// {
// EducationLevel oEducationLevel = _EducationLevels.Find(delegate(EducationLevel oItem) { return oItem.Description.ToUpper().Trim() == oDr["Level_of_Education"].ToString().ToUpper().Trim(); });
// if (oEducationLevel == null)
// {
// EducationLevel oItem = new EducationLevel();
// oItem.Description = oDr["Level_of_Education"].ToString();
// oItem.Code = nCount.ToString();
// oItem.EducationTypeID = (1);
// oItem.Save();
// _EducationLevels.Add(oItem);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level_of_Education:" + oDr["Level_of_Education"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level_of_Education:" + oDr["Level_of_Education"].ToString().Trim() + " not found..Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// }
// nCount++;
// }
// nCount = 1;
// foreach (DataRow oDr in oDTable.Rows)
// {
// if (oDr["Discipline"].ToString() != "")
// {
// Discipline oDiscipline = _Disciplines.Find(delegate(Discipline oItem) { return oItem.Description.ToUpper().Trim() == oDr["Discipline"].ToString().ToUpper().Trim(); });
// if (oDiscipline == null)
// {
// EducationLevel oEducationLevel = _EducationLevels.Find(delegate(EducationLevel oItem) { return oItem.Description.ToUpper().Trim() == oDr["Level_of_Education"].ToString().ToUpper().Trim(); });
// if (oEducationLevel != null)
// {
// Discipline oItem = new Discipline();
// oItem.Description = oDr["Discipline"].ToString();
// oItem.Code = nCount.ToString();
// oItem.EducationLevelID = oEducationLevel.ID;
// oItem.Save();
// _Disciplines.Add(oItem);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Discipline:" + oDr["Discipline"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// }
// }
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Discipline:" + oDr["Discipline"].ToString().Trim() + " not found..Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// //}
// nCount++;
// }
// nCount = 1;
// foreach (DataRow oDr in oDTable.Rows)
// {
// //if (oDr["Div/Class"].ToString() != "")
// //{
// if (oDr["Div/Class"].ToString() == "")
// oDr["Div/Class"] = "Passed";
// ResultType oResultType = _ResultTypes.Find(delegate(ResultType oItem) { return oItem.Description.ToUpper().Trim() == oDr["Div/Class"].ToString().ToUpper().Trim(); });
// if (oResultType == null)
// {
// ResultType oItem = new ResultType();
// oItem.Description = oDr["Div/Class"].ToString();
// oItem.Code = "";
// oItem.Save();
// _ResultTypes.Add(oItem);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Div/Class:" + oDr["Div/Class"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// //}
// nCount++;
// }
// //nCount = 1;
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // if (oDr["Religion"].ToString() != "")
// // {
// // Religion oReligion = _Religions.Find(delegate(Religion oItem) { return oItem.Name.ToUpper().Trim() == oDr["Religion"].ToString().ToUpper().Trim(); });
// // if (oReligion == null)
// // {
// // Religion oItem = new Religion();
// // oItem.Name = oDr["Religion"].ToString();
// // oItem.Code = "";
// // oItem.Save();
// // _Religions.Add(oItem);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Religion" + oDr["Religion"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// // }
// // }
// // nCount++;
// //}
//}
//public void SaveEducationBasicData2(DataTable oDTable, List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// int nCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// foreach (DataRow oDr in oDTable.Rows)
// {
// if (oDr["Level_of_Education"].ToString() != "")
// {
// EducationLevel oEducationLevel = _EducationLevels.Find(delegate(EducationLevel oItem) { return oItem.Description.ToUpper().Trim() == oDr["Level_of_Education"].ToString().ToUpper().Trim(); });
// if (oEducationLevel == null)
// {
// EducationLevel oItem = new EducationLevel();
// oItem.Description = oDr["Level_of_Education"].ToString();
// oItem.Code = nCount.ToString();
// oItem.EducationTypeID = (1);
// oItem.Save();
// _EducationLevels.Add(oItem);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Level_of_Education:" + oDr["Level_of_Education"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// }
// else
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level_of_Education:" + oDr["Level_of_Education"].ToString().Trim() + " not found..Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// }
// nCount++;
// }
// nCount = 1;
// foreach (DataRow oDr in oDTable.Rows)
// {
// if (oDr["Discipline"].ToString() != "")
// {
// Discipline oDiscipline = _Disciplines.Find(delegate(Discipline oItem) { return oItem.Description.ToUpper().Trim() == oDr["Discipline"].ToString().ToUpper().Trim(); });
// if (oDiscipline == null)
// {
// EducationLevel oEducationLevel = _EducationLevels.Find(delegate(EducationLevel oItem) { return oItem.Description.ToUpper().Trim() == oDr["Level_of_Education"].ToString().ToUpper().Trim(); });
// if (oEducationLevel != null)
// {
// Discipline oItem = new Discipline();
// oItem.Description = oDr["Discipline"].ToString();
// oItem.Code = nCount.ToString();
// oItem.EducationLevelID = oEducationLevel.ID;
// oItem.Save();
// _Disciplines.Add(oItem);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Discipline:" + oDr["Discipline"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// }
// }
// //else
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Discipline:" + oDr["Discipline"].ToString().Trim() + " not found..Sheet name=" + oDTable.TableName + " ,Row no=" + nCount.ToString(), new HREmployee(), EnumErrorType.Organogram);
// //}
// nCount++;
// }
// nCount = 1;
// foreach (DataRow oDr in oDTable.Rows)
// {
// if (oDr["Div/Class"].ToString() != "")
// {
// ResultType oResultType = _ResultTypes.Find(delegate(ResultType oItem) { return oItem.Description.ToUpper().Trim() == oDr["Div/Class"].ToString().ToUpper().Trim(); });
// if (oResultType == null)
// {
// ResultType oItem = new ResultType();
// oItem.Description = oDr["Div/Class"].ToString();
// oItem.Code = "";
// oItem.Save();
// _ResultTypes.Add(oItem);
// SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Div/Class:" + oDr["Div/Class"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// }
// }
// nCount++;
// }
// //nCount = 1;
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // if (oDr["Religion"].ToString() != "")
// // {
// // Religion oReligion = _Religions.Find(delegate(Religion oItem) { return oItem.Name.ToUpper().Trim() == oDr["Religion"].ToString().ToUpper().Trim(); });
// // if (oReligion == null)
// // {
// // Religion oItem = new Religion();
// // oItem.Name = oDr["Religion"].ToString();
// // oItem.Code = "";
// // oItem.Save();
// // _Religions.Add(oItem);
// // SetErrorSuccessObjects(EnumReceiveStatus.Success, oErrorLogDetails, oSuccessLogDetails, "Religion" + oDr["Religion"].ToString().Trim(), new HREmployee(), EnumErrorType.Organogram);
// // }
// // }
// // nCount++;
// //}
//}
//public void SaveHREmpData(List<HREmployee> oEmployees)
//{
// string sEmpIDs = "";
// try
// {
// HREmployee oEmp = new HREmployee();
// this.UpdateprocessStatus("Saving employee basic data.Ite takes several minutes ");
// //oEmp.Save2(oEmployees);
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oEmployees.Count;
// //UpdateProgressStatus(EnumProcessStatus.Start);
// //this.UpdateprocessStatus("Saving data for employees.It takes several minutes.");
// //oEmp.Save2(oEmployees);
// //int nEmpCount = 1;
// //int nTotalEmployee = oEmployees.Count;
// //foreach (HREmployee oItem in oEmployees)
// //{
// // sEmpIDs = oItem.EmployeeNo;
// // nEmpCount++;
// // UpdateProgressStatus(EnumProcessStatus.PerformStep);
// //}
// //foreach (HREmployee oItem in oEmployees)
// //{
// // if (sEmpIDs != "")
// // sEmpIDs = sEmpIDs + ",";
// // sEmpIDs += oItem.ID.ToString();
// //}
// //oEmp.UpdateEmployeesStatus(sEmpIDs);
// UpdateProgressStatus(EnumProcessStatus.End);
// }
// catch (Exception ex)
// {
// throw new ServiceException(ex.Message + " Failed For Employee:" + sEmpIDs);
// }
//}
//public void SaveHREmpData2(List<HREmployee> oEmployees)
//{
// try
// {
// string sEmpIDs = "";
// HREmployee oEmp = new HREmployee();
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oEmployees.Count;
// //UpdateProgressStatus(EnumProcessStatus.Start);
// foreach (HREmployee oItem in oEmployees)
// {
// //this.UpdateprocessStatus("Saving data for employee : " + oItem.EmployeeNo);
// oItem.Save(null);
// User oUser = new User();
// oUser.LoginID = oItem.EmployeeNo;
// oUser.Name = oItem.Name;
// oUser.PasswordHints = oItem.EmployeeNo;
// oUser.ParentID = User.CurrentUser.ID;
// if (oUser.IsNew)
// {
// string sPass = oItem.BirthDate.Day.ToString() + oItem.BirthDate.Month.ToString() + oItem.BirthDate.Year.ToString();
// oUser.Password = Ease.CoreV35.Utility.Global.CipherFunctions.Encrypt("CeLiMiTeD.AdMIn", sPass);
// }
// oUser.SISU = false;
// oUser.UserType = EnumSystemType.Web;
// oUser.Status = EnumStatus.Active;
// oUser.Save();
// //UpdateProgressStatus(EnumProcessStatus.PerformStep);
// }
// //foreach (HREmployee oItem in oEmployees)
// //{
// // if (sEmpIDs != "")
// // sEmpIDs = sEmpIDs + ",";
// // sEmpIDs += oItem.ID.ToString();
// //}
// //oEmp.UpdateEmployeesStatus(sEmpIDs);
// //UpdateProgressStatus(EnumProcessStatus.End);
// }
// catch (Exception ex)
// {
// throw new ServiceException(ex.Message);
// }
//}
//public void CheckBasicData(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, bool fromView)
//{
// HREmployee oEmp = new HREmployee();
// DataTable oDTable = new DataTable();
// if (fromView)
// oDTable = _uploadHRData.Tables["View_General"];
// else
// oDTable = _uploadHRData.Tables["General"];
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// int nRowCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// foreach (DataRow oDr in oDTable.Rows)
// {
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// oEmp = new HREmployee();
// oEmp.EmployeeNo = oDr["Employee_PIN"].ToString();
// oEmp.FirstName = oDr["First_Name"].ToString() + " " + oDr["Middle_Name"].ToString() + " " + oDr["Last_Name"].ToString();
// oEmp.MiddleName = oDr["Middle_Name"].ToString();
// oEmp.LastName = oDr["Last_Name"].ToString();
// if (oDr["Project_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// else
// {
// if (oDr["Program_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// if (oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// }
// if (oDr["Project_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// else
// {
// if (oDr["Program_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// if (oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// }
// //if (oDr["District_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "District Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// //}
// //else
// //{
// // if (oDr["Thana_Code"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // //else
// // //{
// // // if (oDr["Location_Code"].ToString() == "")
// // // {
// // // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // // }
// // // if (oDr["Location_Name"].ToString() == "")
// // // {
// // // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // // }
// // //}
// // if (oDr["Thana_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //else
// //{
// // if (oDr["Location_Code"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // if (oDr["Location_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// //}
// //if (oDr["District_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "District name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// //}
// //else
// //{
// // if (oDr["Thana_Code"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // if (oDr["Thana_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// //if (oDr["Salary_Group_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Grade Group Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// //if (oDr["Salary_Group_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Grade Group name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// if (oDr["Designation_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// if (oDr["Designation_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// if (oDr["Employee_Type_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee Type Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// if (oDr["Employee_Type_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee Type Name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// if (oDr["Level_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// if (oDr["Level_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// }
// //if (oDr["Salary_Group_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Salary Group Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// //}
// //if (oDr["Salary_Group_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Salary Group Name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.BasicData);
// //}
// if (oDr["Date_of_Birth"].ToString() != "")
// {
// DateTime dtBirth;
// if (!DateTime.TryParse(oDr["Date_of_Birth"].ToString(), out dtBirth))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Birth date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.DateTimeFormat);
// }
// }
// if (oDr["Joining_Date"].ToString() != "")
// {
// DateTime dtJdate;
// if (!DateTime.TryParse(oDr["Joining_Date"].ToString(), out dtJdate))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Joining date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.DateTimeFormat);
// }
// }
// nRowCount++;
// }
// //nRowCount = 1;
// //oDTable = new DataTable();
// //if (fromView)
// // oDTable = _uploadHRData.Tables["View_SpouseWorkingBRAC"];
// //else
// // oDTable = _uploadHRData.Tables["SpouseWorkingBRAC"];
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // if (oDr["Date_of_Marriage"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Marriage date must have value,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // else
// // {
// // DateTime dtJdate;
// // if (!DateTime.TryParse(oDr["Date_of_Marriage"].ToString(), out dtJdate))
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Marriage date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // }
// // nRowCount++;
// //}
// //nRowCount = 1;
// //oDTable = new DataTable();
// //if (fromView)
// // oDTable = _uploadHRData.Tables["View_Training"];
// //else
// // oDTable = _uploadHRData.Tables["Training"];
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // if (oDr["From_Date"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "From date must have value,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // else
// // {
// // DateTime dtJdate;
// // if (!DateTime.TryParse(oDr["From_Date"].ToString(), out dtJdate))
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "From date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // }
// // if (oDr["To_Date"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "To date must have value,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // else
// // {
// // DateTime dtJdate;
// // if (!DateTime.TryParse(oDr["To_Date"].ToString(), out dtJdate))
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "To date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // }
// // nRowCount++;
// //}
// //nRowCount = 1;
// //oDTable = new DataTable();
// //if (fromView)
// // oDTable = _uploadHRData.Tables["View_PublicationAward"];
// //else
// // oDTable = _uploadHRData.Tables["PublicationAward"];
// //foreach (DataRow oDr in oDTable.Rows)
// //{
// // if (oDr["Employee_PIN"].ToString() != "")
// // {
// // if (oDr["Date_of_Publication"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Publication date must have value,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // else
// // {
// // DateTime dtJdate;
// // if (!DateTime.TryParse(oDr["Date_of_Publication"].ToString(), out dtJdate))
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Publication date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// // }
// // }
// // }
// // nRowCount++;
// //}
// nRowCount = 1;
// oDTable = new DataTable();
// if (fromView)
// oDTable = _uploadHRData.Tables["View_Punishment"];
// else
// oDTable = _uploadHRData.Tables["Punishment"];
// foreach (DataRow oDr in oDTable.Rows)
// {
// oEmp = new HREmployee();
// oEmp.EmployeeNo = oDr["Employee_PIN"].ToString();
// if (oDr["Punishment_Date"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Punishment date must have value,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.DateTimeFormat);
// }
// else
// {
// DateTime dtJdate;
// if (!DateTime.TryParse(oDr["Punishment_Date"].ToString(), out dtJdate))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Punishment date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), oEmp, EnumErrorType.DateTimeFormat);
// }
// }
// nRowCount++;
// }
// this.UpdateProgressStatus(EnumProcessStatus.End);
//}
//public bool CheckGeneralBasicData(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataRow oDr)
//{
// HREmployee oEmp = new HREmployee();
// bool sts = true;
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// oEmp = new HREmployee();
// oEmp.EmployeeNo = oDr["Employee_PIN"].ToString();
// oEmp.FirstName = oDr["First_Name"].ToString() + " " + oDr["Middle_Name"].ToString() + " " + oDr["Last_Name"].ToString();
// oEmp.MiddleName = oDr["Middle_Name"].ToString();
// oEmp.LastName = oDr["Last_Name"].ToString();
// if (oDr["Project_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// else
// {
// if (oDr["Program_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// if (oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// }
// if (oDr["Project_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// else
// {
// if (oDr["Program_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// if (oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// }
// //if (oDr["District_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "District Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// // sts = false;
// //}
// //if (oDr["District_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "District name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// // sts = false;
// //}
// if (oDr["Designation_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// if (oDr["Designation_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// if (oDr["Employee_Type_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee Type Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// if (oDr["Employee_Type_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee Type Name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// if (oDr["Level_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// if (oDr["Level_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// //if (oDr["Salary_Group_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Salary Group Code must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// // sts = false;
// //}
// //if (oDr["Salary_Group_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Salary Group Name must have value. View name View_General", oEmp, EnumErrorType.BasicData);
// // sts = false;
// //}
// if (oDr["Date_of_Birth"].ToString() != "")
// {
// DateTime dtBirth;
// if (!DateTime.TryParse(oDr["Date_of_Birth"].ToString(), out dtBirth))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Birth date: invalid date,View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// }
// if (oDr["Joining_Date"].ToString() != "")
// {
// DateTime dtJdate;
// if (!DateTime.TryParse(oDr["Joining_Date"].ToString(), out dtJdate))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Joining date: invalid date,View name View_General", oEmp, EnumErrorType.BasicData);
// sts = false;
// }
// }
// return sts;
//}
//public bool CheckPunishmentBasicData(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, DataRow oDr)
//{
// HREmployee oEmp = new HREmployee();
// bool sts = true;
// oEmp = new HREmployee();
// oEmp.EmployeeNo = oDr["Employee_PIN"].ToString();
// if (oDr["Punishment_Date"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Punishment date must have value,view name View_Punishment", oEmp, EnumErrorType.DateTimeFormat);
// sts = false;
// }
// else
// {
// DateTime dtJdate;
// if (!DateTime.TryParse(oDr["Punishment_Date"].ToString(), out dtJdate))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Punishment date: invalid date,view name View_Punishment", oEmp, EnumErrorType.DateTimeFormat);
// sts = false;
// }
// }
// return sts;
//}
//public void CheckBasicData2(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails)
//{
// DataTable oDTable = new DataTable();
// oDTable = _uploadHRData.Tables["View_General"];
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// int nRowCount = 1;
// if (oDTable == null) return;
// if (oDTable.Rows.Count == 0) return;
// foreach (DataRow oDr in oDTable.Rows)
// {
// this.UpdateProgressStatus(EnumProcessStatus.PerformStep);
// if (oDr["Project_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// if (oDr["Program_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// if (oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// if (oDr["Project_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Project name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// else
// {
// if (oDr["Program_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// if (oDr["Program_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Program name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// }
// //if (oDr["District_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "District Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// //else
// //{
// // if (oDr["Thana_Code"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // //else
// // //{
// // // if (oDr["Location_Code"].ToString() == "")
// // // {
// // // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // // }
// // // if (oDr["Location_Name"].ToString() == "")
// // // {
// // // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // // }
// // //}
// // if (oDr["Thana_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //else
// //{
// // if (oDr["Location_Code"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // if (oDr["Location_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Location name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// //}
// //if (oDr["District_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "District name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// //else
// //{
// // if (oDr["Thana_Code"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// // if (oDr["Thana_Name"].ToString() == "")
// // {
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Thana name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// // }
// //}
// //if (oDr["Salary_Group_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Grade Group Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// //if (oDr["Salary_Group_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Grade Group name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// if (oDr["Designation_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// if (oDr["Designation_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Designation Name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// if (oDr["Employee_Type_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee Type Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// if (oDr["Employee_Type_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Employee Type Name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// if (oDr["Level_Code"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// if (oDr["Level_Name"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Level name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// }
// //if (oDr["Salary_Group_Code"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Salary Group Code must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// //if (oDr["Salary_Group_Name"].ToString() == "")
// //{
// // SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Salary Group Name must have value. Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.BasicData);
// //}
// if (oDr["Date_of_Birth"].ToString() != "")
// {
// DateTime dtBirth;
// if (!DateTime.TryParse(oDr["Date_of_Birth"].ToString(), out dtBirth))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Birth date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// }
// }
// if (oDr["Joining_Date"].ToString() != "")
// {
// DateTime dtJdate;
// if (!DateTime.TryParse(oDr["Joining_Date"].ToString(), out dtJdate))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Joining date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// }
// }
// nRowCount++;
// }
//}
//public void CheckOrganogramData(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, bool fromView)
//{
// int nRowCount = 1;
// DataTable oDTable = new DataTable();
// if (fromView)
// oDTable = _uploadHRData.Tables["View_OrganogramPosting"];
// else
// oDTable = _uploadHRData.Tables["OrganogramPosting"];
// PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// this.UpdateProgressStatus(EnumProcessStatus.Start);
// this.UpdateprocessStatus("Checking Organogram Data");
// foreach (DataRow oDr in oDTable.Rows)
// {
// if (oDr["Assign_Date"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Assign date must have value,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// }
// else
// {
// DateTime dtJdate;
// if (!DateTime.TryParse(oDr["Assign_Date"].ToString(), out dtJdate))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Assign date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// }
// }
// nRowCount++;
// }
// this.UpdateProgressStatus(EnumProcessStatus.End);
//}
//public void CheckOrganogramData2(List<ErrorLogDetail> oErrorLogDetails, List<SuccessLogDetail> oSuccessLogDetails, bool fromView)
//{
// int nRowCount = 1;
// DataTable oDTable = new DataTable();
// //if (fromView)
// oDTable = _uploadHRData.Tables["View_OrganogramPosting"];
// //else
// // oDTable = _uploadHRData.Tables["OrganogramPosting"];
// //PayrollPayrollGlobalFunctions.SetProgressbarMaxValue = oDTable.Rows.Count;
// //this.UpdateProgressStatus(EnumProcessStatus.Start);
// //this.UpdateprocessStatus("Checking Organogram Data");
// foreach (DataRow oDr in oDTable.Rows)
// {
// if (oDr["Assign_Date"].ToString() == "")
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Assign date must have value,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// }
// else
// {
// DateTime dtJdate;
// if (!DateTime.TryParse(oDr["Assign_Date"].ToString(), out dtJdate))
// {
// SetErrorSuccessObjects(EnumReceiveStatus.Error, oErrorLogDetails, oSuccessLogDetails, "Assign date: invalid date,Sheet name=" + oDTable.TableName + ", Row no=" + nRowCount.ToString(), new HREmployee(), EnumErrorType.DateTimeFormat);
// }
// }
// nRowCount++;
// }
// //this.UpdateProgressStatus(EnumProcessStatus.End);
//}
}
}