当前位置: 首页>>代码示例>>C#>>正文


C# ProjectGateway.GetOperatorGroupFringeRate方法代码示例

本文整理汇总了C#中LiquiForce.LFSLive.DA.Projects.Projects.ProjectGateway.GetOperatorGroupFringeRate方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectGateway.GetOperatorGroupFringeRate方法的具体用法?C# ProjectGateway.GetOperatorGroupFringeRate怎么用?C# ProjectGateway.GetOperatorGroupFringeRate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LiquiForce.LFSLive.DA.Projects.Projects.ProjectGateway的用法示例。


在下文中一共展示了ProjectGateway.GetOperatorGroupFringeRate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadFairWageProject

        /// <summary>
        /// LoadFairWageProject
        /// </summary>
        /// <param name="works">works</param>
        /// <param name="jobClassType">jobClassType</param>
        /// <param name="projectId">projectId</param>
        /// <param name="startDate">startDate</param>
        /// <param name="endDate">endDate</param>
        /// <param name="companyId">companyId</param>
        public void LoadFairWageProject(ArrayList works, ArrayList jobClassType, int projectId, DateTime startDate, DateTime endDate, int companyId, string month)
        {
            ProjectGateway projectGateway = new ProjectGateway();
            projectGateway.LoadByProjectId(projectId);

            string projectName = projectGateway.GetName(projectId);

            int clientId = projectGateway.GetClientID(projectId);
            CompaniesGateway companiesGateway = new CompaniesGateway();
            companiesGateway.LoadAllByCompaniesId(clientId, companyId);
            string clientName = companiesGateway.GetName(clientId);

            // General vars
            int overtimeByCountry = 40; //Default for USA Projects
            int refId = GetNewRefId();

            int countryId = 1; //Default Canada
            if (projectGateway.GetCountryID(projectId) == 2)
            {
                countryId = 2;//USA
            }

            // Foreach of Works (FLL, RA, JL, PR, MH Rehab, MOB, Other)
            foreach (string work_ in works)
            {
                // Load Functions by Work
                ProjectCostingSheetAddFunctionListGateway projectCostingSheetAddFunctionListGateway = new ProjectCostingSheetAddFunctionListGateway();
                projectCostingSheetAddFunctionListGateway.LoadByWork_(work_);

                // Foreach of Functions
                foreach (ProjectCostingSheetAddTDS.FunctionListRow functionListRow in (ProjectCostingSheetAddTDS.FunctionListDataTable)projectCostingSheetAddFunctionListGateway.Table)
                {
                    // Foreach of Job Class (Laborer Group 2, Laborer Group 6, Operator Group 1, Operator Group 2, Regular Rate)
                    foreach (string jobClassType_ in jobClassType)
                    {
                        // Get Fringe Rate by Job Class
                        decimal fringeRate = projectGateway.GetOperatorGroupFringeRate(projectId, jobClassType_);

                        // Load Employees with Timesheet by ProjectId, StartDate, EndDate, Work, Function and Job Class
                        ProjectCostingSheetAddEmployeeListGateway projectCostingSheetAddEmployeeListGateway = new ProjectCostingSheetAddEmployeeListGateway(Data);
                        projectCostingSheetAddEmployeeListGateway.LoadByProjectIdStartDateEndDateWorkFunctionJobClass(projectId, startDate, endDate, work_, functionListRow.Function_, jobClassType_, companyId);

                        // Foreach of Employees with Timesheet
                        foreach (ProjectCostingSheetAddTDS.EmployeeListRow employeeListRow in (ProjectCostingSheetAddTDS.EmployeeListDataTable)projectCostingSheetAddEmployeeListGateway.Table)
                        {
                            DateTime newStartDate = new DateTime();
                            newStartDate = startDate;

                            DateTime newEndDate = new DateTime();
                            newEndDate = endDate;

                            // If Project is from Canada we get overtime
                            if (projectGateway.GetCountryID(projectId) == 1)
                            {
                                // Get Category of Employee
                                EmployeeGateway employeeGateway = new EmployeeGateway();
                                employeeGateway.LoadByEmployeeId(employeeListRow.EmployeeID);

                                switch (employeeGateway.GetCategory(employeeListRow.EmployeeID))
                                {
                                    case "Special Forces":
                                        overtimeByCountry = 50;
                                        break;

                                    case "Field":
                                        overtimeByCountry = 50;
                                        break;

                                    case "Field 44":
                                        overtimeByCountry = 44;
                                        break;

                                    case "Office/Admin":
                                        overtimeByCountry = 44;
                                        break;

                                    case "Mechanic/Manufactoring":
                                        overtimeByCountry = 44;
                                        break;
                                }
                            }

                            // Load Cost Pay Periods of Employee by StartDate and EndDate
                            ProjectCostingSheetAddEmployeePayPeriodGateway projectCostingSheetAddEmployeePayPeriodGateway = new ProjectCostingSheetAddEmployeePayPeriodGateway(Data);
                            projectCostingSheetAddEmployeePayPeriodGateway.LoadByStartDateEndDateEmployeeId(startDate, endDate, employeeListRow.EmployeeID);

                            // If Employee has Cost Pay Periods between StartDate and EndDate
                            if (projectCostingSheetAddEmployeePayPeriodGateway.Table.Rows.Count > 0)
                            {
                                // Foreach of Cost Pay Periods
                                foreach (ProjectCostingSheetAddTDS.EmployeePayPeriodRow employeePayPeriodRow in (ProjectCostingSheetAddTDS.EmployeePayPeriodDataTable)projectCostingSheetAddEmployeePayPeriodGateway.Table)
//.........这里部分代码省略.........
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:101,代码来源:ProjectCostingSheetAddLabourHoursInformation.cs


注:本文中的LiquiForce.LFSLive.DA.Projects.Projects.ProjectGateway.GetOperatorGroupFringeRate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。