private void loadUserControl(string tag) { //panelMain.SuspendLayout(); #region Quotation Group if (tag == "quotation") { // quotation = new ucQuotation(); this.clearControl(); panelMain.Controls.Add(quotation); quotation.menuClick += new EventHandler(quotation_menuClick); quotation.setClick += new EventHandler(quotation_setClick); quotation.commonClick += new EventHandler(quotation_commonClick); quotation.modifyClick += new EventHandler(quotation_modifyClick); } if (tag == "ringi") { //waitRingi = new ucWaitForRingi(); this.clearControl(); panelMain.Controls.Add(waitRingi); waitRingi.toRingiEvent += new EventHandler(waitRingi_toRingiEvent); } if (tag == "fac") { //fixedAssetCode = new ucFac(); this.clearControl(); panelMain.Controls.Add(fac); } if (tag == "issuepo") { //issuePo = new ucIssuePo(); this.clearControl(); panelMain.Controls.Add(issuepo); } if (tag == "instock") { //inStock = new ucInStock(); instock3 = new ucInStock3(); this.clearControl(); //panelMain.Controls.Add(instock); //panelMain.Controls.Add(instock2); panelMain.Controls.Add(instock3); } if (tag == "pocancel") { //cancelPo = new ucPoCancel(); this.clearControl(); panelMain.Controls.Add(pocancel); } if (tag == "mouldviewer") { //relationSet = new ucRelationshipSet(); this.clearControl(); panelMain.Controls.Add(mouldviewer); } if (tag == "customview") { //customView = new ucCustomView(); this.clearControl(); panelMain.Controls.Add(customview); } if (tag == "onholdfac") { //facList = new ucFacList(); this.clearControl(); panelMain.Controls.Add(faconhold); } if (tag == "expensetransfer") { this.clearControl(); panelMain.Controls.Add(expensetransfer); } if (tag == "test") { this.clearControl(); test.Dock = DockStyle.Fill; panelMain.Controls.Add(test); } if (tag == "approval") { this.clearControl(); app.Dock = DockStyle.Fill; panelMain.Controls.Add(app); } if (tag == "cnview") { this.clearControl(); cnview.Dock = DockStyle.Fill; panelMain.Controls.Add(cnview); } #endregion #region Transfer Group if (tag == "transfervendor") { //transferVendor = new ucTransferVendor(); transferVendor = new ucTransferVendor2(); this.clearControl(); panelMain.Controls.Add(transferVendor); } if (tag == "transferowner") { transferOwner = new ucTransferOwner(); this.clearControl(); panelMain.Controls.Add(transferOwner); } if (tag == "transferhistory") { transferHistory = new ucTransferHistory(); this.clearControl(); panelMain.Controls.Add(transferHistory); } if (tag == "transferonhold") { transferHold = new ucTransferHold(); this.clearControl(); panelMain.Controls.Add(transferHold); } #endregion #region Disposal Group if (tag == "disposalhistory") { disposalHistory = new ucDisposalHistory(); this.clearControl(); panelMain.Controls.Add(disposalHistory); } if (tag == "disposalrequest") { //disposalRequest = new ucDisposalRequest(); disposalView = new ucDisposalView(); this.clearControl(); disposalView.Dock = DockStyle.Fill; panelMain.Controls.Add(disposalView); } if (tag == "disposalprocess") { disposalProcess = new ucDisposal(); this.clearControl(); panelMain.Controls.Add(disposalProcess); } if (tag == "disposalconfirm") { disposalConfirm = new ucDisposalConfirm(); this.clearControl(); panelMain.Controls.Add(disposalConfirm); } #endregion #region File Group if (tag == "r3ulfile") { fileUl = new ucFileUL(); this.clearControl(); panelMain.Controls.Add(fileUl); } if (tag == "kdcfile") { fileKdc = new ucFileKdc(); this.clearControl(); panelMain.Controls.Add(fileKdc); } #endregion #region Reporting Group if (tag == "cdreport") { cdReport = new ucCdReport(); this.clearControl(); panelMain.Controls.Add(cdReport); } if (tag == "modifycheck") { modifyCheck = new ucModifyCheck(); this.clearControl(); panelMain.Controls.Add(modifyCheck); } if (tag == "paymentlist") { paymentList = new ucPaymentList(); this.clearControl(); panelMain.Controls.Add(paymentList); } if (tag == "pocollection") { poCollection = new ucPoCollection(); this.clearControl(); panelMain.Controls.Add(poCollection); } if (tag == "disposalreport") { disposalReport = new ucDisposalReport(); this.clearControl(); panelMain.Controls.Add(disposalReport); } if (tag == "vnonly") { vnOnlyReport = new ucVnOnly(); this.clearControl(); panelMain.Controls.Add(vnOnlyReport); } if (tag == "cnvnonly") { cnVnOnlyReport = new ucCnVnOnly(); this.clearControl(); panelMain.Controls.Add(cnVnOnlyReport); } if (tag == "modelreport") { modelReport = new ucModelReport(); this.clearControl(); modelReport.Dock = DockStyle.Fill; panelMain.Controls.Add(modelReport); } #endregion #region Data Group if (tag == "ringimaster") { masterRingi = new ucMasterRingi(); this.clearControl(); panelMain.Controls.Add(masterRingi); } if (tag == "mouldcodemaster") { masterMouldCode = new ucMasterMouldCode(); this.clearControl(); panelMain.Controls.Add(masterMouldCode); } if (tag == "vendormaster") { masterVendor = new ucMasterVendor(); this.clearControl(); panelMain.Controls.Add(masterVendor); } if (tag == "ringidetail") { masterRingiDetail = new ucMasterRingiDetail(); this.clearControl(); panelMain.Controls.Add(masterRingiDetail); } if (tag == "oem") { masterOem = new ucMasterOem(); this.clearControl(); panelMain.Controls.Add(masterOem); } if (tag == "modeldetail") { masterMouldDetail = new ucMasterModelDetail(); this.clearControl(); masterMouldDetail.Dock = DockStyle.Fill; panelMain.Controls.Add(masterMouldDetail); } if (tag == "mouldcost") { masterMouldCost = new ucMasterCost(); this.clearControl(); masterMouldCost.Dock = DockStyle.Fill; panelMain.Controls.Add(masterMouldCost); } #endregion #region Setting Group if (tag == "currency") { settingCurrency = new ucCurrency(); this.clearControl(); panelMain.Controls.Add(settingCurrency); } if (tag == "directory") { settingDirectory = new ucDirectory(); this.clearControl(); panelMain.Controls.Add(settingDirectory); } if (tag == "systemlog") { settingLog = new ucSystemLog(); this.clearControl(); panelMain.Controls.Add(settingLog); } if (tag == "jpymonth") { settingJpy = new ucJpyMonthly(); this.clearControl(); panelMain.Controls.Add(settingJpy); } if (tag == "criteria") { settingCriteria = new ucCriteria(); this.clearControl(); panelMain.Controls.Add(settingCriteria); } #endregion //panelMain.ResumeLayout(true); }
//End TrungTT public static ucModule CreateModuleInstance(ModuleInfo moduleInfo) { ucModule ucModule = null; switch (moduleInfo.ModuleType) { case CODES.DEFMOD.MODTYPE.STATICMODULE: switch (moduleInfo.ModuleID) { case STATICMODULE.GENERATE_MODULE_PACKAGE: ucModule = new ucGeneratePackage(); break; case STATICMODULE.INSTALL_MODULE_PACKAGE: ucModule = new ucInstallPackage(); break; case STATICMODULE.IEMODULE: ucModule = new ucIEModule(); break; case STATICMODULE.LOGIN_MODULE: ucModule = new ucLogin(); break; case STATICMODULE.EDITLANG: ucModule = new ucEditLanguage(); break; case STATICMODULE.USER_ROLE_MODULE: ucModule = new ucUserRoleSetup(); break; case STATICMODULE.GROUP_ROLE_MODULE: ucModule = new ucGroupRoleSetup(); break; case STATICMODULE.SYSTEM_LOG_VIEW: ucModule = new ucSystemLog(); break; case STATICMODULE.FIELD_MAKER: ucModule = new ucModuleFieldMaker(); break; case STATICMODULE.VIEW_DATA_FLOW: ucModule = new ucShowDataFlow(); break; case STATICMODULE.SQL_MODEL_DESIGNER: ucModule = new ucSQLModel(); break; case STATICMODULE.UPFILE_MODULE: ucModule = new ucUploadFile(); break; //TUDQ them case STATICMODULE.COLUMNEXPORT: ucModule = new ucColumnExport(); break; //END } break; case CODES.DEFMOD.MODTYPE.SEARCHMASTER: switch (moduleInfo.SubModule) { case CODES.DEFMOD.SUBMOD.MODULE_MAIN: ucModule = new ucSearchMaster(); break; case CODES.DEFMOD.SUBMOD.SEARCH_EXPORT: ucModule = new ucSearchExport(); break; } break; case CODES.DEFMOD.MODTYPE.MODCHART: //ucModule = new ucChartMaster(); ucModule = new ucChartManager(); break; case CODES.DEFMOD.MODTYPE.MAINTAIN: ucModule = new ucMaintain(); break; //TUDQ them case CODES.DEFMOD.MODTYPE.TREEVIEW: ucModule = new ucTreeView(); break; case CODES.DEFMOD.MODTYPE.EXPESSION: ucModule = new ucExpression(); break; case CODES.DEFMOD.MODTYPE.TRANS: ucModule = new ucApproveImport(); break; //End case CODES.DEFMOD.MODTYPE.STOREEXECUTE: ucModule = new ucStoreExecute(); break; case CODES.DEFMOD.MODTYPE.SWITCHMODULE: ucModule = new ucSwitchModule(); break; case CODES.DEFMOD.MODTYPE.IMPORTMASTER: ucModule = new ucIMWizard(); break; case CODES.DEFMOD.MODTYPE.ALERTMASTER: ucModule = new ucAlertMaster(); break; case CODES.DEFMOD.MODTYPE.BATCHPROCESS: ucModule = new ucBatchProcess(); break; //edit by TrungTT - 3.2.2012 - Export Statistic case CODES.DEFMOD.MODTYPE.STATISTICSMASTER: switch (moduleInfo.SubModule) { case CODES.DEFMOD.SUBMOD.MODULE_MAIN: ucModule = new ucStatisticsMaster(); break; case CODES.DEFMOD.SUBMOD.SEARCH_EXPORT: ucModule = new ucSearchExport(); break; case CODES.DEFMOD.SUBMOD.SEND_MAIL: ucModule = new ucSendMail(); break; } break; //ADD BY TRUNGTT - 5.5.2011 - ADD MODULE REPORT case CODES.DEFMOD.MODTYPE.REPORTMASTER: ucModule = new ucReportMaster(); break; //END TRUNGTT } if (ucModule != null) { ucModule.InitializeModuleInfo(moduleInfo); } return(ucModule); }