Exemplo n.º 1
0
        ///<summary>Updates one DashboardCell in the database.</summary>
        public static void Update(DashboardCell dashboardCell)
        {
            string command = "UPDATE dashboardcell SET "
                             + "DashboardLayoutNum=  " + POut.Long(dashboardCell.DashboardLayoutNum) + ", "
                             + "CellRow           =  " + POut.Int(dashboardCell.CellRow) + ", "
                             + "CellColumn        =  " + POut.Int(dashboardCell.CellColumn) + ", "
                             + "CellType          = '" + POut.String(dashboardCell.CellType.ToString()) + "', "
                             + "CellSettings      =  " + DbHelper.ParamChar + "paramCellSettings, "
                             + "LastQueryTime     =  " + POut.DateT(dashboardCell.LastQueryTime) + ", "
                             + "LastQueryData     =  " + DbHelper.ParamChar + "paramLastQueryData, "
                             + "RefreshRateSeconds=  " + POut.Int(dashboardCell.RefreshRateSeconds) + " "
                             + "WHERE DashboardCellNum = " + POut.Long(dashboardCell.DashboardCellNum);

            if (dashboardCell.CellSettings == null)
            {
                dashboardCell.CellSettings = "";
            }
            OdSqlParameter paramCellSettings = new OdSqlParameter("paramCellSettings", OdDbType.Text, POut.StringParam(dashboardCell.CellSettings));

            if (dashboardCell.LastQueryData == null)
            {
                dashboardCell.LastQueryData = "";
            }
            OdSqlParameter paramLastQueryData = new OdSqlParameter("paramLastQueryData", OdDbType.Text, POut.StringParam(dashboardCell.LastQueryData));

            Db.NonQ(command, paramCellSettings, paramLastQueryData);
        }
Exemplo n.º 2
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <DashboardCell> TableToList(DataTable table)
        {
            List <DashboardCell> retVal = new List <DashboardCell>();
            DashboardCell        dashboardCell;

            foreach (DataRow row in table.Rows)
            {
                dashboardCell = new DashboardCell();
                dashboardCell.DashboardCellNum   = PIn.Long(row["DashboardCellNum"].ToString());
                dashboardCell.DashboardLayoutNum = PIn.Long(row["DashboardLayoutNum"].ToString());
                dashboardCell.CellRow            = PIn.Int(row["CellRow"].ToString());
                dashboardCell.CellColumn         = PIn.Int(row["CellColumn"].ToString());
                string cellType = row["CellType"].ToString();
                if (cellType == "")
                {
                    dashboardCell.CellType = (DashboardCellType)0;
                }
                else
                {
                    try{
                        dashboardCell.CellType = (DashboardCellType)Enum.Parse(typeof(DashboardCellType), cellType);
                    }
                    catch {
                        dashboardCell.CellType = (DashboardCellType)0;
                    }
                }
                dashboardCell.CellSettings       = PIn.String(row["CellSettings"].ToString());
                dashboardCell.LastQueryTime      = PIn.DateT(row["LastQueryTime"].ToString());
                dashboardCell.LastQueryData      = PIn.String(row["LastQueryData"].ToString());
                dashboardCell.RefreshRateSeconds = PIn.Int(row["RefreshRateSeconds"].ToString());
                retVal.Add(dashboardCell);
            }
            return(retVal);
        }
Exemplo n.º 3
0
 ///<summary>Inserts one DashboardCell into the database.  Returns the new priKey.</summary>
 public static long Insert(DashboardCell dashboardCell)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         dashboardCell.DashboardCellNum = DbHelper.GetNextOracleKey("dashboardcell", "DashboardCellNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(dashboardCell, true));
             }
             catch (Oracle.ManagedDataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     dashboardCell.DashboardCellNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(dashboardCell, false));
     }
 }
Exemplo n.º 4
0
        ///<summary>Inserts one DashboardCell into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(DashboardCell dashboardCell, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO dashboardcell (";

            if (!useExistingPK && isRandomKeys)
            {
                dashboardCell.DashboardCellNum = ReplicationServers.GetKeyNoCache("dashboardcell", "DashboardCellNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "DashboardCellNum,";
            }
            command += "DashboardLayoutNum,CellRow,CellColumn,CellType,CellSettings,LastQueryTime,LastQueryData,RefreshRateSeconds) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(dashboardCell.DashboardCellNum) + ",";
            }
            command +=
                POut.Long(dashboardCell.DashboardLayoutNum) + ","
                + POut.Int(dashboardCell.CellRow) + ","
                + POut.Int(dashboardCell.CellColumn) + ","
                + "'" + POut.String(dashboardCell.CellType.ToString()) + "',"
                + DbHelper.ParamChar + "paramCellSettings,"
                + POut.DateT(dashboardCell.LastQueryTime) + ","
                + DbHelper.ParamChar + "paramLastQueryData,"
                + POut.Int(dashboardCell.RefreshRateSeconds) + ")";
            if (dashboardCell.CellSettings == null)
            {
                dashboardCell.CellSettings = "";
            }
            OdSqlParameter paramCellSettings = new OdSqlParameter("paramCellSettings", OdDbType.Text, POut.StringParam(dashboardCell.CellSettings));

            if (dashboardCell.LastQueryData == null)
            {
                dashboardCell.LastQueryData = "";
            }
            OdSqlParameter paramLastQueryData = new OdSqlParameter("paramLastQueryData", OdDbType.Text, POut.StringParam(dashboardCell.LastQueryData));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramCellSettings, paramLastQueryData);
            }
            else
            {
                dashboardCell.DashboardCellNum = Db.NonQ(command, true, "DashboardCellNum", "dashboardCell", paramCellSettings, paramLastQueryData);
            }
            return(dashboardCell.DashboardCellNum);
        }
Exemplo n.º 5
0
 ///<summary>Inserts one DashboardCell into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(DashboardCell dashboardCell)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(dashboardCell, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             dashboardCell.DashboardCellNum = DbHelper.GetNextOracleKey("dashboardcell", "DashboardCellNum");                  //Cacheless method
         }
         return(InsertNoCache(dashboardCell, true));
     }
 }
Exemplo n.º 6
0
 public void SetCellLayout(int rows, int columns, List <DashboardCell> cells, GraphQuantityOverTime.OnGetColorFromSeriesGraphTypeArgs onGetSeriesColor, GraphQuantityOverTimeFilter.GetGraphPointsForHQArgs onGetODGraphPointsArgs)
 {
     try {
         tableLayoutPanel.SuspendLayout();
         tableLayoutPanel.Controls.Clear();
         tableLayoutPanel.RowStyles.Clear();
         tableLayoutPanel.ColumnStyles.Clear();
         tableLayoutPanel.RowCount    = rows;
         tableLayoutPanel.ColumnCount = columns;
         for (int rowIndex = 0; rowIndex < rows; rowIndex++)
         {
             tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent));
             tableLayoutPanel.RowStyles[rowIndex].Height = 100 / (float)rows;
         }
         for (int columnIndex = 0; columnIndex < columns; columnIndex++)
         {
             tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent));
             tableLayoutPanel.ColumnStyles[columnIndex].Width = 100 / (float)columns;
         }
         for (int rowIndex = 0; rowIndex < rows; rowIndex++)
         {
             for (int columnIndex = 0; columnIndex < columns; columnIndex++)
             {
                 DashboardCell          cell       = cells.FirstOrDefault(x => x.CellColumn == columnIndex && x.CellRow == rowIndex);
                 DashboardDockContainer cellHolder = null;
                 if (cell != null)
                 {
                     //Currently all CellTypes return GraphQuantityOverTimeFilter. Add a switch here if we ever want to dock a different control type.
                     cellHolder = new GraphQuantityOverTimeFilter(cell.CellType, cell.CellSettings, onGetSeriesColor, onGetODGraphPointsArgs).CreateDashboardDockContainer(cell);
                 }
                 AddCell(columnIndex, rowIndex, cellHolder);
             }
         }
     }
     finally {
         tableLayoutPanel.ResumeLayout();
     }
 }
Exemplo n.º 7
0
 ///<summary>Returns true if Update(DashboardCell,DashboardCell) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(DashboardCell dashboardCell, DashboardCell oldDashboardCell)
 {
     if (dashboardCell.DashboardLayoutNum != oldDashboardCell.DashboardLayoutNum)
     {
         return(true);
     }
     if (dashboardCell.CellRow != oldDashboardCell.CellRow)
     {
         return(true);
     }
     if (dashboardCell.CellColumn != oldDashboardCell.CellColumn)
     {
         return(true);
     }
     if (dashboardCell.CellType != oldDashboardCell.CellType)
     {
         return(true);
     }
     if (dashboardCell.CellSettings != oldDashboardCell.CellSettings)
     {
         return(true);
     }
     if (dashboardCell.LastQueryTime != oldDashboardCell.LastQueryTime)
     {
         return(true);
     }
     if (dashboardCell.LastQueryData != oldDashboardCell.LastQueryData)
     {
         return(true);
     }
     if (dashboardCell.RefreshRateSeconds != oldDashboardCell.RefreshRateSeconds)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 8
0
        ///<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;
        }
Exemplo n.º 9
0
        ///<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;
        }
Exemplo n.º 10
0
        ///<summary>Updates one DashboardCell in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
        public static bool Update(DashboardCell dashboardCell, DashboardCell oldDashboardCell)
        {
            string command = "";

            if (dashboardCell.DashboardLayoutNum != oldDashboardCell.DashboardLayoutNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DashboardLayoutNum = " + POut.Long(dashboardCell.DashboardLayoutNum) + "";
            }
            if (dashboardCell.CellRow != oldDashboardCell.CellRow)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CellRow = " + POut.Int(dashboardCell.CellRow) + "";
            }
            if (dashboardCell.CellColumn != oldDashboardCell.CellColumn)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CellColumn = " + POut.Int(dashboardCell.CellColumn) + "";
            }
            if (dashboardCell.CellType != oldDashboardCell.CellType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CellType = '" + POut.String(dashboardCell.CellType.ToString()) + "'";
            }
            if (dashboardCell.CellSettings != oldDashboardCell.CellSettings)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CellSettings = " + DbHelper.ParamChar + "paramCellSettings";
            }
            if (dashboardCell.LastQueryTime != oldDashboardCell.LastQueryTime)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LastQueryTime = " + POut.DateT(dashboardCell.LastQueryTime) + "";
            }
            if (dashboardCell.LastQueryData != oldDashboardCell.LastQueryData)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LastQueryData = " + DbHelper.ParamChar + "paramLastQueryData";
            }
            if (dashboardCell.RefreshRateSeconds != oldDashboardCell.RefreshRateSeconds)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RefreshRateSeconds = " + POut.Int(dashboardCell.RefreshRateSeconds) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (dashboardCell.CellSettings == null)
            {
                dashboardCell.CellSettings = "";
            }
            OdSqlParameter paramCellSettings = new OdSqlParameter("paramCellSettings", OdDbType.Text, POut.StringParam(dashboardCell.CellSettings));

            if (dashboardCell.LastQueryData == null)
            {
                dashboardCell.LastQueryData = "";
            }
            OdSqlParameter paramLastQueryData = new OdSqlParameter("paramLastQueryData", OdDbType.Text, POut.StringParam(dashboardCell.LastQueryData));

            command = "UPDATE dashboardcell SET " + command
                      + " WHERE DashboardCellNum = " + POut.Long(dashboardCell.DashboardCellNum);
            Db.NonQ(command, paramCellSettings, paramLastQueryData);
            return(true);
        }
Exemplo n.º 11
0
 ///<summary>Inserts one DashboardCell into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(DashboardCell dashboardCell)
 {
     return(InsertNoCache(dashboardCell, false));
 }