コード例 #1
0
ファイル: CarrierDetail.cs プロジェクト: Blecki/LeaveWizard
 public CarrierDetail(LeaveChart Chart)
     : base(Chart)
 {
     this.ReportName = "Carrier Detail";
     this.Carrier = "DUMMY";
     this.LeaveTypes = "AWOL, USL, ULWOP, UEA";
     this.Summary = "Summarize a single carrier's leave usage, by date.";
 }
コード例 #2
0
        public static void Show(LeaveChart Chart)
        {
            var popup = new AnalysisResultsView();
            popup.Chart = Chart;

            foreach (var type in System.Reflection.Assembly.GetExecutingAssembly().GetTypes())
            {
                if (type.IsSubclassOf(typeof(LeaveAnalysis)))
                {
                    popup.ReportSelectorComboBox.Items.Add(Activator.CreateInstance(type, Chart));
                }
            }

            popup.ReportSelectorComboBox.SelectedIndex = 0; popup.ShowDialog();
        }
コード例 #3
0
ファイル: CarrierDetail.cs プロジェクト: Blecki/LeaveWizard
        public override LeaveAnalysisResults Analyze(LeaveChart Data)
        {
            var leaveTypes = LeaveTypes.Split(',').Select(s => s.Trim());

            var result = new LeaveAnalysisResults();
            result.ColumnNames.Add("Date");
            result.ColumnNames.Add("Leave Type");

            foreach (var leaveEntry in Data.EnumerateLeaveWithDates(StartDate, EndDate).Where(p => p.LeaveEntry.Carrier == Carrier && leaveTypes.Contains(p.LeaveEntry.LeaveType)))
                result.Rows.Add(new LeaveAnalysisRow
                {
                    Name = leaveEntry.Date.ToShortDateString(),
                    Columns = MakeDictionary("Leave Type", leaveEntry.LeaveEntry.LeaveType)
                });

            return result;
        }
コード例 #4
0
        public override LeaveAnalysisResults Analyze(LeaveChart Data)
        {
            var dayCount = new Dictionary<String, int>();

            foreach (var leaveEntry in Data.EnumerateLeave(StartDate, EndDate))
                if (dayCount.ContainsKey(leaveEntry.Substitute)) dayCount[leaveEntry.Substitute] += 1;
                else dayCount.Add(leaveEntry.Substitute, 1);

            var result = new LeaveAnalysisResults();
            result.ColumnNames.Add("Carrier");
            result.ColumnNames.Add("Days Worked");

            foreach (var sub in dayCount)
            {
                result.Rows.Add(new LeaveAnalysisRow { Name = sub.Key });
                result.Rows[result.Rows.Count - 1].Columns.Add("Days Worked", sub.Value.ToString());
            }

            result.SortRowsAlphabetically();
            return result;
        }
コード例 #5
0
ファイル: AnalyzeLeave.cs プロジェクト: Blecki/LeaveWizard
        public override LeaveAnalysisResults Analyze(LeaveChart Chart)
        {
            var usageTable = new Dictionary<String, Dictionary<String, int>>();

            foreach (var leaveEntry in Chart.EnumerateLeave(StartDate, EndDate).Where(l => !Constants.PropogatableLeaveTypes.Contains(l.LeaveType)))
            {
                Dictionary<String, int> carrierEntry = null;
                if (!usageTable.TryGetValue(leaveEntry.Carrier, out carrierEntry))
                {
                    carrierEntry = new Dictionary<string, int>();
                    usageTable.Add(leaveEntry.Carrier, carrierEntry);
                }

                if (carrierEntry.ContainsKey(leaveEntry.LeaveType))
                    carrierEntry[leaveEntry.LeaveType] += 1;
                else
                    carrierEntry.Add(leaveEntry.LeaveType, 1);
            }

            var result = new LeaveAnalysisResults();
            result.ColumnNames.Add("Carrier");

            foreach (var carrierEntry in usageTable)
            {
                var row = new LeaveAnalysisRow { Name = carrierEntry.Key };
                foreach (var leaveType in carrierEntry.Value)
                {
                    if (!result.ColumnNames.Contains(leaveType.Key))
                        result.ColumnNames.Add(leaveType.Key);
                    row.Columns.Add(leaveType.Key, leaveType.Value.ToString());
                }
                result.Rows.Add(row);
            }

            return result;
        }
コード例 #6
0
 public SubstituteWorkingDays(LeaveChart Chart)
     : base(Chart)
 {
     this.ReportName = "Substitute Working Days";
     this.Summary = "Count how many days a substitute has worked or is scheduled to work within the time period.";
 }
コード例 #7
0
ファイル: AnalyzeLeave.cs プロジェクト: Blecki/LeaveWizard
 public LeaveSummary(LeaveChart Chart)
     : base(Chart)
 {
     this.ReportName = "Leave Summary";
     this.Summary = "Summarizes leave usage for entire office.";
 }