public IMVCController <TEntity> GetActiveController(ViewerName viewerName)
 {
     if (List_ChildrenControllers != null)
     {
         return(List_ChildrenControllers.Find(item => item.ActiveViewerName.Equals(viewerName)));
     }
     return(null);
 }
        public void InitializeCollector(IViewer viewer, ViewerName viewerName)
        {
            if (ActiveCollector == null)
            {
                ActiveCollector = (AbstractDataCollector <TEntity>)DataCollectorFactory.GetDataCollectorFactory <TEntity>(viewerName);
            }

            if (ActiveCollector != null)
            {
                ActiveCollector.ActiveViewer = viewer;
            }

            ActiveViewerName = viewerName;

            Collect(ActiveCollector);
        }
        public void InitializeBaseContainer(ViewerName viewerName, AbstractViewerType viewerType, string headerTitle,
                                            bool enableFullScreenButton, bool showNewButton, bool showPrintButton, bool showClearButton)
        {
            HeaderTitle               = headerTitle;
            ShowFullScreenButton      = enableFullScreenButton;
            lytNewButton.Visibility   = showNewButton ? LayoutVisibility.Always : LayoutVisibility.Never;
            lytClearButton.Visibility = showClearButton ? LayoutVisibility.Always : LayoutVisibility.Never;
            lytPrintButton.Visibility = showPrintButton ? LayoutVisibility.Always : LayoutVisibility.Never;
            ViewerName = viewerName;

            switch (viewerType)
            {
            case AbstractViewerType.EditorViewer:
                CommonViewsActions.ShowUserControl(ref BaseController <TEntity> .BasicEditorViewerContainer, pnlMain, true);
                BaseControllerObject.PassBaseController(BaseController <TEntity> .BasicEditorViewerContainer);
                break;

            case AbstractViewerType.SearchViewer:
                CommonViewsActions.ShowUserControl(ref BaseController <TEntity> ._baseSearchContainer, pnlMain, true);
                BaseControllerObject.PassBaseController(BaseController <TEntity> ._baseSearchContainer);
                break;
            }

            if (!string.IsNullOrEmpty(ApplicationStaticConfiguration.SkinName) &&
                !string.IsNullOrWhiteSpace(ApplicationStaticConfiguration.SkinName))
            {
                if (ApplicationStaticConfiguration.SkinName.Equals("McSkin"))
                {
                    btnClose.Image = Properties.Resources.ExitIcon_8;
                }
                else
                {
                    btnClose.Image = Properties.Resources.Exit_1_16;
                }
            }
            BringToFront();
        }
        public static void ShowControl <TEditorViewer, TSearchViewer>(ref TEditorViewer editorViewerToShow,
                                                                      ref TSearchViewer searchViewerToShow, Control parentControlToAttach, EditorContainerType editorContainerType, ViewerName viewerName,
                                                                      DB_CommonTransactionType commontransactionType,
                                                                      string headerTitle, AbstractViewerType viewerType, bool showAsPopup, bool showInFullScreen = false, bool isSearchPanelexpanded = false)
            where TEditorViewer : Control, new()
            where TSearchViewer : Control, new()
        {
            //1--- Initialize the BaseContainer
            //2--- Initialize the BaseSettingsEditorContainer / BaseSearchContainer
            //3--- Attach the BaseSettingsEditorContainer to BaseContainer
            //4--- Initialize the ViewerToShow
            //5--- Attach the ViewerToShow to BaseSettingsEditorContainer to Top Panel
            //6--- If the ViewerToShow has children Viewers, then >>
            //7--- If Yes :: Initialize Each Child in the ViewerToShow Children
            //8---			 Initialize The CommonTabControl
            //9---			 Create a Tab page for each viewerToShow child
            //10--			 Attach each Child to each suitable Tab page
            //11-- Attach the CommonTabControl to the BaseSettingsEditorContainer Bottom Panel
            //12-- Initialize the ViewerToShow MVCController
            //13-- Initialize the MVCController for Each Child in the ViewerToShow Children

            ParentControl         = parentControlToAttach;
            ViewerName            = viewerName;
            HeaderTitle           = headerTitle;
            CommontransactionType = commontransactionType;

            if (showAsPopup)
            {
                _popupForm = new PopupBaseForm();
                _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle, FormBorderStyle.None);
                CommonViewsActions.ShowUserControl(ref _baseContainer, _popupForm, true);
            }
            else
            {
                CommonViewsActions.ShowUserControl(ref _baseContainer, parentControlToAttach, true);
            }

            if (_baseContainer == null)
            {
                return;
            }

            if (!_baseContainer.IsBaseControllerInitialized)
            {
                BaseControllerObject = new BaseController <TEntity>();
                _baseContainer.InitializeBaseViewerController(BaseControllerObject);
            }

            _baseContainer.InitializeBaseContainer(ViewerName, viewerType, headerTitle, false, true, true, true);

            if (editorViewerToShow == null || editorViewerToShow.IsDisposed)
            {
                editorViewerToShow = new TEditorViewer();
            }
            if (searchViewerToShow == null || editorViewerToShow.IsDisposed)
            {
                searchViewerToShow = new TSearchViewer();
            }

            _baseContainer._editorViewerToShow = editorViewerToShow;

            EditorViewer = (IViewer)editorViewerToShow;
            SearchViewer = (IViewer)searchViewerToShow;

            if (EditorViewer != null)
            {
                EditorViewer.ClearControls();
                EditorViewer.FillControls();
            }

            if (SearchViewer != null)
            {
                SearchViewer.ClearControls();
                SearchViewer.FillControls();
            }

            switch (viewerType)
            {
            case AbstractViewerType.EditorViewer:
                MVCEditorController = GenerateEditorMVCController(EditorViewer, null, editorContainerType, viewerName, viewerType);
                break;

            case AbstractViewerType.SearchViewer:
                MVCSearchController = GenerateEditorMVCController(SearchViewer, null, editorContainerType, viewerName, viewerType);
                break;
            }

            switch (viewerType)
            {
            case AbstractViewerType.EditorViewer:
                if (_baseEditorContainer == null)
                {
                    return;
                }
                _baseEditorContainer._editorViewer         = (Control)EditorViewer;
                _baseEditorContainer.CommonTransactionType = CommontransactionType;
                if (BaseControllerObject != null)
                {
                    BaseControllerObject.PassMVCController(editorContainerType, viewerType);
                }
                _baseEditorContainer.InitializeBaseEditorContainer(true, false, false);
                break;

            case AbstractViewerType.SearchViewer:
                if (_baseSearchContainer == null)
                {
                    return;
                }
                _baseSearchContainer._searchViewer = (Control)SearchViewer;
                if (BaseControllerObject != null)
                {
                    BaseControllerObject.PassMVCController(editorContainerType, viewerType);
                }
                _baseSearchContainer.InitializeBaseSearchContainer(isSearchPanelexpanded);
                _baseSearchContainer.LoadGrid();
                break;
            }

            if (showAsPopup && _popupForm != null)
            {
                _popupForm.Show();
            }
        }
        private static MVCController <TEntity> GenerateEditorMVCController <TViewer>(TViewer viewerToShow, IDBCommon dbObjectToLoad,
                                                                                     EditorContainerType editorContainerType, ViewerName viewerName,
                                                                                     AbstractViewerType viewerType) where TViewer : IViewer
        {
            MVCEditorController =
                (MVCController <TEntity>)MVCControllerFactory.GetControllerFactory <TEntity>(viewerName, viewerToShow);

            switch (editorContainerType)
            {
            case EditorContainerType.Settings:
                if (MVCEditorController != null && BaseControllerObject != null && viewerType != AbstractViewerType.SearchViewer &&
                    (_baseEditorContainer != null || _baseSearchContainer != null))
                {
                    MVCEditorController.BeforeCreatingNew();
                    MVCEditorController.CreateNew();
                    MVCEditorController.AfterCreateNew();
                }

                break;

            case EditorContainerType.Regular:
                if (MVCEditorController != null)
                {
                    if (dbObjectToLoad != null)
                    {
                        MVCEditorController.BeforeEdit(dbObjectToLoad);
                        MVCEditorController.Edit(dbObjectToLoad);
                        MVCEditorController.AfterEdit(dbObjectToLoad);
                    }
                    else
                    {
                        MVCEditorController.BeforeCreatingNew();
                        MVCEditorController.CreateNew();
                        if (MVCEditorController.ActiveCollector.ActiveDBItem is TEntity)
                        {
                            ActiveDBEntity = (TEntity)MVCEditorController.ActiveCollector.ActiveDBItem;
                        }
                        MVCEditorController.AfterCreateNew();
                    }
                }

                break;
            }

            return(MVCEditorController);
        }
        private static MVCController <TEntity> GenerateSearchMVCController <TViewer>(TViewer viewerToShow, ViewerName viewerName,
                                                                                     AbstractViewerType viewerType) where TViewer : IViewer
        {
            MVCSearchController =
                (MVCController <TEntity>)MVCControllerFactory.GetControllerFactory <TEntity>(viewerName, viewerToShow);

            return(MVCSearchController);
        }
        public static void ShowSearchControl <TSearchViewer>(ref TSearchViewer searchViewerToShow,
                                                             Control parentControlToAttach, ViewerName viewerName, DB_CommonTransactionType commontransactionType,
                                                             string headerTitle, bool showAsPopup, bool isSearchPanelexpanded = false)
            where TSearchViewer : Control, new()
        {
            ParentControl         = parentControlToAttach;
            ViewerName            = viewerName;
            HeaderTitle           = headerTitle;
            CommontransactionType = commontransactionType;

            if (showAsPopup)
            {
                _popupForm = new PopupBaseForm();
                _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle, FormBorderStyle.None);
                CommonViewsActions.ShowUserControl(ref _baseContainer, _popupForm, true);
            }
            else
            {
                CommonViewsActions.ShowUserControl(ref _baseContainer, parentControlToAttach, true);
            }

            if (_baseContainer == null)
            {
                return;
            }

            if (!_baseContainer.IsBaseControllerInitialized)
            {
                BaseControllerObject = new BaseController <TEntity>();
                _baseContainer.InitializeBaseViewerController(BaseControllerObject);
            }

            _baseContainer.InitializeBaseContainer(ViewerName, AbstractViewerType.SearchViewer, headerTitle, true, false, true,
                                                   true);

            if (searchViewerToShow == null || searchViewerToShow.IsDisposed)
            {
                searchViewerToShow = new TSearchViewer();
            }

            SearchViewer = (IViewer)searchViewerToShow;

            if (SearchViewer != null)
            {
                SearchViewer.ClearControls();
                SearchViewer.FillControls();
            }

            MVCSearchController = GenerateSearchMVCController(SearchViewer, viewerName, AbstractViewerType.SearchViewer);

            if (_baseSearchContainer == null)
            {
                return;
            }
            _baseSearchContainer._searchViewer = (Control)SearchViewer;
            if (BaseControllerObject != null)
            {
                BaseControllerObject.PassMVCController(EditorContainerType.Settings, AbstractViewerType.SearchViewer);
            }
            _baseSearchContainer.InitializeBaseSearchContainer(isSearchPanelexpanded);
            _baseSearchContainer.LoadGrid();

            if (showAsPopup && _popupForm != null)
            {
                _popupForm.Show();
            }
        }
        public static void ShowEditorControl <TEditorViewer>(ref TEditorViewer editorViewerToShow,
                                                             Control parentControlToAttach, object objectToPassToViewer, IDBCommon dbObjectToLoad, EditorContainerType editorContainerType,
                                                             ViewerName viewerName,
                                                             DB_CommonTransactionType commontransactionType,
                                                             string headerTitle, bool showAsPopup, bool showTopMost = false,
                                                             bool showInFullScreen = true)
            where TEditorViewer : Control, new()
        {
            ParentControl         = parentControlToAttach;
            ViewerName            = viewerName;
            HeaderTitle           = headerTitle;
            CommontransactionType = commontransactionType;

            switch (editorContainerType)
            {
            case EditorContainerType.Settings:
                if (showAsPopup)
                {
                    _popupForm = new PopupBaseForm();
                    _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle);
                    CommonViewsActions.ShowUserControl(ref _baseContainer, _popupForm, true);
                }
                else
                {
                    CommonViewsActions.ShowUserControl(ref _baseContainer, parentControlToAttach, true);
                }

                if (_baseContainer == null)
                {
                    return;
                }

                if (!_baseContainer.IsBaseControllerInitialized)
                {
                    BaseControllerObject = new BaseController <TEntity>();
                    _baseContainer.InitializeBaseViewerController(BaseControllerObject);
                }
                _baseContainer.InitializeBaseContainer(ViewerName, AbstractViewerType.EditorViewer, headerTitle, false, true, true,
                                                       true);
                break;

            case EditorContainerType.Regular:
                if (showAsPopup)
                {
                    _popupForm = new PopupBaseForm();
                    if (showInFullScreen)
                    {
                        _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle, FormBorderStyle.None);
                    }
                    else
                    {
                        _popupForm.InitializePopupBaseForm(FormWindowState.Normal, false, headerTitle, FormBorderStyle.None);
                    }
                    CommonViewsActions.ShowUserControl(ref BasicEditorViewerContainer, _popupForm, true);
                }

                if (BasicEditorViewerContainer == null)
                {
                    return;
                }

                BasicEditorViewerContainer.SetHeader(headerTitle, commontransactionType);
                if (!BasicEditorViewerContainer.IsBaseControllerInitialized)
                {
                    BaseControllerObject = new BaseController <TEntity>();
                }
                BasicEditorViewerContainer.InitializeBaseEditorContainer(ViewerName, HeaderTitle);
                BaseControllerObject.PassBaseController(BasicEditorViewerContainer);
                break;
            }

            if (editorViewerToShow == null || editorViewerToShow.IsDisposed)
            {
                editorViewerToShow = new TEditorViewer();
            }

            EditorViewer = (IViewer)editorViewerToShow;

            if (EditorViewer != null)
            {
                if (objectToPassToViewer != null && EditorViewer is IViewerDataRelated)
                {
                    ((IViewerDataRelated)EditorViewer).ViewerDataRelated = objectToPassToViewer;
                }

                EditorViewer.ClearControls();
                EditorViewer.FillControls();
            }

            MVCEditorController = GenerateEditorMVCController(EditorViewer, dbObjectToLoad, editorContainerType, viewerName,
                                                              AbstractViewerType.EditorViewer);

            switch (editorContainerType)
            {
            case EditorContainerType.Settings:
                if (_baseEditorContainer == null)
                {
                    return;
                }
                _baseEditorContainer._editorViewer         = (Control)EditorViewer;
                _baseEditorContainer.CommonTransactionType = CommontransactionType;
                break;

            case EditorContainerType.Regular:
                BaseEditorViewerContainer <TEntity> ._editorViewer = (Control)EditorViewer;
                BasicEditorViewerContainer.CommonTransactionType   = CommontransactionType;
                break;
            }

            if (BaseControllerObject != null)
            {
                BaseControllerObject.PassMVCController(editorContainerType, AbstractViewerType.EditorViewer);
            }

            switch (editorContainerType)
            {
            case EditorContainerType.Settings:
                _baseEditorContainer.InitializeBaseEditorContainer(true, false, false);
                break;

            case EditorContainerType.Regular:
                BasicEditorViewerContainer.InitializeBaseEditorContainer();
                break;
            }

            if (showAsPopup && _popupForm != null)
            {
                _popupForm.Initialize((Control)EditorViewer, BasicEditorViewerContainer);
                _popupForm.TopMost = showTopMost;
                _popupForm.BringToFront();
                _popupForm.ShowDialog();
            }
        }
 public MVCController(IViewer viewer, ViewerName viewerName)
 {
     InitializeCollector(viewer, viewerName);
 }
        public XtraTabControl InitializeCommonTabControl(Control viewer,
                                                         string pageHeaderTitle, int tabIndex, bool isPageEnabled, bool isPageVisible, ViewerName viewerName,
                                                         DefaultBoolean showCloseButton = DefaultBoolean.False, BorderStyle borderStyle = BorderStyle.None,
                                                         DockStyle dockStyle            = DockStyle.Fill)
        {
            XtraTabPage tabPage = CommonViewsActions.CreateTabPageControl(mainTab, pageHeaderTitle, tabIndex, "Office 2010 Black",
                                                                          isPageEnabled,
                                                                          isPageVisible,
                                                                          showCloseButton, borderStyle, dockStyle);

            tabPage.Dock              = DockStyle.Fill;
            _baseEditorContainer      = new BaseEditorViewerContainer <TEntity>(BaseController);
            _baseEditorContainer.Dock = DockStyle.Fill;
            _baseEditorContainer.InitalizeContainer(viewer, false, true);
            _baseContainer = BaseController.InitiaizeBaseContainer(_baseEditorContainer, pageHeaderTitle, false, false);

            tabPage.Controls.Add(_baseContainer);
            mainTab.TabPages.Add(tabPage);

            return(mainTab);
        }
        public static IMVCDataCollector <TEntity> GetDataCollectorFactory <TEntity>(ViewerName viewerName)
            where TEntity : DBCommon, IDBCommon, new()
        {
            switch (viewerName)
            {
            case ViewerName.FloorViewer:
                return(new Floor_DataCollector <TEntity>());

            case ViewerName.InPatientRoomViewer:
                return(new InPatientRoomDataCollector <TEntity>());

            case ViewerName.InPatientRoomBedViewer:
                return(new InPatientRoomBedDataCollector <TEntity>());

            case ViewerName.InPatientRoomClassificationViewer:
                return(new InPatientRoomClassificationDataCollector <TEntity>());

            case ViewerName.PatientViewer:
                return(new PatientDataCollector <TEntity>());

            case ViewerName.PatientInvoiceCreation:
                return(new MedicalAdmissionInvoiceCreation_DataCollector <TEntity>());

            case ViewerName.InvoicePayment_Viewer:
                return(new InvoicePaymentDataCollector <TEntity>());

            case ViewerName.InsurancePolicy_Viewer:
                return(new InsurancePolicyDataCollector <TEntity>());

            case ViewerName.User_Viewer:
                return(new User_DataCollector <TEntity>());

            case ViewerName.UserGroup_Viewer:
                return(new UserGroup_DataCollector <TEntity>());

            case ViewerName.User_UserGroup_Viewer:
                return(new User_UserGroup_DataCollector <TEntity>());

            case ViewerName.UserGroup_Application_Viewer:
                return(new UserGroup_Application_DataCollector <TEntity>());

            case ViewerName.User_Application_Viewer:
                return(new User_Application_DataCollector <TEntity>());

            case ViewerName.RoleRegistration_Viewer:
                return(new RoleRegistration_DataCollector <TEntity>());

            case ViewerName.ServiceCategory_Viewer:
                return(new ServiceCategory_DataCollector <TEntity>());

            case ViewerName.Service_Viewer:
                return(new Service_DataCollector <TEntity>());

            case ViewerName.ServicePrice_Viewer:
                return(new ServicePrice_DataCollector <TEntity>());

            case ViewerName.StationPoint_Viewer:
                return(new StationPoint_DataCollector <TEntity>());

            case ViewerName.StationPointStage_Viewer:
                return(new StationPointStage_DataCollector <TEntity>());

            case ViewerName.ServiceType_StationPoint_Viewer:
                return(new ServiceType_StationPoint_DataCollector <TEntity>());

            case ViewerName.ServiceCategory_StationPoint_Viewer:
                return(new ServiceCategory_StationPoint_DataCollector <TEntity>());

            case ViewerName.Service_StationPoint_Viewer:
                return(new Service_StationPointData_Collector <TEntity>());

            case ViewerName.InventoryHousing_Viewer:
                return(new InventoryHousing_DataCollector <TEntity>());

            case ViewerName.Location_Viewer:
                return(new Location_DataCollector <TEntity>());

            case ViewerName.InventoryItemCategory_Viewer:
                return(new InventoryItemCategory_DataCollector <TEntity>());

            case ViewerName.InventoryItemBrand_Viewer:
                return(new InventoryItemBrand_DataCollector <TEntity>());

            case ViewerName.InventoryItemGroup_Viewer:
                return(new InventoryItemGroup_DataCollector <TEntity>());

            case ViewerName.UnitMeasurment_Viewer:
                return(new UnitMeasurment_DataCollector <TEntity>());

            case ViewerName.UnitMeasurmentTreeLink_Viewer:
                return(new UnitMeasurmentTreeLink_DataCollector <TEntity>());

            case ViewerName.InventoryItem_Viewer:
                return(new InventoryItem_DataCollector <TEntity>());

            case ViewerName.InventoryItem_UnitMeasurment_Viewer:
                return(new InventoryItem_UnitMeasurment_DataCollector <TEntity>());

            case ViewerName.Customer_Viewer:
                return(new Customer_DataCollector <TEntity>());

            case ViewerName.Supplier_Viewer:
                return(new Supplier_DataCollector <TEntity>());

            case ViewerName.InventoryItemPrice_Viewer:
                return(new InventoryItemPrice_DataCollector <TEntity>());

            case ViewerName.InventoryItem_InventoryHousing_Viewer:
                return(new InventoryItem_InventoryHousing_DataCollector <TEntity>());

            case ViewerName.Doctor_Viewer:
                return(new Doctor_DataCollector <TEntity>());

            case ViewerName.FinanceInvoiceCreation_Viewer:
                return(new FinanceInvoiceCreationDataCollector <TEntity>());

            case ViewerName.CustomerFinanceInvoicesReport_Viewer:
                return(new CustomerFinanceInvoice_Report_DataCollector <TEntity>());

            case ViewerName.ChartOfAccountViewer:
                return(new ChartOfAccount_DataCollector <TEntity>());

            case ViewerName.CashBoxViewer:
                return(new CashBox_DataCollector <TEntity>());

            case ViewerName.GeneralChartOfAccountType_Viewer:
                return(new GeneralChartOfAccountType_DataCollector <TEntity>());

            case ViewerName.CashBoxTransactionType_GeneralChartOfAccountType_Viewer:
                return(new CashBoxTransactionType_GeneralChartOfAccountType_DataCollector <TEntity>());

            case ViewerName.InvoicePaymentBrief_Report_Viewer:
                return(new InvoicePaymentBrief_Report_DataCollector <TEntity>());

            case ViewerName.TotalServiceAndDoctorRevenues_Report_Viewer:
                return(new TotalServiceAndDoctorRevenue_Report_DataCollector <TEntity>());

            case ViewerName.PatientDepositBalance_Report_Viewer:
                return(new PatientDepositBalance_Report_DataCollector <TEntity>());

            case ViewerName.Bank_Viewer:
                return(new Bank_DataCollector <TEntity>());

            case ViewerName.BankAccount_Viewer:
                return(new BankAccount_DataCollector <TEntity>());

            case ViewerName.PersonType_ChartOfAccount_Viewer:
                return(new PersonType_ChartOfAccount_DataCollector <TEntity>());

            case ViewerName.Person_ChartOfAccount_Viewer:
                return(new Person_ChartOfAccount_DataCollector <TEntity>());

            case ViewerName.MedicationCategory_Viewer:
                return(new MedicationCategory_DataCollector <TEntity>());

            case ViewerName.DoctorCategory_Viewer:
                return(new DoctorCategory_DataCollector <TEntity>());

            case ViewerName.Medication_Viewer:
                return(new Medication_DataCollector <TEntity>());

            case ViewerName.OrganizationMachine_viewer:
                return(new OrganizationMachine_DataCollector <TEntity>());

            case ViewerName.Dose_Viewer:
                return(new Dose_DataCollector <TEntity>());

            case ViewerName.Medication_Dose_Viewer:
                return(new Medication_Dose_DataCollector <TEntity>());

            case ViewerName.DiagnosisCategory_Viewer:
                return(new DiagnosisCategory_DataCollector <TEntity>());

            case ViewerName.Diagnosis_Viewer:
                return(new Diagnosis_DataCollector <TEntity>());

            case ViewerName.DiagnosisCategory_Diagnosis_Viewer:
                return(new DiagnosisCategory_Diagnosis_DataCollector <TEntity>());

            case ViewerName.InventoryItem_Area_Viewer:
                return(new InventoryItem_Area_DataCollector <TEntity>());

            case ViewerName.InventoryItemGroup_InventoryItem_Viewer:
                return(new InventoryItemGroup_InventoryItem_DataCollector <TEntity>());

            case ViewerName.RawMaterial_viewer:
                return(new RawMaterial_DataCollector <TEntity>());

            case ViewerName.Color_Viewer:
                return(new Color_DataCollector <TEntity>());

            case ViewerName.RawMaterialTransactions_viewer:
                return(new RawMaterialTransaction_DataCollector <TEntity>());

            case ViewerName.GetRawMaterialCostPrices_Viewer:
                return(new GetRawMaterialCostPrices_Report_DataCollecor <TEntity>());

            case ViewerName.GetInventoryItemAreaParts_Viewer:
                return(new GetInventoryItemAreaParts_DataCollector <TEntity>());

            case ViewerName.InventoryItem_Printing_Viewer:
                return(new InventoryItem_Printing_DataCollector <TEntity>());

            case ViewerName.InventoryItem_RawMaterial_Viewer:
                return(new InventoryItem_RawMaterial_DataCollector <TEntity>());

            case ViewerName.GetInventoryItemCostsDetails_Viewer:
                return(new GetInventoryItemCostsDetails_Report_DataCollector <TEntity>());

            case ViewerName.FinanceDailyTransaction_Viewer:
                return(new FinanceDailyTransaction_DataCollector <TEntity>());

            case ViewerName.CashBoxInOutTrasactionViewer:
                return(new CashBoxInOutTransaction_DataCollector <TEntity>());
            }

            return(null);
        }
 public static IMVCControllerFactory GetControllerFactory <TEntity>(ViewerName viewerName, IViewer viewer)
     where TEntity : DBCommon, IDBCommon, new()
 {
     return(new MVCController <TEntity>(viewer, viewerName));
 }
 public void InitializeBaseEditorContainer(ViewerName viewerName, string headerTitle)
 {
     CommonViewsActions.ShowUserControl(ref _editorViewer, pnlMain, true);
     BringToFront();
 }