コード例 #1
0
        protected static FR_L5EM_GEFU_445 Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var           returnValue = new FR_L5EM_GEFU_445();
            L5EM_GEFU_445 result      = new L5EM_GEFU_445();


            ORM_USR_Account account = new ORM_USR_Account();
            account.Load(Connection, Transaction, securityTicket.AccountID);
            if (account.USR_AccountID == Guid.Empty)
            {
                return(null);
            }

            ORM_CMN_BPT_EMP_Employee.Query employeeQuery = new ORM_CMN_BPT_EMP_Employee.Query();
            employeeQuery.IsDeleted    = false;
            employeeQuery.Tenant_RefID = securityTicket.TenantID;
            employeeQuery.BusinessParticipant_RefID = account.BusinessParticipant_RefID;
            List <ORM_CMN_BPT_EMP_Employee> employeeList = ORM_CMN_BPT_EMP_Employee.Query.Search(Connection, Transaction, employeeQuery);
            if (employeeList.Count != 0)
            {
                ORM_CMN_BPT_EMP_Employee employee = employeeList[0];
                result.CMN_BPT_EMP_EmployeeID = employee.CMN_BPT_EMP_EmployeeID;
                result.Staff_Number           = employee.Staff_Number;
                result.StandardFunction       = employee.StandardFunction;


                ORM_CMN_BPT_BusinessParticipant businessParticipant = new ORM_CMN_BPT_BusinessParticipant();
                businessParticipant.Load(Connection, Transaction, employee.BusinessParticipant_RefID);

                ORM_CMN_BPT_EMP_Employee_WorkplaceAssignment.Query employeeWorkplaceAssignmentsQuery = new ORM_CMN_BPT_EMP_Employee_WorkplaceAssignment.Query();
                employeeWorkplaceAssignmentsQuery.CMN_BPT_EMP_Employee_RefID = employee.CMN_BPT_EMP_EmployeeID;
                employeeWorkplaceAssignmentsQuery.Tenant_RefID = securityTicket.TenantID;
                employeeWorkplaceAssignmentsQuery.IsDeleted    = false;
                List <ORM_CMN_BPT_EMP_Employee_WorkplaceAssignment> employeeWorkplaceAssignemntsList = ORM_CMN_BPT_EMP_Employee_WorkplaceAssignment.Query.Search(Connection, Transaction, employeeWorkplaceAssignmentsQuery);
                List <L5EM_GEFU_445_EmployeeWorkplaceHistory>       employeeWorkplaceAssignments     = new List <L5EM_GEFU_445_EmployeeWorkplaceHistory>();

                foreach (var workplaceAssignemns in employeeWorkplaceAssignemntsList)
                {
                    L5EM_GEFU_445_EmployeeWorkplaceHistory item = new L5EM_GEFU_445_EmployeeWorkplaceHistory();
                    item.BoundTo_Workplace_RefID = workplaceAssignemns.BoundTo_Workplace_RefID;
                    item.CMN_BPT_EMP_Employee_PlanGroup_RefID       = workplaceAssignemns.CMN_BPT_EMP_Employee_PlanGroup_RefID;
                    item.CMN_BPT_EMP_Employee_WorkplaceAssignmentID = workplaceAssignemns.CMN_BPT_EMP_Employee_WorkplaceAssignment;
                    item.Default_BreakTime_Template_RefID           = workplaceAssignemns.Default_BreakTime_Template_RefID;
                    item.IsBreakTimeCalculated_Actual   = workplaceAssignemns.IsBreakTimeCalculated_Actual;
                    item.IsBreakTimeCalculated_Planning = workplaceAssignemns.IsBreakTimeCalculated_Planning;
                    item.SequenceNumber = workplaceAssignemns.SequenceNumber;
                    item.WorkplaceAssignment_StartDate = workplaceAssignemns.WorkplaceAssignment_StartDate;

                    employeeWorkplaceAssignments.Add(item);
                }

                result.EmployeeWorkplaceHistory = employeeWorkplaceAssignments.ToArray();
            }
            returnValue.Result = result;
            //Put your code here
            return(returnValue);

            #endregion UserCode
        }
コード例 #2
0
        protected static FR_L6LR_GLRD_1503 Execute(DbConnection Connection, DbTransaction Transaction, String ConnectionString, P_L6LR_GLRD_1503 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6LR_GLRD_1503();
            //Put your code here

            L5EM_GEFU_445 LoggedEmplyeeID = null;

            L5EM_GEAAWCFT_1210[] For_Employees = null;

            L5AR_GAARFT_1130[] reasons_Res = null;

            L5TN_GTI_1646 tenant = null;

            L6TN_GSFT_1017 settings = null;

            L5EM_GEFT_0959[] employees = null;

            L5CM_GCSFT_1157 comapnyStructure = null;

            L5LR_GLRFSP_1532[] leaveRequests = null;

            L3EV_GSEFT_1647[] events = null;



            Parallel.Invoke(() =>
            {
                LoggedEmplyeeID = cls_Get_Employee_For_LoggedAccount.Invoke(ConnectionString, securityTicket).Result;
            },  // close first Action

                            () =>
            {
                For_Employees = cls_Get_Employees_And_ActiveWorkingContracts_For_Tenant.Invoke(ConnectionString, securityTicket).Result;
            },      //close second Action

                            () =>
            {
                reasons_Res = cls_get_Active_AbsenceReason_For_TenantID.Invoke(ConnectionString, securityTicket).Result;
            }
                            ,

                            () =>
            {
                tenant = cls_get_Tenant_Informations.Invoke(ConnectionString, securityTicket).Result;
            }
                            ,

                            () =>
            {
                settings = cls_Get_Settings_For_Tenant.Invoke(ConnectionString, securityTicket).Result;
            }
                            ,

                            () =>
            {
                employees = cls_Get_Employees_For_Tenant.Invoke(ConnectionString, securityTicket).Result;
            },

                            () =>
            {
                comapnyStructure = cls_Get_Company_Structure_For_Tenant.Invoke(ConnectionString, securityTicket).Result;
            }
                            ,

                            () =>
            {
                P_L5LR_GLRFSP_1532 param = new P_L5LR_GLRFSP_1532();
                param.EmployeeIDList     = Parameter.EmployeeIDListForRequests;
                leaveRequests            = cls_Get_LeaveRequests_For_SelectedPersons.Invoke(ConnectionString, param, securityTicket).Result;
            }
                            ,

                            () =>
            {
                events = cls_Get_StructureEvents_For_Tenant.Invoke(ConnectionString, securityTicket).Result;
            }
                            );



            returnValue.Result                    = new L6LR_GLRD_1503();
            returnValue.Result.AllEvents          = events;
            returnValue.Result.AllLeaveRequests   = leaveRequests;
            returnValue.Result.ForEmployees       = For_Employees;
            returnValue.Result.LoggedEmployeeID   = LoggedEmplyeeID;
            returnValue.Result.Settings           = settings;
            returnValue.Result.LeavingReasons     = reasons_Res;
            returnValue.Result.TenantInformations = tenant;
            returnValue.Result.AllEmployees       = employees;

            return(returnValue);

            #endregion UserCode
        }