///<summary>Will add the pre-defined default clinics tab. ///Only one default clinics tab can exist at a time, but the user may rename it to add multiple. ///This method does NOT save the tab to the database. The user will still have to save changes and will have the option of discarding this tab.</summary> public void AddDefaultsTabByGrouping(bool hasPrompt, GroupingOptionsCtrl.Grouping grouping) { string strGrouping = char.ToUpper(grouping.ToString()[0]) + grouping.ToString().Substring(1); if (!ValidateTabName(strGrouping + " Defaults")) { return; } //get current layouts List <DashboardLayout> layoutsCur; GetDashboardLayout(out layoutsCur); //create layout DashboardLayout layout = new DashboardLayout() { DashboardColumns = 3, DashboardRows = 2, DashboardGroupName = "Default", DashboardTabName = strGrouping + " Defaults", //assigned default layout to first tab. DashboardTabOrder = layoutsCur.Count, UserGroupNum = 0, UserNum = 0, IsNew = true, }; int i = 0; for (int row = 0; row < layout.DashboardRows; row++) { for (int col = 0; col < layout.DashboardColumns; col++) { DashboardCell cell = new DashboardCell() { CellRow = row, CellColumn = col, }; switch (i++) { default: case 0: cell.CellType = DashboardCellType.ProductionGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { CurGrouping = grouping, IncludeCompleteProcs = true, IncludeAdjustements = true, IncludeWriteoffs = true, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Production - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.Bottom, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.items, BreakdownVal = 10, }) }); break; case 1: cell.CellType = DashboardCellType.IncomeGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { CurGrouping = grouping, IncludePaySplits = true, IncludeInsuranceClaims = true, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Income - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.Bottom, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.items, BreakdownVal = 10, }) }); break; case 2: cell.CellType = DashboardCellType.BrokenApptGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { CurGrouping = grouping, CurRunFor = BrokenApptGraphOptionsCtrl.RunFor.appointment, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Broken Appointments - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.count, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.Bottom, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.items, BreakdownVal = 10, }) }); break; case 3: cell.CellType = DashboardCellType.ProductionGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { CurGrouping = grouping, IncludeCompleteProcs = true, IncludeAdjustements = true, IncludeWriteoffs = true, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Production - Last 30 Days", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Days, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.Bottom, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last30Days, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.items, BreakdownVal = 10, }) }); break; case 4: cell.CellType = DashboardCellType.IncomeGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { CurGrouping = grouping, IncludePaySplits = true, IncludeInsuranceClaims = true, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Income - Last 30 Days", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Days, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.Bottom, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last30Days, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.items, BreakdownVal = 10, }) }); break; case 5: cell.CellType = DashboardCellType.NewPatientsGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { CurGrouping = grouping }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "New Patients - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.count, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.Bottom, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.items, BreakdownVal = 10, }) }); break; } layout.Cells.Add(cell); } } layoutsCur.Add(layout); //set dashboard tab control layouts SetDashboardLayout(layoutsCur, true); _hasUnsavedChanges = _hasUnsavedChanges || hasPrompt; }
///<summary>Serializes GetGraphSettings() abstract method returned value. Won't normally need to override this.</summary> private string SerializeToJson() { return(ODGraphSettingsBase.Serialize(GetGraphSettings())); }
///<summary>Will add the pre-defined default practice tab. ///Only one default practice tab can exist at a time, but the user may rename it to add multiple. ///This method does NOT save the tab to the database. The user will still have to save changes and will have the option of discarding this tab.</summary> public void AddDefaultsTabPractice(bool hasPrompt) { if (!ValidateTabName("Practice Defaults")) { return; } //get current layouts List <DashboardLayout> layoutsCur; GetDashboardLayout(out layoutsCur); //create layout DashboardLayout layout = new DashboardLayout() { DashboardColumns = 3, DashboardRows = 2, DashboardGroupName = "Default", DashboardTabName = "Practice Defaults", //assigned default layout to first tab. DashboardTabOrder = layoutsCur.Count, UserGroupNum = 0, UserNum = 0, IsNew = true, }; int i = 0; //define cell settings. anything not set here will be the defaults defined in GraphQuantityOverTimeFilter for (int row = 0; row < layout.DashboardRows; row++) { for (int col = 0; col < layout.DashboardColumns; col++) { DashboardCell cell = new DashboardCell() { CellRow = row, CellColumn = col, }; switch (i++) { case 0: cell.CellType = DashboardCellType.ProductionGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { IncludeCompleteProcs = true, IncludeAdjustements = true, IncludeWriteoffs = true, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Production - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.None, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.none, }) }); break; case 1: cell.CellType = DashboardCellType.IncomeGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { IncludePaySplits = true, IncludeInsuranceClaims = true, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Income - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.None, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.none, }) }); break; case 2: cell.CellType = DashboardCellType.BrokenApptGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { CurRunFor = BrokenApptGraphOptionsCtrl.RunFor.appointment }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Broken Appointments - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.count, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Weeks, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.None, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.none, }) }); break; case 3: cell.CellType = DashboardCellType.AccountsReceivableGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = "", GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Accounts Receivable - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.None, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.none, }) }); break; case 4: cell.CellType = DashboardCellType.NewPatientsGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = "", GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "New Patients - Last 12 Months", QtyType = OpenDentalGraph.Enumerations.QuantityType.count, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.None, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.none, }) }); break; case 5: default: cell.CellType = DashboardCellType.ProductionGraph; cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson() { FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings() { IncludeCompleteProcs = true, IncludeAdjustements = true, IncludeWriteoffs = true, }), GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings() { Title = "Production - Last 30 Days", QtyType = OpenDentalGraph.Enumerations.QuantityType.money, SeriesType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line, GroupByType = System.Windows.Forms.DataVisualization.Charting.IntervalType.Days, LegendDock = OpenDentalGraph.Enumerations.LegendDockType.None, QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last30Days, BreakdownPref = OpenDentalGraph.Enumerations.BreakdownType.none, }) }); break; } layout.Cells.Add(cell); } } layoutsCur.Add(layout); //set dashboard tab control layouts SetDashboardLayout(layoutsCur, false); _hasUnsavedChanges = _hasUnsavedChanges || hasPrompt; }