コード例 #1
0
        protected static FR_L5EW_GEWFEWID_1552 Execute(DbConnection Connection, DbTransaction Transaction, P_L5EW_GEWFEWID_1552 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5EW_GEWFEWID_1552();
            returnValue.Result           = new L5EW_GEWFEWID_1552();
            returnValue.Result.ExtraWork = new L5EW_GEWCFT_1546();

            //Put your code here

            var orm_extraWork = new ORM_CMN_BPT_EMP_ExtraWorkCalculation();
            if (Parameter.CMN_BPT_EMP_ExtraWorkCalculationID != Guid.Empty)
            {
                var result = orm_extraWork.Load(Connection, Transaction, Parameter.CMN_BPT_EMP_ExtraWorkCalculationID);
                if (result.Status == FR_Status.Success || orm_extraWork.CMN_BPT_EMP_ExtraWorkCalculationID != Guid.Empty)
                {
                    L5EW_GEWCFT_1546 extraWork = new L5EW_GEWCFT_1546();
                    extraWork.CMN_BPT_EMP_ExtraWorkCalculationID             = orm_extraWork.CMN_BPT_EMP_ExtraWorkCalculationID;
                    extraWork.AreAdditionalWorkDays_CalculatedIn_Days        = orm_extraWork.AreAdditionalWorkDays_CalculatedIn_Days;
                    extraWork.AreAdditionalWorkDays_CalculatedIn_DaysAsHours = orm_extraWork.AreAdditionalWorkDays_CalculatedIn_DaysAsHours;
                    extraWork.AreAdditionalWorkDays_CalculatedIn_Hours       = orm_extraWork.AreAdditionalWorkDays_CalculatedIn_Hours;
                    extraWork.ExtraWorkCalculation_Name          = orm_extraWork.ExtraWorkCalculation_Name;
                    extraWork.IsCalculatingOvertimeEnabled       = orm_extraWork.IsCalculatingOvertimeEnabled;
                    extraWork.IsDisplayedAs_DaysAndHours         = orm_extraWork.IsDisplayedAs_DaysAndHours;
                    extraWork.IsDisplayedAs_HoursAsDays          = orm_extraWork.IsDisplayedAs_HoursAsDays;
                    extraWork.MinimalOvertimeTreshold_in_minutes = orm_extraWork.MinimalOvertimeTreshold_in_minutes;
                    extraWork.StandardWorkDay_in_mins            = orm_extraWork.StandardWorkDay_in_mins;

                    ORM_CMN_BPT_EMP_ExtraWorkCalculation_StructureBinding.Query structureBindingQuery = new ORM_CMN_BPT_EMP_ExtraWorkCalculation_StructureBinding.Query();
                    structureBindingQuery.ExtraWorkCalculation_RefID = extraWork.CMN_BPT_EMP_ExtraWorkCalculationID;
                    structureBindingQuery.IsDeleted    = false;
                    structureBindingQuery.Tenant_RefID = securityTicket.TenantID;

                    var structureBindings = ORM_CMN_BPT_EMP_ExtraWorkCalculation_StructureBinding.Query.Search(Connection, Transaction, structureBindingQuery);

                    if (structureBindings.Count != 0)
                    {
                        ORM_CMN_BPT_EMP_ExtraWorkCalculation_StructureBinding structureBinding = structureBindings.FirstOrDefault();
                        extraWork.BoundTo_Office_RefID    = structureBinding.BoundTo_Office_RefID;
                        extraWork.BoundTo_WorkArea_RefID  = structureBinding.BoundTo_WorkArea_RefID;
                        extraWork.BoundTo_Workplace_RefID = structureBinding.BoundTo_Workplace_RefID;
                    }
                    else
                    {
                        extraWork.BoundTo_Office_RefID    = Guid.Empty;
                        extraWork.BoundTo_WorkArea_RefID  = Guid.Empty;
                        extraWork.BoundTo_Workplace_RefID = Guid.Empty;
                    }

                    returnValue.Result.ExtraWork = extraWork;
                }
            }

            return(returnValue);

            #endregion UserCode
        }
コード例 #2
0
        protected static FR_L5EW_GEWCFT_1546_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5EW_GEWCFT_1546_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Plannico_ExtraWorkCalculations.Atomic.Retrieval.SQL.cls_Get_ExtraWorkCalculations_For_Tenant.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 <L5EW_GEWCFT_1546> results = new List <L5EW_GEWCFT_1546>();
            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_BPT_EMP_ExtraWorkCalculationID", "ExtraWorkCalculation_Name_DictID", "IsCalculatingOvertimeEnabled", "AreAdditionalWorkDays_CalculatedIn_Hours", "AreAdditionalWorkDays_CalculatedIn_DaysAsHours", "AreAdditionalWorkDays_CalculatedIn_Days", "StandardWorkDay_in_mins", "IsDisplayedAs_HoursAsDays", "IsDisplayedAs_DaysAndHours", "MinimalOvertimeTreshold_in_minutes", "BoundTo_Office_RefID", "BoundTo_WorkArea_RefID", "BoundTo_Workplace_RefID" });
                while (reader.Read())
                {
                    L5EW_GEWCFT_1546 resultItem = new L5EW_GEWCFT_1546();
                    //0:Parameter CMN_BPT_EMP_ExtraWorkCalculationID of type Guid
                    resultItem.CMN_BPT_EMP_ExtraWorkCalculationID = reader.GetGuid(0);
                    //1:Parameter ExtraWorkCalculation_Name of type Dict
                    resultItem.ExtraWorkCalculation_Name             = reader.GetDictionary(1);
                    resultItem.ExtraWorkCalculation_Name.SourceTable = "cmn_bpt_emp_extraworkcalculations";
                    loader.Append(resultItem.ExtraWorkCalculation_Name);
                    //2:Parameter IsCalculatingOvertimeEnabled of type bool
                    resultItem.IsCalculatingOvertimeEnabled = reader.GetBoolean(2);
                    //3:Parameter AreAdditionalWorkDays_CalculatedIn_Hours of type bool
                    resultItem.AreAdditionalWorkDays_CalculatedIn_Hours = reader.GetBoolean(3);
                    //4:Parameter AreAdditionalWorkDays_CalculatedIn_DaysAsHours of type bool
                    resultItem.AreAdditionalWorkDays_CalculatedIn_DaysAsHours = reader.GetBoolean(4);
                    //5:Parameter AreAdditionalWorkDays_CalculatedIn_Days of type bool
                    resultItem.AreAdditionalWorkDays_CalculatedIn_Days = reader.GetBoolean(5);
                    //6:Parameter StandardWorkDay_in_mins of type int
                    resultItem.StandardWorkDay_in_mins = reader.GetInteger(6);
                    //7:Parameter IsDisplayedAs_HoursAsDays of type bool
                    resultItem.IsDisplayedAs_HoursAsDays = reader.GetBoolean(7);
                    //8:Parameter IsDisplayedAs_DaysAndHours of type bool
                    resultItem.IsDisplayedAs_DaysAndHours = reader.GetBoolean(8);
                    //9:Parameter MinimalOvertimeTreshold_in_minutes of type int
                    resultItem.MinimalOvertimeTreshold_in_minutes = reader.GetInteger(9);
                    //10:Parameter BoundTo_Office_RefID of type Guid
                    resultItem.BoundTo_Office_RefID = reader.GetGuid(10);
                    //11:Parameter BoundTo_WorkArea_RefID of type Guid
                    resultItem.BoundTo_WorkArea_RefID = reader.GetGuid(11);
                    //12:Parameter BoundTo_Workplace_RefID of type Guid
                    resultItem.BoundTo_Workplace_RefID = reader.GetGuid(12);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }