コード例 #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6LR_GLRD_1503 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6LR_GLRD_1503 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6LR_GLRD_1503 functionReturn = new FR_L6LR_GLRD_1503();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, ConnectionString, Parameter, securityTicket);

                #region Cleanup Connection/Transaction
                //Commit the transaction
                if (cleanupTransaction == true)
                {
                    Transaction.Commit();
                }
                //Close the connection
                if (cleanupConnection == true)
                {
                    Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

                try
                {
                    if (cleanupConnection == true && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                catch { }

                throw new Exception("Exception occured in method cls_Get_LeaveRequest_Data", ex);
            }
            return(functionReturn);
        }
コード例 #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
        }