protected static FR_L5TN_GTI_1646 Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5TN_GTI_1646();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_VacationPlanner_Tenant.Atomic.Retrieval.SQL.cls_get_Tenant_Informations.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;
            List <L5TN_GTI_1646> results = new List <L5TN_GTI_1646>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "CMN_TenantID", "IsUsing_WorkAreas", "IsUsing_Offices", "IsUsing_Workplaces", "DocumentServerRootURL", "CMN_UniversalContactDetailID", "IsCompany", "CompanyName_Line1", "CompanyName_Line2", "WorkDescription", "Salutation", "Title", "First_Name", "Last_Name", "CareOf", "Country_Name", "Country_639_1_ISOCode", "Street_Number", "Street_Name", "PostalAddress_Number", "PostalAddress_Formatted", "ZIP", "Town", "Contact_Email", "Contact_Telephone", "Contact_Fax", "CMN_BPT_STA_SettingProfileID", "StafMember_Caption_DictID", "IsLeaveTimeCalculated_InDays", "IsLeaveTimeCalculated_InHours", "IsUsingWorkflow_ForLeaveRequests", "CMN_CAL_CalendarInstance_RefID", "CMN_LOC_RegionID", "Region_Name_DictID", "Default_SurchargeCalculation_UseAccumulated", "Default_SurchargeCalculation_UseMaximum" });
                while (reader.Read())
                {
                    L5TN_GTI_1646 resultItem = new L5TN_GTI_1646();
                    //0:Parameter CMN_TenantID of type Guid
                    resultItem.CMN_TenantID = reader.GetGuid(0);
                    //1:Parameter IsUsing_WorkAreas of type bool
                    resultItem.IsUsing_WorkAreas = reader.GetBoolean(1);
                    //2:Parameter IsUsing_Offices of type bool
                    resultItem.IsUsing_Offices = reader.GetBoolean(2);
                    //3:Parameter IsUsing_Workplaces of type bool
                    resultItem.IsUsing_Workplaces = reader.GetBoolean(3);
                    //4:Parameter DocumentServerRootURL of type String
                    resultItem.DocumentServerRootURL = reader.GetString(4);
                    //5:Parameter CMN_UniversalContactDetailID of type Guid
                    resultItem.CMN_UniversalContactDetailID = reader.GetGuid(5);
                    //6:Parameter IsCompany of type bool
                    resultItem.IsCompany = reader.GetBoolean(6);
                    //7:Parameter CompanyName_Line1 of type String
                    resultItem.CompanyName_Line1 = reader.GetString(7);
                    //8:Parameter CompanyName_Line2 of type String
                    resultItem.CompanyName_Line2 = reader.GetString(8);
                    //9:Parameter WorkDescription of type String
                    resultItem.WorkDescription = reader.GetString(9);
                    //10:Parameter Salutation of type String
                    resultItem.Salutation = reader.GetString(10);
                    //11:Parameter Title of type String
                    resultItem.Title = reader.GetString(11);
                    //12:Parameter First_Name of type String
                    resultItem.First_Name = reader.GetString(12);
                    //13:Parameter Last_Name of type String
                    resultItem.Last_Name = reader.GetString(13);
                    //14:Parameter CareOf of type String
                    resultItem.CareOf = reader.GetString(14);
                    //15:Parameter Country_Name of type String
                    resultItem.Country_Name = reader.GetString(15);
                    //16:Parameter Country_639_1_ISOCode of type String
                    resultItem.Country_639_1_ISOCode = reader.GetString(16);
                    //17:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(17);
                    //18:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(18);
                    //19:Parameter PostalAddress_Number of type String
                    resultItem.PostalAddress_Number = reader.GetString(19);
                    //20:Parameter PostalAddress_Formatted of type String
                    resultItem.PostalAddress_Formatted = reader.GetString(20);
                    //21:Parameter ZIP of type String
                    resultItem.ZIP = reader.GetString(21);
                    //22:Parameter Town of type String
                    resultItem.Town = reader.GetString(22);
                    //23:Parameter Contact_Email of type String
                    resultItem.Contact_Email = reader.GetString(23);
                    //24:Parameter Contact_Telephone of type String
                    resultItem.Contact_Telephone = reader.GetString(24);
                    //25:Parameter Contact_Fax of type String
                    resultItem.Contact_Fax = reader.GetString(25);
                    //26:Parameter CMN_BPT_STA_SettingProfileID of type Guid
                    resultItem.CMN_BPT_STA_SettingProfileID = reader.GetGuid(26);
                    //27:Parameter StafMember_Caption of type Dict
                    resultItem.StafMember_Caption             = reader.GetDictionary(27);
                    resultItem.StafMember_Caption.SourceTable = "cmn_bpt_sta_settingprofiles";
                    loader.Append(resultItem.StafMember_Caption);
                    //28:Parameter IsLeaveTimeCalculated_InDays of type bool
                    resultItem.IsLeaveTimeCalculated_InDays = reader.GetBoolean(28);
                    //29:Parameter IsLeaveTimeCalculated_InHours of type bool
                    resultItem.IsLeaveTimeCalculated_InHours = reader.GetBoolean(29);
                    //30:Parameter IsUsingWorkflow_ForLeaveRequests of type bool
                    resultItem.IsUsingWorkflow_ForLeaveRequests = reader.GetBoolean(30);
                    //31:Parameter CMN_CAL_CalendarInstance_RefID of type Guid
                    resultItem.CMN_CAL_CalendarInstance_RefID = reader.GetGuid(31);
                    //32:Parameter CMN_LOC_RegionID of type Guid
                    resultItem.CMN_LOC_RegionID = reader.GetGuid(32);
                    //33:Parameter Region_Name_DictID of type Dict
                    resultItem.Region_Name_DictID             = reader.GetDictionary(33);
                    resultItem.Region_Name_DictID.SourceTable = "cmn_loc_regions";
                    loader.Append(resultItem.Region_Name_DictID);
                    //34:Parameter Default_SurchargeCalculation_UseAccumulated of type bool
                    resultItem.Default_SurchargeCalculation_UseAccumulated = reader.GetBoolean(34);
                    //35:Parameter Default_SurchargeCalculation_UseMaximum of type bool
                    resultItem.Default_SurchargeCalculation_UseMaximum = reader.GetBoolean(35);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw ex;
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = results.FirstOrDefault();
            return(returnStatus);
        }
예제 #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
        }