- Timestamp:
- Jul 8, 2010, 8:46:18 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
r824 r843 34 34 private string m_Encoding=""; 35 35 36 //Data Access Layer 37 private DAL _dal = null; 38 36 39 //M Connection member variables 37 40 private DataSet m_dsGlobal = null; … … 177 180 } 178 181 182 public DAL DAL 183 { 184 get { return this._dal; } 185 } 186 179 187 180 188 #endregion … … 206 214 private void InitializeComponent() 207 215 { 208 //209 // CGDocumentManager210 //211 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);212 this.ClientSize = new System.Drawing.Size(292, 266);213 this.Name = "CGDocumentManager";214 215 216 } 216 217 … … 231 232 { 232 233 m_ConnectInfo = new BMXNetConnectInfo(m_Encoding); // Encoding is "" unless passed in command line 234 _dal = new DAL(m_ConnectInfo); // Data access layer 233 235 //m_ConnectInfo.bmxNetLib.StartLog(); //This line turns on logging of messages 234 236 CDocMgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(CDocMgrEventHandler); … … 321 323 m_ds.SetStatus("Getting Version Info..."); 322 324 m_ds.Refresh(); 323 String sCmd = "BMX VERSION INFO^BSDX^"; 324 this.m_ConnectInfo.RPMSDataTable(sCmd, "VersionInfo", m_dsGlobal); 325 326 //Keep the following commented code for future use: 325 326 DataTable ver = _dal.GetVersion("BSDX"); //sCmd, "VersionInfo", m_dsGlobal); 327 ver.TableName = "VersionInfo"; 328 m_dsGlobal.Tables.Add(ver); 329 330 //Keep the following commented code for future use: 327 331 //How to extract the version numbers: 328 332 //DataTable dtVersion = m_dsGlobal.Tables["VersionInfo"]; … … 435 439 } 436 440 437 public void LoadAccessTypesTable()438 {439 string sCommandText = "SELECT * FROM BSDX_ACCESS_TYPE";440 ConnectInfo.RPMSDataTable(sCommandText, "AccessTypes", m_dsGlobal);441 Debug.Write("LoadGlobalRecordsets -- AccessTypes loaded\n");442 }443 441 444 442 public void LoadAccessGroupsTable() … … 455 453 Debug.Write("LoadGlobalRecordsets -- AccessGroupTypes loaded\n"); 456 454 } 457 458 //TODO:REMOVE THIS459 /*public void LoadClinicSetupTable()460 {461 string sCommandText = "BSDX CLINIC SETUP";462 ConnectInfo.RPMSDataTable(sCommandText, "ClinicSetupParameters", m_dsGlobal);463 Debug.Write("LoadGlobalRecordsets -- ClinicSetupParameters loaded\n");464 }*/465 455 466 456 public void LoadBSDXResourcesTable() … … 521 511 private bool LoadGlobalRecordsets() 522 512 { 523 //Schedule User Info 524 string sCommandText = "BSDX SCHEDULING USER INFO^" + m_ConnectInfo.DUZ; 525 DataTable dtUser = ConnectInfo.RPMSDataTable(sCommandText, "SchedulingUser", m_dsGlobal); 526 513 514 string sCommandText; 515 516 //Schedule User Info 517 DataTable dtUser = _dal.GetUserInfo(m_ConnectInfo.DUZ); 518 dtUser.TableName = "SchedulingUser"; 519 m_dsGlobal.Tables.Add(dtUser); 527 520 Debug.Assert(dtUser.Rows.Count == 1); 521 522 // Only one row and one column named "MANAGER". Set local var m_bSchedManager to true if Manager. 528 523 DataRow rUser = dtUser.Rows[0]; 529 524 Object oUser = rUser["MANAGER"]; … … 531 526 m_bSchedManager = (sUser == "YES")?true:false; 532 527 533 //AccessTypes 534 LoadAccessTypesTable(); 535 536 //Build Primary Key for AccessTypes table 537 DataTable dtTypes = m_dsGlobal.Tables["AccessTypes"]; 538 DataColumn dcKey = dtTypes.Columns["BMXIEN"]; 539 DataColumn[] dcKeys = new DataColumn[1]; 540 dcKeys[0] = dcKey; 541 dtTypes.PrimaryKey = dcKeys; 528 //Get Access Types 529 DataTable dtAccessTypes = _dal.GetAccessTypes(); 530 dtAccessTypes.TableName = "AccessTypes"; 531 m_dsGlobal.Tables.Add(dtAccessTypes); 542 532 543 533 //AccessGroups … … 546 536 //Build Primary Key for AccessGroup table 547 537 DataTable dtGroups = m_dsGlobal.Tables["AccessGroup"]; 548 549 538 DataColumn dcKey = dtGroups.Columns["ACCESS_GROUP"]; 539 DataColumn[] dcKeys = new DataColumn[1]; 550 540 dcKeys[0] = dcKey; 551 541 dtGroups.PrimaryKey = dcKeys; … … 1044 1034 //Retrieves a recordset from RPMS 1045 1035 string sErrorMessage = ""; 1036 DataTable dtOut; 1037 1038 #if TRACE 1039 DateTime sendTime = DateTime.Now; 1040 #endif 1046 1041 try 1047 1042 { 1048 1043 System.IntPtr pHandle = this.Handle; 1049 DataTable dtOut;1050 1044 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(ConnectInfo.RPMSDataTable); 1051 //dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName}); 1052 dtOut = ConnectInfo.RPMSDataTable(sSQL, sTableName); 1053 return dtOut; 1054 } 1045 dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName}); 1046 } 1047 1055 1048 catch (Exception ex) 1056 1049 { … … 1058 1051 throw ex; 1059 1052 } 1053 1054 #if TRACE 1055 DateTime receiveTime = DateTime.Now; 1056 TimeSpan executionTime = receiveTime - sendTime; 1057 Debug.Write("CGDocumentManager::RPMSDataTable Execution Time: " + executionTime.Milliseconds + " ms.\n"); 1058 #endif 1059 1060 return dtOut; 1061 1060 1062 } 1061 1063
Note:
See TracChangeset
for help on using the changeset viewer.