示例#1
0
        protected static FR_L5TS_GTOSFST_1427 Execute(DbConnection Connection, DbTransaction Transaction, P_L5TS_GTOSFST_1427 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L5TS_GTOSFST_1427();
            returnValue.Result = new L5TS_GTOSFST_1427();
            returnValue.Result.TypeOfSalary = new L5TS_GTOSFT_1419();

            //Put your code here
            if (Parameter.CMN_BPT_EMP_SalaryTypeID != Guid.Empty)
            {
                ORM_CMN_BPT_EMP_SalaryType.Query salaryTypeQuery = new ORM_CMN_BPT_EMP_SalaryType.Query();
                salaryTypeQuery.CMN_BPT_EMP_SalaryTypeID = Parameter.CMN_BPT_EMP_SalaryTypeID;
                salaryTypeQuery.Tenant_RefID             = securityTicket.TenantID;
                salaryTypeQuery.IsDeleted = false;
                List <ORM_CMN_BPT_EMP_SalaryType> salaryTypesList = ORM_CMN_BPT_EMP_SalaryType.Query.Search(Connection, Transaction, salaryTypeQuery);

                if (salaryTypesList != null && salaryTypesList.Count > 0)
                {
                    L5TS_GTOSFT_1419 salaryType = new L5TS_GTOSFT_1419();
                    salaryType.CMN_BPT_EMP_SalaryTypeID = salaryTypesList[0].CMN_BPT_EMP_SalaryTypeID;
                    salaryType.GlobalPropertyMatchingID = salaryTypesList[0].GlobalPropertyMatchingID;
                    salaryType.SalaryType_Name          = salaryTypesList[0].SalaryType_Name;
                    salaryType.SalaryTypeStatus         = salaryTypesList[0].SalaryTypeStatus;
                    salaryType.Country_ISOCode_Alpha2   = Get_CountryISO_For_SalaryType(Connection, Transaction, securityTicket, salaryTypesList[0]);
                    returnValue.Result.TypeOfSalary     = salaryType;
                }
            }

            return(returnValue);

            #endregion UserCode
        }
示例#2
0
        protected static FR_L5TS_GTOSFT_1419_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode

            var returnValue = new FR_L5TS_GTOSFT_1419_Array();

            //Put your code here
            List <L5TS_GTOSFT_1419> retValList = new List <L5TS_GTOSFT_1419>();

            ORM_CMN_BPT_EMP_SalaryType.Query salaryTypeQuery = new ORM_CMN_BPT_EMP_SalaryType.Query();
            salaryTypeQuery.Tenant_RefID = securityTicket.TenantID;
            salaryTypeQuery.IsDeleted    = false;
            List <ORM_CMN_BPT_EMP_SalaryType> salaryTypeList = ORM_CMN_BPT_EMP_SalaryType.Query.Search(Connection, Transaction, salaryTypeQuery);

            ORM_CMN_BPT_EMP_SalaryType_2_EconomicRegion salaryEconomicRegion;
            ORM_CMN_EconomicRegion economicRegion;
            FR_Base economicRegionRes;
            ORM_CMN_Country_2_EconomicRegion countryEconomicRegion;
            ORM_CMN_Country  country;
            FR_Base          countryRes;
            L5TS_GTOSFT_1419 retValItem;
            foreach (var salaryType in salaryTypeList)
            {
                salaryEconomicRegion = ORM_CMN_BPT_EMP_SalaryType_2_EconomicRegion.Query.Search(Connection, Transaction,
                                                                                                new ORM_CMN_BPT_EMP_SalaryType_2_EconomicRegion.Query()
                {
                    Tenant_RefID = securityTicket.TenantID,
                    IsDeleted    = false,
                    CMN_BPT_EMP_SalaryType_RefID = salaryType.CMN_BPT_EMP_SalaryTypeID
                }).FirstOrDefault();

                retValItem = new L5TS_GTOSFT_1419();
                retValItem.CMN_BPT_EMP_SalaryTypeID = salaryType.CMN_BPT_EMP_SalaryTypeID;
                retValItem.GlobalPropertyMatchingID = salaryType.GlobalPropertyMatchingID;
                retValItem.SalaryType_Code          = salaryEconomicRegion != null ? salaryEconomicRegion.SalaryType_Code : "";
                retValItem.SalaryType_Name          = salaryType.SalaryType_Name;
                retValItem.SalaryTypeStatus         = salaryType.SalaryTypeStatus;

                if (salaryEconomicRegion == null)
                {
                    retValItem.Country_ISOCode_Alpha2 = "";
                    retValList.Add(retValItem);
                    continue;
                }

                economicRegion    = new ORM_CMN_EconomicRegion();
                economicRegionRes = economicRegion.Load(Connection, Transaction, salaryEconomicRegion.CMN_EconomicRegion_RefID);

                if (economicRegionRes.Status != FR_Status.Success || economicRegion.CMN_EconomicRegionID == Guid.Empty)
                {
                    retValItem.Country_ISOCode_Alpha2 = "";
                    retValList.Add(retValItem);
                    continue;
                }

                countryEconomicRegion = ORM_CMN_Country_2_EconomicRegion.Query.Search(Connection, Transaction,
                                                                                      new ORM_CMN_Country_2_EconomicRegion.Query()
                {
                    Tenant_RefID             = securityTicket.TenantID,
                    IsDeleted                = false,
                    CMN_EconomicRegion_RefID = economicRegion.CMN_EconomicRegionID
                }).FirstOrDefault();

                if (countryEconomicRegion == null)
                {
                    retValItem.Country_ISOCode_Alpha2 = "";
                    retValList.Add(retValItem);
                    continue;
                }

                country    = new ORM_CMN_Country();
                countryRes = country.Load(Connection, Transaction, countryEconomicRegion.CMN_Country_RefID);

                if (countryRes.Status != FR_Status.Success || country.CMN_CountryID == Guid.Empty)
                {
                    retValItem.Country_ISOCode_Alpha2 = "";
                    retValList.Add(retValItem);
                    continue;
                }

                retValItem.Country_ISOCode_Alpha2 = country.Country_ISOCode_Alpha2;
                retValList.Add(retValItem);
            }

            returnValue.Result = retValList.ToArray();

            return(returnValue);

            #endregion UserCode
        }