public void InitializeScreen(STScreensInfo objScreensInfo) { this.SuspendLayout(); if (objScreensInfo != null) { ScreenInfo = objScreensInfo; ScreenID = objScreensInfo.STScreenID; ScreenCode = objScreensInfo.STScreenCode; ScreenID = objScreensInfo.STScreenID; ScreenName = objScreensInfo.STScreenName; ScreenCode = objScreensInfo.STScreenCode; Text = objScreensInfo.STScreenDesc; InitializeControls(this.Controls); this.ResumeLayout(false); this.PerformLayout(); } }
private void InitializeNewScreen(STScreensInfo objScreensInfo) { VinaERPScreen screen = VinaERPScreenFactory.GetScreen(this.CurrentModuleName, objScreensInfo.STScreenCode); if (screen == null) { return; } screen.Module = this; screen.ScreenInfo = objScreensInfo; screen.ScreenID = objScreensInfo.STScreenID; screen.Text = objScreensInfo.STScreenDesc; screen.InitializeScreen(objScreensInfo); Screens.Add(screen); InitializeScreenControls(screen); }
public virtual void InitializeScreens() { STScreensController objScreensController = new STScreensController(); DataSet dsScreens = objScreensController.GetAllDataByForeignColumn("FK_STModuleID", CurrentModuleID); if (dsScreens.Tables.Count > 0) { foreach (DataRow row in dsScreens.Tables[0].Rows) { STScreensInfo objSTScreensInfo = (STScreensInfo)objScreensController.GetObjectFromDataRow(row); if (!objSTScreensInfo.STScreenIsVisible) { return; } if (objSTScreensInfo.STScreenCode.StartsWith("DM") || objSTScreensInfo.STScreenCode.StartsWith("SM")) { InitializeNewScreen(objSTScreensInfo); } } } dsScreens.Dispose(); }
public IEnumerable GetScreenByModuleID(int iModuleID) { STModulesInfo objModule = (STModulesInfo) new STModulesController().GetObjectByID(iModuleID); List <STScreensInfo> lstScreens = new List <STScreensInfo>(); STScreensController ScreenCtrl = new STScreensController(); STFieldsController STFieldsCtrl = new STFieldsController(); STGridColumnsController STGridColumnCtrl = new STGridColumnsController(); STFieldColumnsController STFieldColumnCtrl = new STFieldColumnsController(); DataSet ds = GetScreenByModuleNameAndUserGroupName(objModule.STModuleName, AuthConfig.CurrenUserGroupInfo.ADUserGroupName); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count == 0) { ds = GetScreenByModuleNameAndUserGroupName(objModule.STModuleName, "ADMIN"); } Dictionary <STScreensInfo, Dictionary <STFieldsInfo, List <BusinessObject> > > dicControls = new Dictionary <STScreensInfo, Dictionary <STFieldsInfo, List <BusinessObject> > >(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { STScreensInfo objScreen = (STScreensInfo)ScreenCtrl.GetObjectFromDataRow(dr); lstScreens.Add(objScreen); } lstScreens.Sort((st1, st2) => st1.STScreenSortOrder.CompareTo(st2.STScreenSortOrder)); foreach (STScreensInfo item in lstScreens) { if (item.STScreenSortOrder >= 0) { ds = STFieldsCtrl.GetActiveFieldsByScreenIDAndUserGroupID(item.STScreenID, AuthConfig.CurrenUserGroupInfo.ADUserGroupID); Dictionary <STFieldsInfo, List <BusinessObject> > dicFields = new Dictionary <STFieldsInfo, List <BusinessObject> >(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { STFieldsInfo objField = (STFieldsInfo)STFieldsCtrl.GetObjectFromDataRow(dr); if (objField.STFieldType.EndsWith("GridControl")) { DataSet dsInfo = STGridColumnCtrl.GetAllDataByGridColumnAndUserIDOrderByTabIndex(objField.STFieldID, AuthConfig.CurrenUserInfo.ADUserID); if (!dicFields.ContainsKey(objField)) { dicFields.Add(objField, STGridColumnCtrl.GetListFromDataset(dsInfo)); } } else if (objField.STFieldType.EndsWith("LookupEdit")) { DataSet dsInfo = STFieldColumnCtrl.GetAllDataByForeignColumn("STFieldID", objField.STFieldID); if (!dicFields.ContainsKey(objField)) { dicFields.Add(objField, STFieldColumnCtrl.GetListFromDataset(dsInfo)); } } else if (!dicFields.ContainsKey(objField)) { dicFields.Add(objField, new List <BusinessObject>()); } } } if (!dicControls.ContainsKey(item)) { dicControls.Add(item, dicFields); } } } return(dicControls); } return(null); }