/// <summary>
 /// Initializes a new instance of the <see cref="EcommerceViewModel" /> class.
 /// </summary>
 /// <param name="fromTime">From time.</param>
 public EcommerceViewModel(DateTime fromTime)
 {
     localSql           = new SqlService();
     DashboardViewModel = new EcommerceDashboardViewModel(localSql, fromTime);
     DashboardViewModel.ViewRecordsClicked += DashboardViewModel_ViewRecordsClicked;
     SelectedTab = 0;
 }
        /// <summary>
        /// Loads the data.
        /// </summary>
        private void LoadData()
        {
            switch (SelectedTab)
            {
            default:
                if (DashboardViewModel == null)
                {
                    DashboardViewModel = new EcommerceDashboardViewModel(localSql);
                    DashboardViewModel.ViewRecordsClicked += DashboardViewModel_ViewRecordsClicked;
                }
                break;

            case 1:
                if (ReportViewModel == null)
                {
                    ReportViewModel = new EcommerceReportViewModel(localSql);
                }
                break;
            }
        }