Example #1
0
        private void CreateShiftPlanTables(XRControl parent, ShiftPlan_Report shiftPlan, IList <TrackedResource> trackedResources)
        {
            const float margin      = 4F;
            const float tableHeight = 25F;
            const float offset      = tableHeight + margin;

            float top        = margin;
            float tableWidth = parent.WidthF - (margin * 2);

            bool isFutureDate = shiftPlan.Date.Date > DateTime.Now.Date;

            parent.Controls.Clear();

            XRTable table = null;

            bool summaryView = false;
            var  res         = Boolean.TryParse(Parameters["SummaryView"].Value.ToString(), out summaryView);

            // task rows...
            if (shiftPlan.Tasks.Count > 0)
            {
                foreach (var task in shiftPlan.Tasks.Where(task => !summaryView || task.Important))
                {
                    XRPanel panel = new XRPanel {
                        WidthF = tableWidth, HeightF = 25F, TopF = top, LeftF = margin, CanGrow = true
                    };
                    panel.Controls.Add(CreateTasksTable(task, tableWidth));
                    parent.Controls.Add(panel);
                    top += offset;
                }
            }
        }
Example #2
0
        void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            var     schedule = (Schedule_Report)GetCurrentRow();
            XRTable table    = new XRTable()
            {
                SizeF = new System.Drawing.SizeF(xrPanel2.WidthF, 25F)
            };

            table.BeginInit();
            XRTableRow row = new XRTableRow();

            row.KeepTogether = false;

            foreach (var shift in schedule.ShiftPlans)
            {
                XRTableCell cell = new XRTableCell {
                    WidthF = xrPanel2.WidthF / schedule.ShiftPlans.Count
                };
                row.Cells.Add(cell);

                CreateShiftPlanTables(cell, shift, ShiftPlan_Report.GetTrackedResources(shift).ToList());
            }
            table.Rows.Add(row);
            table.EndInit();

            xrPanel2.KeepTogether = false;
            xrPanel2.Controls.Clear();
            xrPanel2.Controls.Add(table);
        }
Example #3
0
        void Report_DataSourceDemanded(object sender, System.EventArgs e)
        {
            var processLocations = new List <ProcessLocation>();

            var process = new Process()
            {
                CanAcceptTasks        = true,
                Active                = true,
                ChockPosTable         = null,
                ChockPosTagArray      = null,
                CrewLeaderOccupations = new List <string>()
                {
                    "occupations-51"
                },
                DailyActualsReportKPISummaryByDepartment = null,
                DailyActualsReportKPISummaryByProcess    = false,
                DailyActualsReportKPISummaryShortCodes   = new List <string>(),
                DefaultKPIs  = new List <DefaultKPI>(),
                Deleted      = false,
                Department   = "departments-42",
                DisplayOrder = 3000,
                EnableShiftPlanAcknowledgement = false,
                EnableShiftPlanApproval        = false,
                EnableShiftPlanNotesonActuals  = false,
                EnableShortIntervalControl     = false,
                FifthKPIToTrack        = "Chal",
                FifthKPIToTrackPeriod  = "Current Week",
                FirstKPIToTrack        = "M-B",
                FirstKPIToTrackPeriod  = "Current Week",
                FourthKPIToTrack       = "OT-A",
                FourthKPIToTrackPeriod = "Current Week",
                Locations                                   = processLocations,
                ManagesEquipment                            = true,
                ManagesPeople                               = true,
                Name                                        = "Development 8N",
                PlannedTasks                                = new List <PlannedTaskOld>(),
                RuntimeTable                                = null,
                RuntimeTagArray                             = new string[] { "Rum Time Tags" },
                SecondKPIToTrack                            = "M-A",
                SecondKPIToTrackPeriod                      = "Current Week",
                ShearsTable                                 = null,
                ShearsTagArray                              = new string[0],
                ShiftPlanChecklistQuestions                 = new List <ProcessChecklistQuestion>(),
                ShiftPlanReportAdditionalTasksLines         = 1,
                ShiftPlanReportTopDelaysAndOrStoppagesLines = 0,
                ShortCode                                   = "DEV8N3",
                ShowOn2448HourSchedule                      = true,
                ShowOnEquipmentSchedule                     = true,
                ShowOnManningReport                         = true,
                ShowOnPlanningBoard                         = true,
                ShowOnShiftSchedule                         = true,
                ShowOnSmartboard                            = true,
                ShowOnWeeklySchedule                        = true,
                ShowShiftPlanReport5WHY                     = true,
                ShowShiftPlanReportChecklist                = true,
                SixthKPIToTrack                             = "Inc",
                SixthKPIToTrackPeriod                       = "Month To Date",
                StandardTasks                               = new List <StandardTaskOld>(),
                TTFCTable                                   = null,
                TTFCTagArray                                = new string[] { "TTFC Tags" },
                TaskChecklistQuestions                      = new List <ProcessChecklistQuestion>(),
                ThirdKPIToTrack                             = "OT-B",
                ThirdKPIToTrackPeriod                       = "Current Week",
                TonnesMultiplier                            = (decimal)25.35,
                Type                                        = "Production",
                UCTable                                     = null,
                UCTagArray                                  = new string[0],
                WeeklyOperatingHoursTarget                  = 85
            };

            var scheduleReport = new Schedule_Report()
            {
                Date         = new DateTime(2018, 3, 29),
                DisplayOrder = 3000,
                Id           = "Maintenance",
                Name         = "DEV8N3",
                Process      = process,
                ShiftPlans   = new List <ShiftPlan_Report>()
            };

            for (var j = 0; j < 2; j++)
            {
                var kpiTemplate = new AppliedKPI()
                {
                    Date          = new DateTime(2018, 3, 29),
                    DefaultTarget = 420,
                    DisplayOrder  = 10000,
                    Id            = "AppliedKPIs-53918",
                    Process       = "processes-51",
                    Shift         = "Maintenance",
                    ShortCode     = "OT",
                    Target        = 420,
                    TargetString  = "420"
                };

                var personTemplate = new ShiftPlanPerson_Report()
                {
                    Available           = true,
                    OccupationShortCode = "M"
                };

                var shiftPlanReportTemplate = new ShiftPlan_Report()
                {
                    Acknowledgements      = new List <Acknowledgement_Report>(),
                    ActualsCrewLeader     = null,
                    ActualsCrewLeaderName = null,
                    Checklist             = new List <ShiftPlanChecklistQuestion>(),
                    Crew                                      = "White",
                    CrewLeader                                = null,
                    CrewLeaderLabel                           = "Deputy",
                    Date                                      = new DateTime(2018, 3, 29),
                    DefaultCrewLeader                         = "01 DMS, Kevin Gardner",
                    EffectiveShiftLength                      = 12,
                    EnableShiftPlanAcknowledgement            = false,
                    EnableShiftPlanAcknowledgementBySchedule  = false,
                    EnableShiftPlanAcknowledgementByShiftPlan = false,
                    Equipment                                 = new List <ShiftPlanEquipment>(),
                    Id                            = "shiftplans-processes-51-2018-03-29-Maintenance",
                    KPIs                          = new List <AppliedKPI>(),
                    People                        = new List <ShiftPlanPerson_Report>(),
                    Process                       = "process-51",
                    ProcessName                   = "Development 8N",
                    ProcessType                   = "Production",
                    SafetyNotes                   = null,
                    SafetyReport                  = null,
                    ShadowTasksWarning            = "",
                    Shift                         = "Maintenance",
                    ShiftLength                   = 12,
                    ShiftNotes                    = null,
                    ShiftReport                   = null,
                    StartDateTime                 = new DateTime(2018, 3, 29),
                    SuggestedWorkAndNotifications = null,
                    Tasks                         = new List <ShiftPlanTask_Report>(),
                    UnscheduledWorkCompleted      = null
                };

                for (var i = 0; i < 92; i++)
                {
                    var description = new StringBuilder("Test ");

                    for (int k = 0; k < j * 50; k++)
                    {
                        description.Append("Test ");
                    }

                    var taskTemplate = new ShiftPlanTask_Report()
                    {
                        Description = description.ToString(),
                        Duration    = 2,
                        Priority    = "20P",
                        Process     = "DEV8N3",
                        StartTime   = new DateTime(2018, 3, 29, 5, 0, 0),
                    };

                    shiftPlanReportTemplate.Tasks.Add(taskTemplate);
                }

                scheduleReport.ShiftPlans.Add(shiftPlanReportTemplate);
            }

            var sorted = new List <Schedule_Report>()
            {
                scheduleReport
            };

            this.DataSource = sorted;
        }