예제 #1
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);
            ////if (IsIncludeInternalID)
            ////    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }
            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_AVCPLAN, typeof(string));
            if (IsIncludeSyncID)
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpAVCPlan.db.select(dbConn, filter);
                    foreach (EEmpAVCPlan empAVCPlan in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empAVCPlan.EmpAVCID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM] = empAVCPlan.EmpAVCEffFr;
                        row[FIELD_TO] = empAVCPlan.EmpAVCEffTo;

                        EAVCPlan avcPlan = new EAVCPlan();
                        avcPlan.AVCPlanID = empAVCPlan.AVCPlanID;
                        if (EAVCPlan.db.select(dbConn, avcPlan))
                            row[FIELD_AVCPLAN] = IsShowDescription ? avcPlan.AVCPlanDesc : avcPlan.AVCPlanCode;

                        if (IsIncludeSyncID)
                            row[FIELD_SYNC_ID] = empAVCPlan.SynID;

                        tmpDataTable.Rows.Add(row);
                    }
                }

            }
            if (IsIncludeCurrentPositionInfo)
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            return tmpDataTable;
        }
예제 #2
0
        public DataTable ExportStandardBonusTemplate(bool IsIncludeCurrentPositionInfo)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME_S);

            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_EMP_NO, typeof(string));
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }
            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_TARGET_SALARY, typeof(double));
            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_STD_RATE, typeof(double));
            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_YEAR_OF_SERVICE, typeof(double));
            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_BONUS_AMOUNT, typeof(double));

            DBFilter m_filter = new DBFilter();

            m_filter.add(new Match("BonusProcessID", m_BonusProcessID));
            m_filter.add(new Match("EmpBonusProcessType", "S"));
            m_filter.add("EmpID", true);

            EBonusProcess m_bonusProcess = EBonusProcess.GetObject(dbConn, m_BonusProcessID);

            foreach (EEmpBonusProcess m_empBonusProcess in EEmpBonusProcess.db.select(dbConn, m_filter))
            {
                EEmpPersonalInfo empInfo = EEmpPersonalInfo.GetObject(dbConn, m_empBonusProcess.EmpID);

                DataRow row = tmpDataTable.NewRow();

                row[FIELD_EMP_NO] = empInfo.EmpNo;

                if (IsIncludeCurrentPositionInfo)
                {
                    ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                    ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                }
                row[FIELD_TARGET_SALARY]   = m_empBonusProcess.EmpBonusProcessTargetSalary;
                row[FIELD_STD_RATE]        = m_bonusProcess.BonusProcessStdRate;
                row[FIELD_YEAR_OF_SERVICE] = Math.Round(m_empBonusProcess.EmpBonusProcessBonusProportion, 4);
                row[FIELD_BONUS_AMOUNT]    = Math.Round(m_empBonusProcess.EmpBonusProcessBonusAmount, 2);

                tmpDataTable.Rows.Add(row);
            }

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }

            return(tmpDataTable);
        }
예제 #3
0
        public static DataTable ExportTemplate(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(HROne.Import.ImportCommissionAchievementProcess.FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(HROne.Import.ImportCommissionAchievementProcess.FIELD_BASIC_SALARY, typeof(double));
            tmpDataTable.Columns.Add(HROne.Import.ImportCommissionAchievementProcess.FIELD_FPS, typeof(double));

            tmpDataTable.Columns.Add(HROne.Import.ImportCommissionAchievementProcess.FIELD_EFF_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(HROne.Import.ImportCommissionAchievementProcess.FIELD_PERCENT, typeof(double));

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter m_recurringPaymentFilter = new DBFilter();
                    m_recurringPaymentFilter.add(new Match("EmpID", empInfo.EmpID));
                    m_recurringPaymentFilter.add(new NullTerm("EmpRPEffTo"));
                    m_recurringPaymentFilter.add(AppUtils.GetPayemntCodeDBTermByPaymentType(dbConn, "PayCodeID", "BASICSAL"));
                    foreach (EEmpRecurringPayment m_rpInfo in EEmpRecurringPayment.db.select(dbConn, m_recurringPaymentFilter))
                    {
                        DataRow row = tmpDataTable.NewRow();
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }
                        row[FIELD_BASIC_SALARY] = m_rpInfo.EmpRPBasicSalary;
                        row[FIELD_FPS]          = m_rpInfo.EmpRPFPS;

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #4
0
        public static DataTable ExportTemplate(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_EFFECTIVE_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_PAYMENT_CODE, typeof(string));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_PAYMENT_METHOD, typeof(string));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_BANK_ACCOUNT_NO, typeof(string));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_AMOUNT, typeof(double));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_NUM_OF_DAY_ADJUST, typeof(double));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_REST_PAYMENT, typeof(string));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_COST_CENTER, typeof(string));
            tmpDataTable.Columns.Add(HROne.Import.ImportClaimsAndDeductionsProcess.FIELD_REMARK, typeof(string));


            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DataRow row = tmpDataTable.NewRow();
                    row[FIELD_EMP_NO] = empInfo.EmpNo;

                    if (IsIncludeCurrentPositionInfo)
                    {
                        ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                        ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                    }

                    tmpDataTable.Rows.Add(row);
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #5
0
        public static DataTable ExportTemplate(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(HROne.Import.ImportDoublePayAdjustmentProcess.FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(HROne.Import.ImportDoublePayAdjustmentProcess.FIELD_EFF_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(HROne.Import.ImportDoublePayAdjustmentProcess.FIELD_PERCENT, typeof(double));

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DataRow row = tmpDataTable.NewRow();
                    row[FIELD_EMP_NO] = empInfo.EmpNo;

                    if (IsIncludeCurrentPositionInfo)
                    {
                        ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                        ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                    }
                    tmpDataTable.Rows.Add(row);
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #6
0
        public static DataTable ExportTemplate(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(HROne.Import.ImportHitRateBasedPaymentProcess.FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            //tmpDataTable.Columns.Add(HROne.Import.ImportHitRateBasedPaymentProcess.FIELD_EFF_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(HROne.Import.ImportHitRateBasedPaymentProcess.FIELD_PAYMENT_CODE, typeof(string));
            tmpDataTable.Columns.Add(HROne.Import.ImportHitRateBasedPaymentProcess.FIELD_PERCENT, typeof(double));

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter m_empRPFilter = new DBFilter();
                    m_empRPFilter.add(new Match("EmpID", empInfo.EmpID));
                    m_empRPFilter.add(new NullTerm("EmpRPEffTo"));
                    m_empRPFilter.add("EmpRPEffFr", true);
                    foreach (EEmpRecurringPayment m_rpInfo in EEmpRecurringPayment.db.select(dbConn, m_empRPFilter))
                    {
                        EPaymentCode m_paymentCode = EPaymentCode.GetObject(dbConn, m_rpInfo.PayCodeID);
                        if (m_paymentCode.PaymentCodeIsHitRateBased)
                        {
                            DataRow row = tmpDataTable.NewRow();

                            row[FIELD_EMP_NO] = empInfo.EmpNo;

                            if (IsIncludeCurrentPositionInfo)
                            {
                                ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                                ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                            }

                            row[FIELD_PAYMENT_CODE] = m_paymentCode.PaymentCode;

                            int m_monthDiff = AppUtils.ServerDateTime().Year * 12 + AppUtils.ServerDateTime().Month -
                                              (empInfo.EmpServiceDate.Year * 12 + empInfo.EmpServiceDate.Month);

                            if (m_paymentCode.PaymentCodeDefaultRateAtMonth1 > 0 && m_monthDiff == 0)   // service start in current month
                            {
                                row[FIELD_PERCENT] = m_paymentCode.PaymentCodeDefaultRateAtMonth1;
                            }
                            else if (m_paymentCode.PaymentCodeDefaultRateAtMonth2 > 0 && m_monthDiff == 1) // emp service start in last month
                            {
                                row[FIELD_PERCENT] = m_paymentCode.PaymentCodeDefaultRateAtMonth2;
                            }
                            else if (m_paymentCode.PaymentCodeDefaultRateAtMonth2 > 0 && m_monthDiff == 2) // emp service start in 2 months before this month
                            {
                                row[FIELD_PERCENT] = m_paymentCode.PaymentCodeDefaultRateAtMonth3;
                            }
                            tmpDataTable.Rows.Add(row);
                        }
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #7
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_SURNAME, typeof(string));
            tmpDataTable.Columns.Add(FIELD_OTHER_NAME, typeof(string));
            tmpDataTable.Columns.Add(FIELD_CHINESE_NAME, typeof(string));
            tmpDataTable.Columns.Add(FIELD_DATE_OF_BIRTH, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_HKID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_GENDER, typeof(string));
            tmpDataTable.Columns.Add(FIELD_RELATIONSHIP, typeof(string));
            tmpDataTable.Columns.Add(FIELD_PASSPORT_NUMBER, typeof(string));
            tmpDataTable.Columns.Add(FIELD_PASSPORT_ISSUE_COUNTRY, typeof(string));
            //Start 0000190, Miranda, 2015-05-18
            tmpDataTable.Columns.Add(FIELD_MEDICAL_SCHEME_INSURED, typeof(string));
            tmpDataTable.Columns.Add(FIELD_MEDICAL_EFFECTIVE_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_EXPIRY_DATE, typeof(DateTime));
            //End 0000190, Miranda, 2015-05-18

            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpDependant.db.select(dbConn, filter);
                    foreach (EEmpDependant empDependant in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empDependant.EmpDependantID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_SURNAME]                = empDependant.EmpDependantSurname;
                        row[FIELD_OTHER_NAME]             = empDependant.EmpDependantOtherName;
                        row[FIELD_CHINESE_NAME]           = empDependant.EmpDependantChineseName;
                        row[FIELD_DATE_OF_BIRTH]          = empDependant.EmpDependantDateOfBirth;
                        row[FIELD_HKID]                   = empDependant.EmpDependantHKID;
                        row[FIELD_GENDER]                 = empDependant.EmpDependantGender;
                        row[FIELD_RELATIONSHIP]           = empDependant.EmpDependantRelationship;
                        row[FIELD_PASSPORT_NUMBER]        = empDependant.EmpDependantPassportNo;
                        row[FIELD_PASSPORT_ISSUE_COUNTRY] = empDependant.EmpDependantPassportIssuedCountry;
                        // Start 0000190, Miranda, 2015-05-18
                        row[FIELD_MEDICAL_SCHEME_INSURED] = (empDependant.EmpDependantMedicalSchemeInsured) ? "Y" : "N";
                        row[FIELD_MEDICAL_EFFECTIVE_DATE] = empDependant.EmpDependantMedicalEffectiveDate;
                        row[FIELD_EXPIRY_DATE]            = empDependant.EmpDependantExpiryDate;
                        // End 0000190, Miranda, 2014-05-18
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empDependant.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #8
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_COMPANYNAME, typeof(string));
            tmpDataTable.Columns.Add(FIELD_COMPANYADDRESS, typeof(string));
            tmpDataTable.Columns.Add(FIELD_CONTRACT_NO, typeof(string));
            tmpDataTable.Columns.Add(FIELD_GRATUITY, typeof(double));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpContractTerms.db.select(dbConn, filter);
                    foreach (EEmpContractTerms empContract in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empContract.EmpContractID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM]           = empContract.EmpContractEmployedFrom;
                        row[FIELD_TO]             = empContract.EmpContractEmployedTo;
                        row[FIELD_COMPANYNAME]    = empContract.EmpContractCompanyName;
                        row[FIELD_COMPANYADDRESS] = empContract.EmpContractCompanyAddr;
                        row[FIELD_CONTRACT_NO]    = empContract.EmpContractCompanyContactNo;
                        row[FIELD_GRATUITY]       = empContract.EmpContractGratuity;
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empContract.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #9
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_QUALIFICATION, typeof(string));
            tmpDataTable.Columns.Add(FIELD_INSTITUTION, typeof(string));
            tmpDataTable.Columns.Add(FIELD_LEARNING_METHOD, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpQualification.db.select(dbConn, filter);
                    foreach (EEmpQualification empQualification in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empQualification.EmpQualificationID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM] = empQualification.EmpQualificationFrom;
                        row[FIELD_TO]   = empQualification.EmpQualificationTo;

                        EQualification qualification = new EQualification();
                        qualification.QualificationID = empQualification.QualificationID;
                        if (EQualification.db.select(dbConn, qualification))
                        {
                            row[FIELD_QUALIFICATION] = IsShowDescription ? qualification.QualificationDesc : qualification.QualificationCode;
                        }
                        row[FIELD_INSTITUTION] = empQualification.EmpQualificationInstitution;

                        if (!string.IsNullOrEmpty(empQualification.EmpQualificationLearningMethod))
                        {
                            if (empQualification.EmpQualificationLearningMethod.Equals(EEmpQualification.LEARNING_METHOD_CODE_ONCAMPUS))
                            {
                                row[FIELD_LEARNING_METHOD] = EEmpQualification.LEARNING_METHOD_DESC_ONCAMPUS;
                            }
                            else if (empQualification.EmpQualificationLearningMethod.Equals(EEmpQualification.LEARNING_METHOD_CODE_DISTANCE_LEARNING))
                            {
                                row[FIELD_LEARNING_METHOD] = EEmpQualification.LEARNING_METHOD_DESC_DISTANCE_LEARNING;
                            }
                        }

                        row[FIELD_REMARK] = empQualification.EmpQualificationRemark;
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empQualification.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #10
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_LEAVE_CODE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_DAY_TAKEN, typeof(double));
            tmpDataTable.Columns.Add(FIELD_HOURS_CLAIM, typeof(double));
            tmpDataTable.Columns.Add(FIELD_TYPE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            tmpDataTable.Columns.Add(FIELD_NOPAYROLLPROCESS, typeof(string));
            tmpDataTable.Columns.Add(FIELD_MEDICIAL_CERTIFICATE, typeof(string));

            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = ELeaveApplication.db.select(dbConn, filter);
                    foreach (ELeaveApplication empLeaveApplication in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empLeaveApplication.LeaveAppID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM] = empLeaveApplication.LeaveAppDateFrom;
                        row[FIELD_TO]   = empLeaveApplication.LeaveAppDateTo;

                        ELeaveCode leaveCode = new ELeaveCode();
                        leaveCode.LeaveCodeID = empLeaveApplication.LeaveCodeID;
                        if (ELeaveCode.db.select(dbConn, leaveCode))
                        {
                            row[FIELD_LEAVE_CODE] = IsShowDescription ? leaveCode.LeaveCodeDesc : leaveCode.LeaveCode;
                        }

                        row[FIELD_DAY_TAKEN]   = empLeaveApplication.LeaveAppDays;
                        row[FIELD_HOURS_CLAIM] = empLeaveApplication.LeaveAppHours;

                        if (empLeaveApplication.LeaveAppUnit.Equals("H"))
                        {
                            row[FIELD_TYPE] = "Hour";
                        }
                        else if (empLeaveApplication.LeaveAppUnit.Equals("D"))
                        {
                            row[FIELD_TYPE] = "Day";
                        }
                        else if (empLeaveApplication.LeaveAppUnit.Equals("A"))
                        {
                            row[FIELD_TYPE] = "AM";
                        }
                        else if (empLeaveApplication.LeaveAppUnit.Equals("P"))
                        {
                            row[FIELD_TYPE] = "PM";
                        }

                        row[FIELD_MEDICIAL_CERTIFICATE] = empLeaveApplication.LeaveAppHasMedicalCertificate ? "Yes" : "No";
                        row[FIELD_REMARK]           = empLeaveApplication.LeaveAppRemark;
                        row[FIELD_NOPAYROLLPROCESS] = empLeaveApplication.LeaveAppNoPayProcess?"Yes":"No";

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empLeaveApplication.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #11
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_PERMIT_TYPE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_PERMIT_NO, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ISSUE_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_EXPIRY_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));

            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpPermit.db.select(dbConn, filter);
                    foreach (EEmpPermit empPermit in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empPermit.EmpPermitID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        EPermitType permitType = new EPermitType();
                        permitType.PermitTypeID = empPermit.PermitTypeID;
                        if (EPermitType.db.select(dbConn, permitType))
                        {
                            row[FIELD_PERMIT_TYPE] = IsShowDescription ? permitType.PermitTypeDesc : permitType.PermitTypeCode;
                        }
                        row[FIELD_PERMIT_NO]   = empPermit.EmpPermitNo;
                        row[FIELD_ISSUE_DATE]  = empPermit.EmpPermitIssueDate;
                        row[FIELD_EXPIRY_DATE] = empPermit.EmpPermitExpiryDate;
                        row[FIELD_REMARK]      = empPermit.EmpPermitRemark;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empPermit.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_PAYMENT_CODE, typeof(string));
            if (ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_PAYSCALE_POINT_SYSTEM) == "Y")        // for WaiJe
            {
                tmpDataTable.Columns.Add(FIELD_SCHEME_CODE, typeof(string));
                tmpDataTable.Columns.Add(FIELD_CAPACITY, typeof(string));
                tmpDataTable.Columns.Add(FIELD_POINT, typeof(decimal));
            }

            if (ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_MONTHLY_ACHIEVEMENT_COMMISSION) == "Y")       // for F&V
            {
                tmpDataTable.Columns.Add(FIELD_BASIC_SALARY, typeof(decimal));
                tmpDataTable.Columns.Add(FIELD_FPS, typeof(decimal));
            }

            tmpDataTable.Columns.Add(FIELD_AMOUNT, typeof(double));
            tmpDataTable.Columns.Add(FIELD_UNIT, typeof(string));
            tmpDataTable.Columns.Add(FIELD_METHOD, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ACCOUNT_NO, typeof(string));
            tmpDataTable.Columns.Add(FIELD_IS_NON_PAYROLL_ITEM, typeof(string));
            tmpDataTable.Columns.Add(FIELD_COST_CENTER, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpRecurringPayment.db.select(dbConn, filter);
                    foreach (EEmpRecurringPayment empRecurringPayment in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empRecurringPayment.EmpRPID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM] = empRecurringPayment.EmpRPEffFr;
                        row[FIELD_TO]   = empRecurringPayment.EmpRPEffTo;

                        EPaymentCode paymentCode = new EPaymentCode();
                        paymentCode.PaymentCodeID = empRecurringPayment.PayCodeID;
                        if (EPaymentCode.db.select(dbConn, paymentCode))
                        {
                            row[FIELD_PAYMENT_CODE] = IsShowDescription ? paymentCode.PaymentCodeDesc : paymentCode.PaymentCode;
                        }


                        if (ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_PAYSCALE_POINT_SYSTEM) == "Y")        // for WaiJe
                        {
                            row[FIELD_SCHEME_CODE] = empRecurringPayment.SchemeCode;
                            row[FIELD_CAPACITY]    = empRecurringPayment.Capacity;
                            row[FIELD_POINT]       = empRecurringPayment.Point;
                        }

                        if (ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_MONTHLY_ACHIEVEMENT_COMMISSION) == "Y")       // for F&V
                        {
                            row[FIELD_BASIC_SALARY] = empRecurringPayment.EmpRPBasicSalary;
                            row[FIELD_FPS]          = empRecurringPayment.EmpRPFPS;
                        }

                        row[FIELD_AMOUNT] = empRecurringPayment.EmpRPAmount;
                        if (empRecurringPayment.EmpRPUnit.Equals("H"))
                        {
                            row[FIELD_UNIT] = "Hourly";
                        }
                        else if (empRecurringPayment.EmpRPUnit.Equals("D"))
                        {
                            row[FIELD_UNIT] = "Daily";
                        }
                        else if (empRecurringPayment.EmpRPUnit.Equals("P"))
                        {
                            row[FIELD_UNIT] = "Once per payroll cycle";
                        }

                        if (empRecurringPayment.EmpRPMethod.Equals("A"))
                        {
                            row[FIELD_METHOD] = "Autopay";
                            EEmpBankAccount empBankAccount = new EEmpBankAccount();
                            empBankAccount.EmpBankAccountID = empRecurringPayment.EmpAccID;
                            if (EEmpBankAccount.db.select(dbConn, empBankAccount))
                            {
                                row[FIELD_ACCOUNT_NO] = empBankAccount.EmpBankCode + "-" + empBankAccount.EmpBranchCode + "-" + empBankAccount.EmpAccountNo;
                            }
                        }
                        else if (empRecurringPayment.EmpRPMethod.Equals("Q"))
                        {
                            row[FIELD_METHOD] = "Cheque";
                        }
                        else if (empRecurringPayment.EmpRPMethod.Equals("C"))
                        {
                            row[FIELD_METHOD] = "Cash";
                        }
                        else
                        {
                            row[FIELD_METHOD] = "Others";
                        }



                        row[FIELD_IS_NON_PAYROLL_ITEM] = empRecurringPayment.EmpRPIsNonPayrollItem ? "Yes" : "No";


                        ECostCenter costCenter = new ECostCenter();
                        costCenter.CostCenterID = empRecurringPayment.CostCenterID;
                        if (ECostCenter.db.select(dbConn, costCenter))
                        {
                            row[FIELD_COST_CENTER] = IsShowDescription ? costCenter.CostCenterDesc : costCenter.CostCenterCode;
                        }

                        row[FIELD_REMARK] = empRecurringPayment.EmpRPRemark;
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empRecurringPayment.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #13
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_SKILL);
            tmpDataTable.Columns.Add(FIELD_SKILL_LEVEL);
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpSkill.db.select(dbConn, filter);
                    foreach (EEmpSkill empSkill in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empSkill.EmpSkillID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        ESkill skill = new ESkill();
                        skill.SkillID = empSkill.SkillID;
                        if (ESkill.db.select(dbConn, skill))
                        {
                            row[FIELD_SKILL] = IsShowDescription ? skill.SkillDesc : skill.SkillCode;
                        }

                        ESkillLevel skillLevel = new ESkillLevel();
                        skillLevel.SkillLevelID = empSkill.SkillLevelID;
                        if (ESkillLevel.db.select(dbConn, skillLevel))
                        {
                            row[FIELD_SKILL_LEVEL] = IsShowDescription ? skillLevel.SkillLevelDesc : skillLevel.SkillLevelCode;
                        }
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empSkill.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }
            tmpDataTable.Columns.Add(FIELD_DATE_ADJUST, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_LEAVE_TYPE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ADJUST_TYPE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ADJUST_VALUE, typeof(double));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));

            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = ELeaveBalanceAdjustment.db.select(dbConn, filter);
                    foreach (ELeaveBalanceAdjustment leaveBalanceAdjustment in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_DATE_ADJUST] = leaveBalanceAdjustment.LeaveBalAdjDate;

                        ELeaveType leaveType = new ELeaveType();
                        leaveType.LeaveTypeID = leaveBalanceAdjustment.LeaveTypeID;
                        if (ELeaveType.db.select(dbConn, leaveType))
                        {
                            row[FIELD_LEAVE_TYPE] = IsShowDescription ? leaveType.LeaveTypeDesc : leaveType.LeaveType;
                        }

                        if (leaveBalanceAdjustment.LeaveBalAdjType.Equals(ELeaveBalanceAdjustment.ADJUST_TYPE_ADJUSTMENT))
                        {
                            row[FIELD_ADJUST_TYPE] = ELeaveBalanceAdjustment.ADJUST_TYPE_ADJUSTMENT_NAME;
                        }
                        else if (leaveBalanceAdjustment.LeaveBalAdjType.Equals(ELeaveBalanceAdjustment.ADJUST_TYPE_RESET_BALANCE))
                        {
                            row[FIELD_ADJUST_TYPE] = ELeaveBalanceAdjustment.ADJUST_TYPE_RESET_BALANCE_NAME;
                        }

                        row[FIELD_ADJUST_VALUE] = leaveBalanceAdjustment.LeaveBalAdjValue;

                        row[FIELD_REMARK] = leaveBalanceAdjustment.LeaveBalAdjRemark;


                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = leaveBalanceAdjustment.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }
            tmpDataTable.Columns.Add(FIELD_EFFECTIVE_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_CLAIM_PERIOD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_CLAIM_PERIOD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_CLAIM_TIME_FROM, typeof(string));
            tmpDataTable.Columns.Add(FIELD_CLAIM_TIME_TO, typeof(string));
            tmpDataTable.Columns.Add(FIELD_HOUR_CLAIM, typeof(double));
            tmpDataTable.Columns.Add(FIELD_EXPIRY_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_APPROVED_BY, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));

            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = ECompensationLeaveEntitle.db.select(dbConn, filter);
                    foreach (ECompensationLeaveEntitle compLeaveEntitle in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_EFFECTIVE_DATE]    = compLeaveEntitle.CompensationLeaveEntitleEffectiveDate;
                        row[FIELD_CLAIM_PERIOD_FROM] = compLeaveEntitle.CompensationLeaveEntitleClaimPeriodFrom;
                        row[FIELD_CLAIM_PERIOD_TO]   = compLeaveEntitle.CompensationLeaveEntitleClaimPeriodTo;
                        if (!compLeaveEntitle.CompensationLeaveEntitleClaimHourFrom.Ticks.Equals(0))
                        {
                            row[FIELD_CLAIM_TIME_FROM] = compLeaveEntitle.CompensationLeaveEntitleClaimHourFrom.ToString("HH:mm");
                        }
                        if (!compLeaveEntitle.CompensationLeaveEntitleClaimHourTo.Ticks.Equals(0))
                        {
                            row[FIELD_CLAIM_TIME_TO] = compLeaveEntitle.CompensationLeaveEntitleClaimHourTo.ToString("HH:mm");
                        }
                        row[FIELD_HOUR_CLAIM]  = compLeaveEntitle.CompensationLeaveEntitleHoursClaim;
                        row[FIELD_EXPIRY_DATE] = compLeaveEntitle.CompensationLeaveEntitleDateExpiry;
                        row[FIELD_APPROVED_BY] = compLeaveEntitle.CompensationLeaveEntitleApprovedBy;
                        row[FIELD_REMARK]      = compLeaveEntitle.CompensationLeaveEntitleRemark;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = compLeaveEntitle.SynID;
                        }


                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #16
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_CESSATION_REASON, typeof(string));
            tmpDataTable.Columns.Add(FIELD_RESIGN_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_NOTICE_PERIOD, typeof(double));
            tmpDataTable.Columns.Add(FIELD_NOTICE_PERIOD_UNIT, typeof(string));
            tmpDataTable.Columns.Add(FIELD_LAST_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_NEW_EMP_NO, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpTermination.db.select(dbConn, filter);
                    foreach (EEmpTermination empTermination in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empTermination.EmpTermID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        ECessationReason cessationReason = new ECessationReason();
                        cessationReason.CessationReasonID = empTermination.CessationReasonID;
                        if (ECessationReason.db.select(dbConn, cessationReason))
                        {
                            row[FIELD_CESSATION_REASON] = IsShowDescription ? cessationReason.CessationReasonDesc : cessationReason.CessationReasonCode;
                        }

                        row[FIELD_RESIGN_DATE]   = empTermination.EmpTermResignDate;
                        row[FIELD_NOTICE_PERIOD] = empTermination.EmpTermNoticePeriod;

                        if (empTermination.EmpTermNoticeUnit.Equals("D"))
                        {
                            row[FIELD_NOTICE_PERIOD_UNIT] = "Day";
                        }
                        else if (empTermination.EmpTermNoticeUnit.Equals("M"))
                        {
                            row[FIELD_NOTICE_PERIOD_UNIT] = "Month";
                        }

                        row[FIELD_LAST_DATE] = empTermination.EmpTermLastDate;
                        row[FIELD_REMARK]    = empTermination.EmpTermRemark;

                        row[FIELD_NEW_EMP_NO] = string.Empty;
                        if (empTermination.NewEmpID > 0)
                        {
                            EEmpPersonalInfo newEmp = new EEmpPersonalInfo();
                            newEmp.EmpID = empTermination.NewEmpID;
                            if (EEmpPersonalInfo.db.select(dbConn, newEmp))
                            {
                                row[FIELD_NEW_EMP_NO] = newEmp.EmpNo;
                            }
                        }
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empTermination.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_ACCIDENT_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_ACCIDENT_LOCATION, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ACCIDENT_REASON, typeof(string));
            tmpDataTable.Columns.Add(FIELD_INJURY_NATURE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REPORT_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_CHEQUE_RECEIVED_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_SETTLE_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpWorkInjuryRecord.db.select(dbConn, filter);
                    foreach (EEmpWorkInjuryRecord empWorkInjury in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empWorkInjury.EmpWorkInjuryRecordID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_ACCIDENT_DATE]        = empWorkInjury.EmpWorkInjuryRecordAccidentDate;
                        row[FIELD_ACCIDENT_LOCATION]    = empWorkInjury.EmpWorkInjuryRecordAccidentLocation;
                        row[FIELD_ACCIDENT_REASON]      = empWorkInjury.EmpWorkInjuryRecordAccidentReason;
                        row[FIELD_INJURY_NATURE]        = empWorkInjury.EmpWorkInjuryRecordInjuryNature;
                        row[FIELD_REPORT_DATE]          = empWorkInjury.EmpWorkInjuryRecordReportedDate;
                        row[FIELD_CHEQUE_RECEIVED_DATE] = empWorkInjury.EmpWorkInjuryRecordReportedDate;
                        row[FIELD_SETTLE_DATE]          = empWorkInjury.EmpWorkInjuryRecordSettleDate;
                        row[FIELD_REMARK] = empWorkInjury.EmpWorkInjuryRecordRemark;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empWorkInjury.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #18
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_NAME, typeof(string));
            tmpDataTable.Columns.Add(FIELD_GENDER, typeof(string));
            tmpDataTable.Columns.Add(FIELD_RELATIONSHIP, typeof(string));
            tmpDataTable.Columns.Add(FIELD_CONTACT_NO_DAY, typeof(string));
            tmpDataTable.Columns.Add(FIELD_CONTACT_NO_NIGHT, typeof(string));

            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpEmergencyContact.db.select(dbConn, filter);
                    foreach (EEmpEmergencyContact empEmergencyContact in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empEmergencyContact.EmpEmergencyContactID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_NAME]             = empEmergencyContact.EmpEmergencyContactName;
                        row[FIELD_GENDER]           = empEmergencyContact.EmpEmergencyContactGender;
                        row[FIELD_RELATIONSHIP]     = empEmergencyContact.EmpEmergencyContactRelationship;
                        row[FIELD_CONTACT_NO_DAY]   = empEmergencyContact.EmpEmergencyContactContactNoDay;
                        row[FIELD_CONTACT_NO_NIGHT] = empEmergencyContact.EmpEmergencyContactContactNoNight;
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empEmergencyContact.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_ROSTERTABLEGROUP, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ROSTERTABLEGROUP_IS_SUPERVISOR, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpRosterTableGroup.db.select(dbConn, filter);
                    foreach (EEmpRosterTableGroup EmpRosterTableGroup in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(EmpRosterTableGroup.EmpRosterTableGroupID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM] = EmpRosterTableGroup.EmpRosterTableGroupEffFr;
                        row[FIELD_TO]   = EmpRosterTableGroup.EmpRosterTableGroupEffTo;

                        ERosterTableGroup rosterTableGroup = new ERosterTableGroup();
                        rosterTableGroup.RosterTableGroupID = EmpRosterTableGroup.RosterTableGroupID;
                        if (ERosterTableGroup.db.select(dbConn, rosterTableGroup))
                        {
                            row[FIELD_ROSTERTABLEGROUP] = IsShowDescription ? rosterTableGroup.RosterTableGroupDesc : rosterTableGroup.RosterTableGroupCode;
                        }

                        row[FIELD_ROSTERTABLEGROUP_IS_SUPERVISOR] = EmpRosterTableGroup.EmpRosterTableGroupIsSupervisor ? "Yes" : "No";
                        //row[FIELD_IS_ROSTER_TABLE_GROUP_SUPERVISOR] = empPositionInfo.EmpPosIsRosterTableGroupSupervisor ? "Yes" : "No";
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = EmpRosterTableGroup.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #20
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_PAYMENT_CODE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_AMOUNT, typeof(double));
            tmpDataTable.Columns.Add(FIELD_METHOD, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ACCOUNT_NO, typeof(string));
            tmpDataTable.Columns.Add(FIELD_COST_CENTER, typeof(string));
            tmpDataTable.Columns.Add(FIELD_NUM_OF_DAY_ADJUST, typeof(double));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpFinalPayment.db.select(dbConn, filter);
                    foreach (EEmpFinalPayment empFinalPayment in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empFinalPayment.EmpFinalPayID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        EPaymentCode paymentCode = new EPaymentCode();
                        paymentCode.PaymentCodeID = empFinalPayment.PayCodeID;
                        if (EPaymentCode.db.select(dbConn, paymentCode))
                        {
                            row[FIELD_PAYMENT_CODE] = IsShowDescription ? paymentCode.PaymentCodeDesc : paymentCode.PaymentCode;
                        }

                        row[FIELD_AMOUNT] = empFinalPayment.EmpFinalPayAmount;

                        if (empFinalPayment.EmpFinalPayMethod.Equals("A"))
                        {
                            row[FIELD_METHOD] = "Autopay";
                            EEmpBankAccount empBankAccount = new EEmpBankAccount();
                            empBankAccount.EmpBankAccountID = empFinalPayment.EmpAccID;
                            if (EEmpBankAccount.db.select(dbConn, empBankAccount))
                            {
                                row[FIELD_ACCOUNT_NO] = empBankAccount.EmpBankCode + "-" + empBankAccount.EmpBranchCode + "-" + empBankAccount.EmpAccountNo;
                            }
                        }
                        else if (empFinalPayment.EmpFinalPayMethod.Equals("Q"))
                        {
                            row[FIELD_METHOD] = "Cheque";
                        }
                        else if (empFinalPayment.EmpFinalPayMethod.Equals("C"))
                        {
                            row[FIELD_METHOD] = "Cash";
                        }
                        else
                        {
                            row[FIELD_METHOD] = "Others";
                        }

                        ECostCenter costCenter = new ECostCenter();
                        costCenter.CostCenterID = empFinalPayment.CostCenterID;
                        if (ECostCenter.db.select(dbConn, costCenter))
                        {
                            row[FIELD_COST_CENTER] = IsShowDescription ? costCenter.CostCenterDesc : costCenter.CostCenterCode;
                        }

                        row[FIELD_NUM_OF_DAY_ADJUST] = empFinalPayment.EmpFinalPayNumOfDayAdj;
                        row[FIELD_REMARK]            = empFinalPayment.EmpFinalPayRemark;
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empFinalPayment.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #21
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_NATURE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_LANDLORD, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ADDRESS, typeof(string));
            tmpDataTable.Columns.Add(FIELD_LANDLORD_ADDRESS, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ER_RENT_PAID, typeof(double));
            tmpDataTable.Columns.Add(FIELD_EE_RENT_PAID, typeof(double));
            tmpDataTable.Columns.Add(FIELD_EE_RENT_REFUND, typeof(double));
            tmpDataTable.Columns.Add(FIELD_EE_RENT_PAID_TO_ER, typeof(double));

            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpPlaceOfResidence.db.select(dbConn, filter);
                    foreach (EEmpPlaceOfResidence empPlaceOfResidence in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empPlaceOfResidence.EmpPoRID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM]               = empPlaceOfResidence.EmpPoRFrom;
                        row[FIELD_TO]                 = empPlaceOfResidence.EmpPoRTo;
                        row[FIELD_NATURE]             = empPlaceOfResidence.EmpPoRNature;
                        row[FIELD_LANDLORD]           = empPlaceOfResidence.EmpPoRLandLord;
                        row[FIELD_ADDRESS]            = empPlaceOfResidence.EmpPoRPropertyAddr;
                        row[FIELD_LANDLORD_ADDRESS]   = empPlaceOfResidence.EmpPoRLandLordAddr;
                        row[FIELD_ER_RENT_PAID]       = empPlaceOfResidence.EmpPoRPayToLandER;
                        row[FIELD_EE_RENT_PAID]       = empPlaceOfResidence.EmpPoRPayToLandEE;
                        row[FIELD_EE_RENT_REFUND]     = empPlaceOfResidence.EmpPoRRefundToEE;
                        row[FIELD_EE_RENT_PAID_TO_ER] = empPlaceOfResidence.EmpPoRPayToERByEE;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empPlaceOfResidence.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #22
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_EFFECTIVE_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_EXPIRY_DATE, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_BENEFIT_PLAN, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ER_PREMIUM, typeof(decimal));
            tmpDataTable.Columns.Add(FIELD_EE_PREMIUM, typeof(decimal));
            tmpDataTable.Columns.Add(FIELD_CHILD_PREMIUM, typeof(decimal));
            tmpDataTable.Columns.Add(FIELD_SPOUSE_PREMIUM, typeof(decimal));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpBenefit.db.select(dbConn, filter);
                    foreach (EEmpBenefit empBenefit in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_EFFECTIVE_DATE] = empBenefit.EmpBenefitEffectiveDate;
                        row[FIELD_EXPIRY_DATE]    = empBenefit.EmpBenefitExpiryDate;

                        EBenefitPlan benefitPlan = new EBenefitPlan();
                        if (benefitPlan.LoadDBObject(dbConn, empBenefit.EmpBenefitPlanID))
                        {
                            row[FIELD_BENEFIT_PLAN] = IsShowDescription ? benefitPlan.BenefitPlanDesc : benefitPlan.BenefitPlanCode;
                        }

                        row[FIELD_ER_PREMIUM]     = empBenefit.EmpBenefitERPremium;
                        row[FIELD_EE_PREMIUM]     = empBenefit.EmpBenefitEEPremium;
                        row[FIELD_CHILD_PREMIUM]  = empBenefit.EmpBenefitChildPremium;
                        row[FIELD_SPOUSE_PREMIUM] = empBenefit.EmpBenefitSpousePremium;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empBenefit.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #23
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_BANK_CODE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_BRANCH_CODE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ACC_NO, typeof(string));
            tmpDataTable.Columns.Add(FIELD_HOLDER_NAME, typeof(string));
            tmpDataTable.Columns.Add(FIELD_DEFAULTACCOUNT, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpBankAccount.db.select(dbConn, filter);
                    foreach (EEmpBankAccount empBankAccount in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empBankAccount.EmpBankAccountID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_BANK_CODE]      = empBankAccount.EmpBankCode;
                        row[FIELD_BRANCH_CODE]    = empBankAccount.EmpBranchCode;
                        row[FIELD_ACC_NO]         = empBankAccount.EmpAccountNo;
                        row[FIELD_HOLDER_NAME]    = empBankAccount.EmpBankAccountHolderName;
                        row[FIELD_DEFAULTACCOUNT] = empBankAccount.EmpAccDefault ? "Yes" : "No";
                        row[FIELD_REMARK]         = empBankAccount.EmpBankAccountRemark;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empBankAccount.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #24
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_NAME, typeof(string));
            tmpDataTable.Columns.Add(FIELD_SHARE, typeof(decimal));
            tmpDataTable.Columns.Add(FIELD_HKID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_RELATION, typeof(string));
            tmpDataTable.Columns.Add(FIELD_ADDRESS, typeof(string));
            tmpDataTable.Columns.Add(FIELD_DISTRICT, typeof(string));
            tmpDataTable.Columns.Add(FIELD_AREA, typeof(string));
            tmpDataTable.Columns.Add(FIELD_COUNTRY, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpBeneficiaries.db.select(dbConn, filter);
                    foreach (EEmpBeneficiaries empBeneficiaries in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_NAME]     = empBeneficiaries.EmpBeneficiariesName;
                        row[FIELD_SHARE]    = empBeneficiaries.EmpBeneficiariesShare;
                        row[FIELD_HKID]     = empBeneficiaries.EmpBeneficiariesHKID;
                        row[FIELD_RELATION] = empBeneficiaries.EmpBeneficiariesRelation;
                        row[FIELD_ADDRESS]  = empBeneficiaries.EmpBeneficiariesAddress;
                        row[FIELD_DISTRICT] = empBeneficiaries.EmpBeneficiariesDistrict;
                        row[FIELD_AREA]     = empBeneficiaries.EmpBeneficiariesArea;
                        row[FIELD_COUNTRY]  = empBeneficiaries.EmpBeneficiariesCountry;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empBeneficiaries.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #25
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM_YEAR, typeof(int));
            tmpDataTable.Columns.Add(FIELD_FROM_MONTH, typeof(int));
            tmpDataTable.Columns.Add(FIELD_TO_YEAR, typeof(int));
            tmpDataTable.Columns.Add(FIELD_TO_MONTH, typeof(int));
            tmpDataTable.Columns.Add(FIELD_COMPANY, typeof(string));
            tmpDataTable.Columns.Add(FIELD_POSITION, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMPLOYMENT_TYPE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_IS_RELEVANT_EXPERIENCE, typeof(string));
            tmpDataTable.Columns.Add(FIELD_REMARK, typeof(string));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }

            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpWorkExp.db.select(dbConn, filter);
                    foreach (EEmpWorkExp empWorkExp in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empWorkExp.EmpWorkExpID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        if (empWorkExp.EmpWorkExpFromYear != 0)
                        {
                            row[FIELD_FROM_YEAR] = empWorkExp.EmpWorkExpFromYear;
                        }
                        if (empWorkExp.EmpWorkExpFromMonth != 0)
                        {
                            row[FIELD_FROM_MONTH] = empWorkExp.EmpWorkExpFromMonth;
                        }
                        if (empWorkExp.EmpWorkExpToYear != 0)
                        {
                            row[FIELD_TO_YEAR] = empWorkExp.EmpWorkExpToYear;
                        }
                        if (empWorkExp.EmpWorkExpToMonth != 0)
                        {
                            row[FIELD_TO_MONTH] = empWorkExp.EmpWorkExpToMonth;
                        }

                        row[FIELD_COMPANY]  = empWorkExp.EmpWorkExpCompanyName;
                        row[FIELD_POSITION] = empWorkExp.EmpWorkExpPosition;

                        EEmploymentType employmentType = new EEmploymentType();
                        if (employmentType.LoadDBObject(dbConn, empWorkExp.EmpWorkExpEmploymentTypeID))
                        {
                            row[FIELD_EMPLOYMENT_TYPE] = IsShowDescription ? employmentType.EmploymentTypeDesc : employmentType.EmploymentTypeCode;
                        }
                        row[FIELD_IS_RELEVANT_EXPERIENCE] = empWorkExp.EmpWorkExpIsRelevantExperience ? "Yes" : "No";
                        row[FIELD_REMARK] = empWorkExp.EmpWorkExpRemark;

                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empWorkExp.SynID;
                        }

                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #26
0
        public static DataTable Export(DatabaseConnection dbConn, ArrayList empList, bool IsIncludeCurrentPositionInfo, bool IsShowDescription, bool IsIncludeSyncID, DateTime ReferenceDateTime)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME);

            //if (IsIncludeInternalID)
            //    tmpDataTable.Columns.Add(FIELD_INTERNAL_ID, typeof(string));
            tmpDataTable.Columns.Add(FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(FIELD_FROM, typeof(DateTime));
            tmpDataTable.Columns.Add(FIELD_TO, typeof(DateTime));
            if (IsIncludeSyncID)
            {
                tmpDataTable.Columns.Add(FIELD_SYNC_ID, typeof(string));
            }
            tmpDataTable.Columns.Add(FIELD_COST_CENTER + "1", typeof(string));
            tmpDataTable.Columns.Add(FIELD_PERCENTAGE + "1", typeof(double));
            tmpDataTable.Columns.Add(FIELD_COST_CENTER + "2", typeof(string));
            tmpDataTable.Columns.Add(FIELD_PERCENTAGE + "2", typeof(double));


            foreach (EEmpPersonalInfo empInfo in empList)
            {
                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                {
                    DBFilter filter = new DBFilter();
                    filter.add(new Match("EmpID", empInfo.EmpID));
                    filter.add(getCreateModifiedRecordsAfterDBTerm(ReferenceDateTime));
                    ArrayList list = EEmpCostCenter.db.select(dbConn, filter);
                    foreach (EEmpCostCenter empCostCenter in list)
                    {
                        DataRow row = tmpDataTable.NewRow();
                        //if (IsIncludeInternalID)
                        //    row[FIELD_INTERNAL_ID] = ToHexDecWithCheckDigit(empCostCenter.EmpCostCenterID);
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        row[FIELD_FROM] = empCostCenter.EmpCostCenterEffFr;
                        row[FIELD_TO]   = empCostCenter.EmpCostCenterEffTo;

                        DBFilter costCenterDetailFilter = new DBFilter();
                        costCenterDetailFilter.add(new Match("EmpCostCenterID", empCostCenter.EmpCostCenterID));
                        ArrayList costCenterDetailList = EEmpCostCenterDetail.db.select(dbConn, costCenterDetailFilter);
                        for (int i = 1; i <= costCenterDetailList.Count; i++)
                        {
                            EEmpCostCenterDetail empCostCenterDetail = (EEmpCostCenterDetail)costCenterDetailList[i - 1];
                            if (!tmpDataTable.Columns.Contains(FIELD_COST_CENTER + i))
                            {
                                tmpDataTable.Columns.Add(FIELD_COST_CENTER + i, typeof(string));
                            }

                            if (!tmpDataTable.Columns.Contains(FIELD_PERCENTAGE + i))
                            {
                                tmpDataTable.Columns.Add(FIELD_PERCENTAGE + i, typeof(double));
                            }

                            ECostCenter costCenter = new ECostCenter();
                            costCenter.CostCenterID = empCostCenterDetail.CostCenterID;
                            if (ECostCenter.db.select(dbConn, costCenter))
                            {
                                row[FIELD_COST_CENTER + i] = IsShowDescription ? costCenter.CostCenterDesc : costCenter.CostCenterCode;
                                row[FIELD_PERCENTAGE + i]  = empCostCenterDetail.EmpCostCenterPercentage;
                            }
                        }
                        if (IsIncludeSyncID)
                        {
                            row[FIELD_SYNC_ID] = empCostCenter.SynID;
                        }
                        tmpDataTable.Rows.Add(row);
                    }
                }
            }
            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }
            return(tmpDataTable);
        }
예제 #27
0
        public DataTable ExportDiscretionaryBonusTemplate(ArrayList pEmpList, bool IsIncludeCurrentPositionInfo)
        {
            DataTable tmpDataTable = new DataTable(TABLE_NAME_D);

            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_EMP_NO, typeof(string));

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPersonalInfoProcess.AddEmployeeInfoHeader(tmpDataTable);
                ImportEmpPositionInfoProcess.AddEmployeePositionInfoHeader(dbConn, tmpDataTable);
            }

            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_TARGET_SALARY, typeof(double));
            tmpDataTable.Columns.Add(HROne.Import.ImportBonusProcess.FIELD_RANK, typeof(string));

            EBonusProcess m_bonusProcess = EBonusProcess.GetObject(dbConn, m_BonusProcessID);

            if (m_bonusProcess != null)
            {
                foreach (EEmpPersonalInfo empInfo in pEmpList)
                {
                    if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                    {
                        DataRow row = tmpDataTable.NewRow();
                        row[FIELD_EMP_NO] = empInfo.EmpNo;

                        if (IsIncludeCurrentPositionInfo)
                        {
                            ImportEmpPersonalInfoProcess.AddEmployeeInfo(dbConn, row, empInfo.EmpID);
                            ImportEmpPositionInfoProcess.AddEmployeePositionInfo(dbConn, row, empInfo.EmpID);
                        }

                        // check if record already exists in EmpBonusProcess table
                        //DBFilter m_empBonusProcessFilter = new DBFilter();
                        //m_empBonusProcessFilter.add(new Match("EmpID", empInfo.EmpID));
                        //m_empBonusProcessFilter.add(new Match("BonusProecssID", m_bonusProcess.BonusProcessID ));
                        //m_empBonusProcessFilter.add(new Match("EmpID", empInfo.EmpID));
                        //m_empBonusProcessFilter.add(new Match("EmpBonusProcessType", "D"));

                        //ArrayList m_empBonusProcessList = EEmpBonusProcess.db.select(dbConn, m_empBonusProcessFilter);

                        //if (m_empBonusProcessList.Count > 0)
                        //{
                        //    EEmpBonusProcess m_empBonusProcess = (EEmpBonusProcess) m_empBonusProcessList[0];
                        //    row[FIELD_STD_RATE] = m_bonusProcess.BonusProcessStdRate;
                        //    row[FIELD_TARGET_SALARY] = m_empBonusProcess.EmpBonusProcessTargetSalary;
                        //    row[RANK] = m_empBonusProcess.EmpBonusProcessRank;
                        //}
                        //else
                        //{
                        EEmpRecurringPayment m_recurringPayment = GetSalaryMonthRecurringPayment(empInfo.EmpID, m_bonusProcess.BonusProcessSalaryMonth);
                        if (m_recurringPayment != null)
                        {
                            row[FIELD_TARGET_SALARY] = m_recurringPayment.EmpRPBasicSalary;
                        }
                        else
                        {
                            row[FIELD_TARGET_SALARY] = 0;
                        }
                        row[FIELD_RANK] = "";
                        //}
                        tmpDataTable.Rows.Add(row);
                    }
                }
            }

            if (IsIncludeCurrentPositionInfo)
            {
                ImportEmpPositionInfoProcess.RetriveHierarchyLevelHeader(dbConn, tmpDataTable);
            }

            return(tmpDataTable);
        }