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; }
public String ControlTypeName; //中文 public static void LoadButtonCoontrolTypeFromDatabaseToPublicClass() { CsConst.myDryGroupControlType = new List <DryControlType>(); string strsql = string.Format("select * from defGroupMemberType order by ID"); OleDbDataReader dr = DataModule.SearchAResultSQLDB(strsql, CsConst.mstrDefaultPath); if (dr != null) { while (dr.Read()) { DryControlType TmpButtonMode = new DryControlType(); TmpButtonMode.ControlTypeSaveID = (Byte)dr.GetInt32(0); if (CsConst.iLanguageId == 1) { TmpButtonMode.ControlTypeName = dr.GetString(1); } else { TmpButtonMode.ControlTypeName = dr.GetString(2); } CsConst.myDryGroupControlType.Add(TmpButtonMode); } dr.Close(); } }