public String ControlTypeName; //中文 public static void LoadButtonCoontrolTypeFromDatabaseToPublicClass() { CsConst.myPublicControlType = new List <ButtonControlType>(); string strsql = string.Format("select * from defKeyFunType order by KeyFunType"); OleDbDataReader dr = DataModule.SearchAResultSQLDB(strsql, CsConst.mstrDefaultPath); if (dr != null) { while (dr.Read()) { ButtonControlType TmpButtonMode = new ButtonControlType(); TmpButtonMode.ControlTypeSaveID = (Byte)dr.GetInt16(0); if (CsConst.iLanguageId == 0) // { TmpButtonMode.ControlTypeName = dr.GetString(2); } else { TmpButtonMode.ControlTypeName = dr.GetString(1); } CsConst.myPublicControlType.Add(TmpButtonMode); } dr.Close(); } }
private void frmMain_Load(object sender, EventArgs e) { backgroundWorker1.WorkerReportsProgress = true; backgroundWorker1.WorkerSupportsCancellation = true; CsConst.mstrDefaultPath = Application.StartupPath + @"\Database\Easy_Design.mdb"; LoadControlsText.LoadButtonCoontrolTypeFromDatabaseToPublicClass(); HDLSysPF.GetWeekdaysFromPublicStruct(); //LoadControlsText.CheckAndLoadControlsNew(); LoadControlsText.LoadControlsTextIdListFromXML(); LoadControlsText.DisplayTextToFormWhenFirstShow(this); CsConst.mstrINIDefault = new IniFile(Application.StartupPath + @"\ini\LAN0.ini"); ButtonMode.LoadButtonModeFromDatabaseToPublicClass(); DryMode.LoadButtonModeFromDatabaseToPublicClass(); ButtonControlType.LoadButtonCoontrolTypeFromDatabaseToPublicClass(); DryControlType.LoadButtonCoontrolTypeFromDatabaseToPublicClass(); DeviceTypeList.LoadButtonCoontrolTypeFromDatabaseToPublicClass(); ControlTemplates.ReadAllGroupCommandsFrmDatabase(); HDLSysPF.AutoScale((Form)sender); HDLSysPF.AddedDevicesIndexToAPublicListInt(); GetDeviceList(); // dgOnline.RowCount = 28; }