Exemplo n.º 1
0
        public static bool isWorkingOn(this L5_EM_GEWI_1628 interval, DayOfWeek dayOfWeek)
        {
            switch (dayOfWeek)
            {
            case        DayOfWeek.Friday:
                return(interval.IsFriday);

            case        DayOfWeek.Monday:
                return(interval.IsMonday);

            case        DayOfWeek.Saturday:
                return(interval.IsSaturday);

            case        DayOfWeek.Sunday:
                return(interval.IsSunday);

            case        DayOfWeek.Thursday:
                return(interval.IsThursday);

            case        DayOfWeek.Tuesday:
                return(interval.IsTuesday);

            case        DayOfWeek.Wednesday:
                return(interval.IsWednesday);

            default:
                return(false);
            }
        }
Exemplo n.º 2
0
 public static double dayDuration(this L5_EM_GEWI_1628 interval)
 {
     if (!interval.IsWholeDay)
     {
         return(0.5);
     }
     else
     {
         return(1);
     }
 }
        protected static FR_L5_EM_GEWI_1628_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5_EM_GEWI_1628_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_VacationPlanner_Employees.Atomic.Retrieval.SQL.cls_Get_Employee_WorktimeIntervals.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 <L5_EM_GEWI_1628> results = new List <L5_EM_GEWI_1628>();
            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_CAL_WeeklyOfficeHours_IntervalID", "WeeklyOfficeHours_Template_RefID", "IsWholeDay", "TimeFrom_InMinutes", "TimeTo_InMinutes", "IsMonday", "IsTuesday", "IsWednesday", "IsThursday", "IsFriday", "IsSaturday", "IsSunday", "Creation_Timestamp", "Tenant_RefID", "CMN_BPT_EMP_WorkingContractID" });
                while (reader.Read())
                {
                    L5_EM_GEWI_1628 resultItem = new L5_EM_GEWI_1628();
                    //0:Parameter CMN_CAL_WeeklyOfficeHours_IntervalID of type Guid
                    resultItem.CMN_CAL_WeeklyOfficeHours_IntervalID = reader.GetGuid(0);
                    //1:Parameter WeeklyOfficeHours_Template_RefID of type Guid
                    resultItem.WeeklyOfficeHours_Template_RefID = reader.GetGuid(1);
                    //2:Parameter IsWholeDay of type bool
                    resultItem.IsWholeDay = reader.GetBoolean(2);
                    //3:Parameter TimeFrom_InMinutes of type String
                    resultItem.TimeFrom_InMinutes = reader.GetString(3);
                    //4:Parameter TimeTo_InMinutes of type double
                    resultItem.TimeTo_InMinutes = reader.GetDouble(4);
                    //5:Parameter IsMonday of type bool
                    resultItem.IsMonday = reader.GetBoolean(5);
                    //6:Parameter IsTuesday of type bool
                    resultItem.IsTuesday = reader.GetBoolean(6);
                    //7:Parameter IsWednesday of type bool
                    resultItem.IsWednesday = reader.GetBoolean(7);
                    //8:Parameter IsThursday of type bool
                    resultItem.IsThursday = reader.GetBoolean(8);
                    //9:Parameter IsFriday of type bool
                    resultItem.IsFriday = reader.GetBoolean(9);
                    //10:Parameter IsSaturday of type bool
                    resultItem.IsSaturday = reader.GetBoolean(10);
                    //11:Parameter IsSunday of type bool
                    resultItem.IsSunday = reader.GetBoolean(11);
                    //12:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(12);
                    //13:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(13);
                    //14:Parameter CMN_BPT_EMP_WorkingContractID of type Guid
                    resultItem.CMN_BPT_EMP_WorkingContractID = reader.GetGuid(14);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_Employee_WorktimeIntervals", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Exemplo n.º 4
0
 public static double hoursDuration(this L5_EM_GEWI_1628 interval)
 {
     return(interval.TimeTo_InMinutes / 60);
 }