public void DeserializeFromJson(string json) { try { QuantityOverTimeGraphSettings settings = ODGraphSettingsBase.Deserialize <QuantityOverTimeGraphSettings>(json); this.QtyType = settings.QtyType; this.SeriesType = settings.SeriesType; this.GroupByType = settings.GroupByType; this.LegendDock = settings.LegendDock; this.BreakdownPref = settings.BreakdownPref; this.BreakdownVal = settings.BreakdownVal; this.GraphTitle = settings.Title; this.ChartSubTitle = settings.SubTitle; //Important that quick range is set last to prevent FilterData from firing multiple times. this.QuickRangePref = settings.QuickRangePref; //we should always recreate the dates so that they are current. Cache.DashboardFilter filter = ODGraphSettingsBase.GetDatesFromQuickRange(settings.QuickRangePref, settings.DateFrom, settings.DateTo); this.DateFrom = filter.DateFrom; this.DateTo = filter.DateTo; } catch (Exception e) { MessageBox.Show(e.Message); } }
public void DeserializeFromJson(string json) { try { if (string.IsNullOrEmpty(json)) { return; } switch (CellType) { case DashboardCellType.HQMoMessage: case DashboardCellType.HQSignups: case DashboardCellType.HQBillingInboundOutbound: return; } GraphQuantityOverTimeFilterSettings settings = ODGraphSettingsBase.Deserialize <GraphQuantityOverTimeFilterSettings>(json); switch (CellType) { case DashboardCellType.ProductionGraph: _productionOptionsCtrl.IncludeAdjustments = settings.IncludeAdjustements; _productionOptionsCtrl.IncludeCompletedProcs = settings.IncludeCompleteProcs; _productionOptionsCtrl.IncludeWriteoffs = settings.IncludeWriteoffs; this.CurGrouping = settings.CurGrouping; break; case DashboardCellType.IncomeGraph: _incomeOptionsCtrl.IncludePaySplits = settings.IncludePaySplits; _incomeOptionsCtrl.IncludeInsuranceClaimPayments = settings.IncludeInsuranceClaims; this.CurGrouping = settings.CurGrouping; break; case DashboardCellType.BrokenApptGraph: this.CurGrouping = settings.CurGrouping; _brokenApptsCtrl.CurRunFor = settings.CurRunFor; _brokenApptsCtrl.AdjTypeDefNumCur = settings.AdjTypeDefNum; _brokenApptsCtrl.BrokenApptCodeCur = settings.BrokenApptProcCode; break; case DashboardCellType.NewPatientsGraph: this.CurGrouping = settings.CurGrouping; break; case DashboardCellType.AccountsReceivableGraph: break; case DashboardCellType.HQMtMessage: _hqMsgRealTimeCtrl.CurHQGroup = settings.HQGrouping; return; case DashboardCellType.HQBillingUsageAccess: case DashboardCellType.HQPhone: case DashboardCellType.HQConfirmation: this.HQConfirmationGraphType = settings.HQConfirmationGraphType; break; case DashboardCellType.HQMoMessage: case DashboardCellType.HQSignups: case DashboardCellType.HQBillingInboundOutbound: return; default: throw new Exception("Unsupported CellType: " + CellType.ToString()); } } catch (Exception e) { #if DEBUG MessageBox.Show(e.Message); #else e.DoNothing(); #endif } }