Changeset 1050 for Scheduling/trunk/cs/bsdx0200GUISourceCode
- Timestamp:
- Jan 5, 2011, 4:10:20 AM (14 years ago)
- Location:
- Scheduling/trunk/cs/bsdx0200GUISourceCode
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/AssemblyInfo.cs
r1011 r1050 28 28 // by using the '*' as shown below: 29 29 30 [assembly: AssemblyVersion("1. 4.2.*")]30 [assembly: AssemblyVersion("1.5.0.*")] 31 31 32 32 // … … 58 58 [assembly: AssemblyKeyFile("")] 59 59 [assembly: AssemblyKeyName("")] 60 [assembly: AssemblyFileVersionAttribute("1. 4.2.0")]60 [assembly: AssemblyFileVersionAttribute("1.5.0.0")] 61 61 [assembly: ComVisibleAttribute(false)] -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
r1038 r1050 430 430 m_DocManager.ConnectInfo.LoadConnectInfo(); 431 431 } 432 System.IntPtr pHandle = m_DocManager.Handle;433 432 434 433 m_pAvArray.Clear(); -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
r1039 r1050 4 4 using System.Data; 5 5 using System.Diagnostics; 6 using System.Threading; 6 7 using IndianHealthService.BMXNet; 7 8 using Mono.Options; … … 11 12 { 12 13 /// <summary> 13 /// Summary description for DocumentManager.14 /// Main Worker. Handles sub-forms. 14 15 /// </summary> 15 public class CGDocumentManager : System.Windows.Forms.Form16 public class CGDocumentManager //: System.Windows.Forms.Form 16 17 { 17 18 #region Member Variables 18 19 19 20 private static CGDocumentManager _current; 20 private Hashtable _views = new Hashtable(); 21 private Hashtable m_AVViews = new Hashtable(); 21 private Hashtable _views = new Hashtable(); //Returns the list of currently opened documents 22 private Hashtable m_AVViews = new Hashtable(); // List of currently opened CGAVViews 22 23 private string m_sWindowText = "Clinical Scheduling"; //Default Window Text 23 private bool m_bSchedManager ;24 private bool m_bExitOK = true; 25 public string m_sHandle = "0"; 24 private bool m_bSchedManager = false; // Do you have the XUPROGMODE or BSDXZMGR? 25 private bool m_bExitOK = true; // Okay to exit program? Used to control Re-logins. Default true. 26 public string m_sHandle = "0"; // Not Used 26 27 27 //Connection variables 28 //Connection variables (tied to command line parameters /a /v /s /p /e) 28 29 private string m_AccessCode=""; 29 30 private string m_VerifyCode=""; 30 31 private string m_Server=""; 31 32 private int m_Port=0; 32 33 //Encoding string (empty by default) 34 private string m_Encoding=""; 33 private string m_Encoding=""; //Encoding is "" by default; 35 34 36 35 //Data Access Layer … … 38 37 39 38 //M Connection member variables 40 private DataSet m_dsGlobal = null; 41 private System.ComponentModel.IContainer components = null; 42 private BMXNetConnectInfo m_ConnectInfo = null; 43 private BMXNetConnectInfo.BMXNetEventDelegate CDocMgrEventDelegate; 39 private DataSet m_dsGlobal = null; // Holds all user data 40 private BMXNetConnectInfo m_ConnectInfo = null; // Connection to VISTA object 41 private BMXNetConnectInfo.BMXNetEventDelegate CDocMgrEventDelegate; // Delegate to respond to messages from VISTA. Responds to event: BMXNetConnectInfo.BMXNetEvent 44 42 45 43 #endregion 46 44 45 #region Properties 46 47 47 /// <summary> 48 /// Constructor. Sets up connector, and ties BMXNet Events to function here. 48 /// Returns the document manager's BMXNetConnectInfo member 49 /// </summary> 50 public BMXNetConnectInfo ConnectInfo 51 { 52 get 53 { 54 return m_ConnectInfo; 55 } 56 } 57 58 /// <summary> 59 /// True if the current user holds the BSDXZMGR or XUPROGMODE keys in RPMS 60 /// </summary> 61 public bool ScheduleManager 62 { 63 get 64 { 65 return m_bSchedManager; 66 } 67 } 68 69 /// <summary> 70 /// Holds the user and division 71 /// </summary> 72 public string WindowText 73 { 74 get 75 { 76 return m_sWindowText; 77 } 78 } 79 80 /// <summary> 81 /// This dataset contains tables used by the entire application 82 /// </summary> 83 public DataSet GlobalDataSet 84 { 85 get 86 { 87 return m_dsGlobal; 88 } 89 set 90 { 91 m_dsGlobal = value; 92 } 93 } 94 95 /// <summary> 96 /// Returns the single CGDocumentManager object 97 /// </summary> 98 public static CGDocumentManager Current 99 { 100 get 101 { 102 return _current; 103 } 104 } 105 106 107 /// <summary> 108 /// Returns the list of currently opened documents 109 /// </summary> 110 public Hashtable Views 111 { 112 get 113 { 114 return _views; 115 } 116 } 117 118 /// <summary> 119 /// Returns the list of currently opened CGAVViews 120 /// </summary> 121 public Hashtable AvailabilityViews 122 { 123 get 124 { 125 return this.m_AVViews; 126 } 127 } 128 129 public DAL DAL 130 { 131 get { return this._dal; } 132 } 133 134 135 #endregion 136 137 /// <summary> 138 /// Constructor. Does absolutely nothing at this point. 49 139 /// </summary> 50 140 public CGDocumentManager() 51 141 { 52 InitializeComponent();53 m_bSchedManager = false;54 142 } 143 144 145 #if DEBUG 146 //To write to the console 147 [DllImport("kernel32.dll")] 148 static extern bool AttachConsole(int dwProcessId); 149 private const int ATTACH_PARENT_PROCESS = -1; 150 #endif 151 /// <summary> 152 /// Main Entry Point 153 /// </summary> 154 /// <param name="args">We accept the following Arguments: 155 /// /s or -s = Server ip address or name 156 /// /p or -p = port number (must be numeric) 157 /// /a or -a = Access Code 158 /// /v or -v = Verify Code 159 /// /e or -e = Encoding (name of encoding as known to windows, such as windows-1256) 160 /// </param> 161 /// <remarks> 162 /// Encoding decision is complex. This is the order of priority: 163 /// - If the M DB runs in UTF-8, that's what we are going to use. 164 /// - If that's not so, /e sets the default encoding. If /e is a non-existent encoding, move forward. 165 /// - If /e is not supplied or is not recognized, the default encoding is the Windows default Encoding for the user. 166 /// </remarks> 167 [STAThread()] 168 static void Main(string[] args) 169 { 170 #if DEBUG 171 // Print console messages to console if launched from console 172 // Note: Imported From kernel32.dll 173 AttachConsole(ATTACH_PARENT_PROCESS); 174 #endif 175 //Store a class instance of manager. Actual constructor does nothing. 176 _current = new CGDocumentManager(); 177 178 //Get command line options; store in private variables 179 var opset = new OptionSet() { 180 { "s=", s => _current.m_Server = s }, 181 { "p=", p => _current.m_Port = int.Parse(p) }, 182 { "a=", a => _current.m_AccessCode = a }, 183 { "v=", v => _current.m_VerifyCode = v }, 184 { "e=", e => _current.m_Encoding = e} 185 }; 186 187 opset.Parse(args); 188 189 190 _current.InitializeApp(); 191 192 //Create the first empty document 193 CGDocument doc = new CGDocument(); 194 doc.DocManager = _current; 195 doc.OnNewDocument(); 196 Application.DoEvents(); 197 198 //Run the application 199 Application.Run(); 200 } 201 55 202 56 203 #region BMXNet Event Handler … … 71 218 string sMsg = e.BMXParam; 72 219 ShowAdminMsgDelegate samd = new ShowAdminMsgDelegate(ShowAdminMsg); 73 this.Invoke(samd, new object [] {sMsg}); 220 //this.Invoke(samd, new object [] {sMsg}); 221 samd.Invoke(sMsg); 74 222 } 75 223 if (e.BMXEvent == "BSDX ADMIN SHUTDOWN") … … 77 225 string sMsg = e.BMXParam; 78 226 CloseAllDelegate cad = new CloseAllDelegate(CloseAll); 79 this.Invoke(cad, new object [] {sMsg}); 227 //this.Invoke(cad, new object [] {sMsg}); 228 cad.Invoke(sMsg); 80 229 } 81 230 } … … 90 239 #endregion BMXNet Event Handler 91 240 92 #region Properties 241 242 #region Methods & Events 243 244 245 private void StartSplash(object form) 246 { 247 ((DSplash)form).ShowDialog(); 248 } 93 249 94 250 /// <summary> 95 /// Returns the document manager's BMXNetConnectInfo member 251 /// See InitializeApp(bool) below 252 /// </summary> 253 private void InitializeApp() 254 { 255 InitializeApp(false); 256 } 257 258 /// <summary> 259 /// Does a million things: 260 /// 1. Starts Connection and displays log-in dialogs 261 /// 2. Starts Splash screen 262 /// 3. Loads data tables 96 263 /// </summary> 97 public BMXNetConnectInfo ConnectInfo 98 { 99 get 100 { 101 return m_ConnectInfo; 102 } 103 } 104 105 /// <summary> 106 /// True if the current user holds the BSDXZMGR or XUPROGMODE keys in RPMS 107 /// </summary> 108 public bool ScheduleManager 109 { 110 get 111 { 112 return m_bSchedManager; 113 } 114 } 115 116 /// <summary> 117 /// Holds the user and division 118 /// </summary> 119 public string WindowText 120 { 121 get 122 { 123 return m_sWindowText; 124 } 125 } 126 127 /// <summary> 128 /// This dataset contains tables used by the entire application 129 /// </summary> 130 public DataSet GlobalDataSet 131 { 132 get 133 { 134 return m_dsGlobal; 135 } 136 set 137 { 138 m_dsGlobal = value; 139 } 140 } 141 //public BMXNetConnection ADOConnection 142 //{ 143 // get 144 // { 145 // return m_ADOConnection; 146 // } 147 //} 148 149 /// <summary> 150 /// Returns the single CGDocumentManager object 151 /// </summary> 152 public static CGDocumentManager Current 153 { 154 get 155 { 156 return _current; 157 } 158 } 159 160 /// <summary> 161 /// Returns the list of currently opened documents 162 /// </summary> 163 public Hashtable Views 164 { 165 get 166 { 167 return _views; 168 } 169 } 170 171 /// <summary> 172 /// Returns the list of currently opened CGAVViews 173 /// </summary> 174 public Hashtable AvailabilityViews 175 { 176 get 177 { 178 return this.m_AVViews; 179 } 180 } 181 182 public DAL DAL 183 { 184 get { return this._dal; } 185 } 186 187 188 #endregion 189 190 #region Methods & Events 191 /// <summary> 192 /// Clean up any resources being used. 193 /// </summary> 194 protected override void Dispose( bool disposing ) 195 { 196 if( disposing ) 197 { 198 if (m_ConnectInfo != null) 199 { 200 m_ConnectInfo.EventPollingEnabled = false; 201 m_ConnectInfo.UnSubscribeEvent("BSDX SCHEDULE"); 202 m_ConnectInfo.UnSubscribeEvent("BSDX CALL WORKSTATIONS"); 203 m_ConnectInfo.CloseConnection(); 204 } 205 if (components != null) 206 { 207 components.Dispose(); 208 } 209 } 210 base.Dispose( disposing ); 211 } 212 213 214 private void InitializeComponent() 215 { 216 } 217 218 219 private DSplash m_ds; 220 public void StartSplash() 221 { 222 m_ds = new DSplash(); 223 m_ds.ShowDialog(); 224 } 225 226 private void InitializeApp() 227 { 228 InitializeApp(false); 229 } 230 231 private void InitializeApp(bool bReLogin) 232 { 264 /// <param name="bReLogin">Is the User logging in again from a currently running instance? 265 /// If so, display a dialog to collect access and verify codes.</param> 266 private void InitializeApp(bool bReLogin) 267 { 268 //Set M connection info 233 269 m_ConnectInfo = new BMXNetConnectInfo(m_Encoding); // Encoding is "" unless passed in command line 234 270 _dal = new DAL(m_ConnectInfo); // Data access layer 235 271 //m_ConnectInfo.bmxNetLib.StartLog(); //This line turns on logging of messages 272 273 //Create a delegate to process events raised by BMX. 236 274 CDocMgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(CDocMgrEventHandler); 275 //Tie delegate to Events generated by BMX. 237 276 m_ConnectInfo.BMXNetEvent += CDocMgrEventDelegate; 277 //Disable polling (But does this really work???? I don't see how it gets disabled) 238 278 m_ConnectInfo.EventPollingEnabled = false; 239 279 240 try 241 { 242 //Set M connection info 243 //Show a splash screen while initializing 244 m_ds = new DSplash(); 245 m_ds.Show(this); 246 m_ds.SetStatus("Loading Configuration Settings..."); 247 m_ds.Refresh(); 248 this.Activate(); 249 // smh--not used System.Configuration.ConfigurationManager.GetSection("appSettings"); 250 m_ds.SetStatus("Connecting to VistA Server..."); 251 m_ds.Refresh(); 252 bool bRetry = true; 253 254 //Try to connect using supplied values for Server and Port 255 //Why am I doing this? The library BMX net uses prompts for access and verify code 256 //whether you can connect or not. Not good. So I test first whether 257 //we can connect at all by doing a simple connection and disconnect. 258 //TODO: Make this more robust by sending a TCPConnect message and seeing if you get a response. 259 260 if (m_Server != "" && m_Port != 0) 280 //Show a splash screen while initializing 281 DSplash m_ds = new DSplash(); 282 DSplash.dSetStatus setStatusDelegate = new DSplash.dSetStatus(m_ds.SetStatus); 283 DSplash.dAny closeSplashDelegate = new DSplash.dAny(m_ds.RemoteClose); 284 DSplash.dAny hideSplashDelegate = new DSplash.dAny(m_ds.RemoteHide); 285 286 Thread threadSplash = new Thread(new ParameterizedThreadStart(StartSplash)); 287 threadSplash.IsBackground = true; //expendable -- exit even if still running. 288 threadSplash.Start(m_ds); 289 290 291 //m_ds.SetStatus("Loading Configuration Settings..."); 292 //m_ds.Refresh(); 293 //this.Activate(); 294 // smh--not used System.Configuration.ConfigurationManager.GetSection("appSettings"); 295 setStatusDelegate("Connecting to VISTA"); 296 //m_ds.Refresh(); 297 bool bRetry = true; 298 299 //Try to connect using supplied values for Server and Port 300 //Why am I doing this? The library BMX net uses prompts for access and verify code 301 //whether you can connect or not. Not good. So I test first whether 302 //we can connect at all by doing a simple connection and disconnect. 303 //TODO: Make this more robust by sending a TCPConnect message and seeing if you get a response. 304 305 //m_ds.Refresh(); 306 307 if (m_Server != "" && m_Port != 0) 308 { 309 System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient(); 310 try 261 311 { 262 System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient(); 263 try 312 tcpClient.Connect(m_Server, m_Port); // open it 313 tcpClient.Close(); // then close it 314 } 315 catch (System.Net.Sockets.SocketException ex) 316 { 317 throw ex; 318 } 319 } 320 321 do 322 { 323 // login crap 324 try 325 { 326 // Not my code 327 if (bReLogin == true) 264 328 { 265 tcpClient.Connect(m_Server, m_Port); // open it266 tcpClient.Close(); // then close it329 //Prompt for Access and Verify codes 330 _current.m_ConnectInfo.LoadConnectInfo("", ""); 267 331 } 268 catch (System.Net.Sockets.SocketException ex) 332 // My code -- buts looks so ugly! 333 else 269 334 { 335 if (m_Server != String.Empty && m_Port != 0 && m_AccessCode != String.Empty 336 && m_VerifyCode != String.Empty) 337 { 338 m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, m_AccessCode, m_VerifyCode); 339 } 340 else if (m_Server != String.Empty && m_Port != 0) 341 m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, "", ""); 342 else 343 m_ConnectInfo.LoadConnectInfo(); 344 } 345 bRetry = false; 346 } 347 catch (System.Net.Sockets.SocketException) 348 { 349 MessageBox.Show("Cannot connect to VistA. "); 350 } 351 catch (Exception ex) 352 { 353 //m_ds.Close(); 354 if (MessageBox.Show("Unable to connect to VistA. " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry) 355 { 356 bRetry = true; 357 _current.m_ConnectInfo.ChangeServerInfo(); 358 } 359 else 360 { 361 closeSplashDelegate(); 362 bRetry = false; 270 363 throw ex; 271 364 } 272 365 } 273 do 274 { 275 // login crap 276 try 277 { 278 // Not my code 279 if (bReLogin == true) 280 { 281 //Prompt for Access and Verify codes 282 _current.m_ConnectInfo.LoadConnectInfo("", ""); 283 } 284 // My code -- buts looks so ugly! 285 else 286 { 287 if (m_Server != String.Empty && m_Port != 0 && m_AccessCode != String.Empty 288 && m_VerifyCode != String.Empty) 289 { 290 m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, m_AccessCode, m_VerifyCode); 291 } 292 else if (m_Server != String.Empty && m_Port != 0) 293 m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, "", ""); 294 else 295 m_ConnectInfo.LoadConnectInfo(); 296 } 297 bRetry = false; 298 } 299 catch (System.Net.Sockets.SocketException) 300 { 301 MessageBox.Show("Cannot connect to VistA. "); 302 } 303 catch (Exception ex) 304 { 305 m_ds.Close(); 306 if (MessageBox.Show("Unable to connect to VistA. " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry) 307 { 308 bRetry = true; 309 _current.m_ConnectInfo.ChangeServerInfo(); 310 } 311 else 312 { 313 bRetry = false; 314 throw ex; 315 } 316 } 317 }while (bRetry == true); 318 319 //Create global dataset 320 _current.m_dsGlobal = new DataSet("GlobalDataSet"); 321 322 //Version info 323 m_ds.SetStatus("Getting Version Info..."); 324 m_ds.Refresh(); 325 326 DataTable ver = _dal.GetVersion("BSDX"); 327 ver.TableName = "VersionInfo"; 328 m_dsGlobal.Tables.Add(ver); 366 }while (bRetry == true); 367 368 //Create global dataset 369 _current.m_dsGlobal = new DataSet("GlobalDataSet"); 370 371 //Version info 372 //m_ds.Activate(); 373 setStatusDelegate("Getting Version Info from Server..."); 374 375 DataTable ver = _dal.GetVersion("BSDX"); 376 ver.TableName = "VersionInfo"; 377 m_dsGlobal.Tables.Add(ver); 329 378 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 379 //How to extract the version numbers: 380 DataTable dtVersion = m_dsGlobal.Tables["VersionInfo"]; 381 Debug.Assert(dtVersion.Rows.Count == 1); 382 DataRow rVersion = dtVersion.Rows[0]; 383 string sMajor = rVersion["MAJOR_VERSION"].ToString(); 384 string sMinor = rVersion["MINOR_VERSION"].ToString(); 385 string sBuild = rVersion["BUILD"].ToString(); 386 decimal fBuild = Convert.ToDecimal(sBuild); 387 388 //Make sure that the server is running the same version the client is. 389 Version x = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 390 391 //if version numbers mismatch, don't continue. 392 //TODO: For future: Include in v. 1.5 393 /* 394 if (!(x.Major.ToString() == sMajor && x.Minor.ToString() + x.Build.ToString() == sMinor)) 395 { 396 MessageBox.Show( 397 "Server runs version " + sMajor + "." + sMinor + "\r\n" + 398 "You are running " + x.ToString() + "\r\n\r\n" + 399 "Major, Minor and Build versions must match", 400 "Version Mismatch"); 401 m_ds.Close(); 402 return; 403 } 404 */ 356 405 357 406 358 //Change encoding 359 if (m_Encoding == String.Empty) 360 { 361 string utf8_server_support = m_ConnectInfo.bmxNetLib.TransmitRPC("BMX UTF-8", ""); 362 if (utf8_server_support == "1") 363 m_ConnectInfo.bmxNetLib.Encoder = System.Text.UTF8Encoding.UTF8; 364 } 365 //Set application context 366 m_ds.SetStatus("Setting Application Context to BSDXRPC..."); 367 m_ds.Refresh(); 368 m_ConnectInfo.AppContext = "BSDXRPC"; 407 //Change encoding 408 setStatusDelegate("Setting encoding..."); 409 410 if (m_Encoding == String.Empty) 411 { 412 string utf8_server_support = m_ConnectInfo.bmxNetLib.TransmitRPC("BMX UTF-8", ""); 413 if (utf8_server_support == "1") 414 m_ConnectInfo.bmxNetLib.Encoder = System.Text.UTF8Encoding.UTF8; 415 } 416 //Set application context 417 setStatusDelegate("Setting Application Context to BSDXRPC..."); 418 m_ConnectInfo.AppContext = "BSDXRPC"; 369 419 370 //Load global recordsets 371 m_ds.SetStatus("Loading VistA data tables..."); 372 m_ds.Refresh(); 373 if (_current.LoadGlobalRecordsets() == false) 374 { 375 MessageBox.Show("Unable to create VistA recordsets"); //TODO Improve this message 376 m_ds.Close(); 377 return; 378 } 379 380 //smh -- why get handles? 381 System.IntPtr pHandle = this.Handle; 382 System.IntPtr pConnHandle = this.ConnectInfo.Handle; 383 this.m_sHandle = pHandle.ToString(); 384 385 _current.m_ConnectInfo.ReceiveTimeout = 30000; //30-second timeout 420 //Load global recordsets 421 string statusConst = "Loading VistA data tables..."; 422 setStatusDelegate(statusConst); 423 424 string sCommandText; 425 426 setStatusDelegate(statusConst + " Schedule User"); 427 //Schedule User Info 428 DataTable dtUser = _dal.GetUserInfo(m_ConnectInfo.DUZ); 429 dtUser.TableName = "SchedulingUser"; 430 m_dsGlobal.Tables.Add(dtUser); 431 Debug.Assert(dtUser.Rows.Count == 1); 432 433 // Only one row and one column named "MANAGER". Set local var m_bSchedManager to true if Manager. 434 DataRow rUser = dtUser.Rows[0]; 435 Object oUser = rUser["MANAGER"]; 436 string sUser = oUser.ToString(); 437 m_bSchedManager = (sUser == "YES") ? true : false; 438 439 setStatusDelegate(statusConst + " Access Types"); 440 //Get Access Types 441 DataTable dtAccessTypes = _dal.GetAccessTypes(); 442 dtAccessTypes.TableName = "AccessTypes"; 443 m_dsGlobal.Tables.Add(dtAccessTypes); 444 445 setStatusDelegate(statusConst + " Access Groups"); 446 //AccessGroups 447 LoadAccessGroupsTable(); 448 449 //Build Primary Key for AccessGroup table 450 DataTable dtGroups = m_dsGlobal.Tables["AccessGroup"]; 451 DataColumn dcKey = dtGroups.Columns["ACCESS_GROUP"]; 452 DataColumn[] dcKeys = new DataColumn[1]; 453 dcKeys[0] = dcKey; 454 dtGroups.PrimaryKey = dcKeys; 455 456 setStatusDelegate(statusConst + " Access Group Types"); 457 //AccessGroupType 458 LoadAccessGroupTypesTable(); 459 460 //Build Primary Key for AccessGroupType table 461 DataTable dtAGTypes = m_dsGlobal.Tables["AccessGroupType"]; 462 DataColumn dcGTKey = dtAGTypes.Columns["ACCESS_GROUP_TYPEID"]; 463 DataColumn[] dcGTKeys = new DataColumn[1]; 464 dcGTKeys[0] = dcGTKey; 465 dtAGTypes.PrimaryKey = dcGTKeys; 466 467 //Build Data Relationship between AccessGroupType and AccessTypes tables 468 DataRelation dr = new DataRelation("AccessGroupType", //Relation Name 469 m_dsGlobal.Tables["AccessGroup"].Columns["BMXIEN"], //Parent 470 m_dsGlobal.Tables["AccessGroupType"].Columns["ACCESS_GROUP_ID"]); //Child 471 m_dsGlobal.Relations.Add(dr); 472 473 setStatusDelegate(statusConst + " Resource Groups By User"); 474 //ResourceGroup Table (Resource Groups by User) 475 LoadResourceGroupTable(); 476 477 setStatusDelegate(statusConst + " Resources By User"); 478 //Resources by user 479 LoadBSDXResourcesTable(); 480 481 //Build Primary Key for Resources table 482 DataColumn[] dc = new DataColumn[1]; 483 dc[0] = m_dsGlobal.Tables["Resources"].Columns["RESOURCEID"]; 484 m_dsGlobal.Tables["Resources"].PrimaryKey = dc; 485 486 setStatusDelegate(statusConst + " Group Resources"); 487 //GroupResources table 488 LoadGroupResourcesTable(); 489 490 //Build Primary Key for ResourceGroup table 491 dc = new DataColumn[1]; 492 dc[0] = m_dsGlobal.Tables["ResourceGroup"].Columns["RESOURCE_GROUP"]; 493 m_dsGlobal.Tables["ResourceGroup"].PrimaryKey = dc; 494 495 //Build Data Relationships between ResourceGroup and GroupResources tables 496 dr = new DataRelation("GroupResource", //Relation Name 497 m_dsGlobal.Tables["ResourceGroup"].Columns["RESOURCE_GROUP"], //Parent 498 m_dsGlobal.Tables["GroupResources"].Columns["RESOURCE_GROUP"]); //Child 499 CGSchedLib.OutputArray(m_dsGlobal.Tables["GroupResources"], "GroupResources"); 500 m_dsGlobal.Relations.Add(dr); 501 502 setStatusDelegate(statusConst + " Clinics"); 503 //HospitalLocation table 504 //cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION"; 505 sCommandText = "BSDX HOSPITAL LOCATION"; 506 ConnectInfo.RPMSDataTable(sCommandText, "HospitalLocation", m_dsGlobal); 507 Debug.Write("LoadGlobalRecordsets -- HospitalLocation loaded\n"); 508 509 //Build Primary Key for HospitalLocation table 510 dc = new DataColumn[1]; 511 DataTable dtTemp = m_dsGlobal.Tables["HospitalLocation"]; 512 dc[0] = dtTemp.Columns["HOSPITAL_LOCATION_ID"]; 513 m_dsGlobal.Tables["HospitalLocation"].PrimaryKey = dc; 514 515 //Build Data Relationships between Resources and HospitalLocation tables 516 dr = new DataRelation("HospitalLocationResource", //Relation Name 517 m_dsGlobal.Tables["HospitalLocation"].Columns["HOSPITAL_LOCATION_ID"], //Parent 518 m_dsGlobal.Tables["Resources"].Columns["HOSPITAL_LOCATION_ID"], false); //Child 519 m_dsGlobal.Relations.Add(dr); 520 521 setStatusDelegate(statusConst + " Schedule User"); 522 //Build ScheduleUser table 523 this.LoadScheduleUserTable(); 524 525 //Build Primary Key for ScheduleUser table 526 dc = new DataColumn[1]; 527 dtTemp = m_dsGlobal.Tables["ScheduleUser"]; 528 dc[0] = dtTemp.Columns["USERID"]; 529 m_dsGlobal.Tables["ScheduleUser"].PrimaryKey = dc; 530 531 setStatusDelegate(statusConst + " Resource User"); 532 //Build ResourceUser table 533 this.LoadResourceUserTable(); 534 535 //Build Primary Key for ResourceUser table 536 dc = new DataColumn[1]; 537 dtTemp = m_dsGlobal.Tables["ResourceUser"]; 538 dc[0] = dtTemp.Columns["RESOURCEUSER_ID"]; 539 m_dsGlobal.Tables["ResourceUser"].PrimaryKey = dc; 540 541 //Create relation between BSDX Resource and BSDX Resource User tables 542 dr = new DataRelation("ResourceUser", //Relation Name 543 m_dsGlobal.Tables["Resources"].Columns["RESOURCEID"], //Parent 544 m_dsGlobal.Tables["ResourceUser"].Columns["RESOURCEID"]); //Child 545 m_dsGlobal.Relations.Add(dr); 546 547 setStatusDelegate(statusConst + " Providers"); 548 //Build active provider table 549 sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND BMXIEN > 1"; 550 ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal); 551 Debug.Write("LoadGlobalRecordsets -- Provider loaded\n"); 552 553 setStatusDelegate(statusConst + " Clinic Stops"); 554 //Build the CLINIC_STOP table 555 // sCommandText = "SELECT BMXIEN, CODE, NAME FROM CLINIC_STOP"; //SMH 556 sCommandText = "SELECT BMXIEN, AMIS_REPORTING_STOP_CODE, NAME FROM CLINIC_STOP"; 557 ConnectInfo.RPMSDataTable(sCommandText, "ClinicStop", m_dsGlobal); 558 Debug.Write("LoadGlobalRecordsets -- ClinicStop loaded\n"); 559 560 setStatusDelegate(statusConst + " Holiday"); 561 //Build the HOLIDAY table 562 sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE DATE > '" + DateTime.Today.ToShortDateString() + "'"; 563 ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal); 564 Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n"); 565 566 567 //Save the xml schema 568 //m_dsGlobal.WriteXmlSchema(@"..\..\csSchema20060526.xsd"); 569 //---------------------------------------------- 570 571 572 _current.m_ConnectInfo.ReceiveTimeout = 30000; //30-second timeout 386 573 387 574 #if DEBUG 388 575 _current.m_ConnectInfo.ReceiveTimeout = 600000; //longer timeout for debugging 389 576 #endif 390 _current.m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE"); 391 _current.m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS"); 392 _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE"); 393 _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN SHUTDOWN"); 394 395 _current.m_ConnectInfo.EventPollingInterval = 5000; //in milliseconds 396 _current.m_ConnectInfo.EventPollingEnabled = true; 397 _current.m_ConnectInfo.AutoFire = 12; //AutoFire every 12*5 seconds 398 399 m_ds.Close(); 400 } 401 catch (Exception ex) 402 { 403 m_ds.Close(); 404 Debug.Write(ex.Message); 405 MessageBox.Show(ex.Message + ex.StackTrace, "Clinical Scheduling Error -- Closing Application"); 406 throw ex; 407 } 408 } 409 410 //To write to the console 411 [DllImport("kernel32.dll")] 412 static extern bool AttachConsole(int dwProcessId); 413 private const int ATTACH_PARENT_PROCESS = -1; 414 415 [STAThread()] 416 static void Main(string[] args) 417 { 418 #if DEBUG 419 // Print console messages to console if launched from console 420 // Note: Imported From kernel32.dll 421 AttachConsole(ATTACH_PARENT_PROCESS); 422 #endif 423 try 424 { 425 //Store the current manager 426 _current = new CGDocumentManager(); 427 428 //Get command line options; store in private variables 429 var opset = new OptionSet () { 430 { "s=", s => _current.m_Server = s }, 431 { "p=", p => _current.m_Port = int.Parse(p) }, 432 { "a=", a => _current.m_AccessCode = a }, 433 { "v=", v => _current.m_VerifyCode = v }, 434 { "e=", e => _current.m_Encoding = e} 435 }; 436 437 opset.Parse(args); 438 439 try 440 { 441 _current.InitializeApp(); 442 } 443 catch (Exception ex) 444 { 445 Debug.Write(ex.Message); 446 return; 447 } 448 449 //Create the first empty document 450 CGDocument doc = new CGDocument(); 451 doc.DocManager = _current; 452 doc.OnNewDocument(); 453 Application.DoEvents(); 454 455 //Run the application 456 Application.Run(); 457 } 458 catch (Exception ex) 459 { 460 Debug.Write(ex.Message); 461 MessageBox.Show(ex.Message + ex.StackTrace, "CGDocumentManager.Main(): Clinical Scheduling Error -- Closing Application"); 462 return; 463 } 464 } 577 _current.m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE"); 578 _current.m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS"); 579 _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE"); 580 _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN SHUTDOWN"); 581 582 _current.m_ConnectInfo.EventPollingInterval = 5000; //in milliseconds 583 _current.m_ConnectInfo.EventPollingEnabled = true; 584 _current.m_ConnectInfo.AutoFire = 12; //AutoFire every 12*5 seconds 585 586 //Close Splash Screen 587 closeSplashDelegate(); 588 589 } 590 465 591 466 592 … … 529 655 public void LoadResourceUserTable(bool bAllUsers) 530 656 { 531 string sCommandText = "SELECT BMXIEN RESOURCEUSER_ID, RESOURCENAME, INTERNAL[RESOURCENAME] RESOURCEID, OVERBOOK, MODIFY_SCHEDULE, MODIFY_APPOINTMENTS, USERNAME, INTERNAL[USERNAME] USERID FROM BSDX_RESOURCE_USER"; // WHERE INTERNAL[INSTITUTION]=" + m_ConnectInfo.DUZ2; 657 string sCommandText = @"SELECT BMXIEN RESOURCEUSER_ID, RESOURCENAME, INTERNAL[RESOURCENAME] RESOURCEID, OVERBOOK, MODIFY_SCHEDULE, MODIFY_APPOINTMENTS, USERNAME, INTERNAL[USERNAME] USERID FROM BSDX_RESOURCE_USER"; // WHERE INTERNAL[INSTITUTION]=" + m_ConnectInfo.DUZ2; 658 659 if (!bAllUsers) 660 { 661 sCommandText += String.Format(" WHERE INTERNAL[USERNAME] = {0}", m_ConnectInfo.DUZ); 662 } 663 532 664 ConnectInfo.RPMSDataTable(sCommandText, "ResourceUser", m_dsGlobal); 533 665 Debug.Write("LoadGlobalRecordsets -- ResourceUser loaded\n"); 534 666 } 535 667 536 private bool LoadGlobalRecordsets()537 {538 539 string sCommandText;540 541 //Schedule User Info542 DataTable dtUser = _dal.GetUserInfo(m_ConnectInfo.DUZ);543 dtUser.TableName = "SchedulingUser";544 m_dsGlobal.Tables.Add(dtUser);545 Debug.Assert(dtUser.Rows.Count == 1);546 547 // Only one row and one column named "MANAGER". Set local var m_bSchedManager to true if Manager.548 DataRow rUser = dtUser.Rows[0];549 Object oUser = rUser["MANAGER"];550 string sUser = oUser.ToString();551 m_bSchedManager = (sUser == "YES")?true:false;552 553 //Get Access Types554 DataTable dtAccessTypes = _dal.GetAccessTypes();555 dtAccessTypes.TableName = "AccessTypes";556 m_dsGlobal.Tables.Add(dtAccessTypes);557 558 //AccessGroups559 LoadAccessGroupsTable();560 561 //Build Primary Key for AccessGroup table562 DataTable dtGroups = m_dsGlobal.Tables["AccessGroup"];563 DataColumn dcKey = dtGroups.Columns["ACCESS_GROUP"];564 DataColumn[] dcKeys = new DataColumn[1];565 dcKeys[0] = dcKey;566 dtGroups.PrimaryKey = dcKeys;567 568 //AccessGroupType569 LoadAccessGroupTypesTable();570 571 //Build Primary Key for AccessGroupType table572 DataTable dtAGTypes = m_dsGlobal.Tables["AccessGroupType"];573 DataColumn dcGTKey = dtAGTypes.Columns["ACCESS_GROUP_TYPEID"];574 DataColumn[] dcGTKeys = new DataColumn[1];575 dcGTKeys[0] = dcGTKey;576 dtAGTypes.PrimaryKey = dcGTKeys;577 578 //Build Data Relationship between AccessGroupType and AccessTypes tables579 DataRelation dr = new DataRelation("AccessGroupType", //Relation Name580 m_dsGlobal.Tables["AccessGroup"].Columns["BMXIEN"], //Parent581 m_dsGlobal.Tables["AccessGroupType"].Columns["ACCESS_GROUP_ID"]); //Child582 m_dsGlobal.Relations.Add(dr);583 584 //ResourceGroup Table (Resource Groups by User)585 LoadResourceGroupTable();586 587 //Resources by user588 LoadBSDXResourcesTable();589 590 //Build Primary Key for Resources table591 DataColumn[] dc = new DataColumn[1];592 dc[0] = m_dsGlobal.Tables["Resources"].Columns["RESOURCEID"];593 m_dsGlobal.Tables["Resources"].PrimaryKey = dc;594 595 //GroupResources table596 LoadGroupResourcesTable();597 598 //Build Primary Key for ResourceGroup table599 dc = new DataColumn[1];600 dc[0] = m_dsGlobal.Tables["ResourceGroup"].Columns["RESOURCE_GROUP"];601 m_dsGlobal.Tables["ResourceGroup"].PrimaryKey = dc;602 603 //Build Data Relationships between ResourceGroup and GroupResources tables604 dr = new DataRelation("GroupResource", //Relation Name605 m_dsGlobal.Tables["ResourceGroup"].Columns["RESOURCE_GROUP"], //Parent606 m_dsGlobal.Tables["GroupResources"].Columns["RESOURCE_GROUP"]); //Child607 CGSchedLib.OutputArray(m_dsGlobal.Tables["GroupResources"], "GroupResources");608 m_dsGlobal.Relations.Add(dr);609 610 //HospitalLocation table611 //cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";612 sCommandText = "BSDX HOSPITAL LOCATION";613 ConnectInfo.RPMSDataTable(sCommandText, "HospitalLocation", m_dsGlobal);614 Debug.Write("LoadGlobalRecordsets -- HospitalLocation loaded\n");615 616 //Build Primary Key for HospitalLocation table617 dc = new DataColumn[1];618 DataTable dtTemp = m_dsGlobal.Tables["HospitalLocation"];619 dc[0] = dtTemp.Columns["HOSPITAL_LOCATION_ID"];620 m_dsGlobal.Tables["HospitalLocation"].PrimaryKey = dc;621 622 //smh623 //LoadClinicSetupTable();624 625 //smh626 //Build Primary Key for ClinicSetupParameters table627 /*dc = new DataColumn[1];628 dtTemp = m_dsGlobal.Tables["ClinicSetupParameters"];629 dc[0] = dtTemp.Columns["HOSPITAL_LOCATION_ID"];630 m_dsGlobal.Tables["ClinicSetupParameters"].PrimaryKey = dc;631 632 //Build Data Relationships between ClinicSetupParameters and HospitalLocation tables633 dr = new DataRelation("HospitalLocationClinic", //Relation Name634 m_dsGlobal.Tables["HospitalLocation"].Columns["HOSPITAL_LOCATION_ID"], //Parent635 m_dsGlobal.Tables["ClinicSetupParameters"].Columns["HOSPITAL_LOCATION_ID"], false); //Child636 m_dsGlobal.Relations.Add(dr);*/637 /*SMH638 dtTemp.Columns.Add("PROVIDER", System.Type.GetType("System.String"), "Parent.DEFAULT_PROVIDER");639 dtTemp.Columns.Add("CLINIC_STOP", System.Type.GetType("System.String"), "Parent.STOP_CODE_NUMBER");640 dtTemp.Columns.Add("INACTIVATE_DATE", System.Type.GetType("System.String"), "Parent.INACTIVATE_DATE");641 dtTemp.Columns.Add("REACTIVATE_DATE", System.Type.GetType("System.String"), "Parent.REACTIVATE_DATE");642 */643 644 //Build Data Relationships between Resources and HospitalLocation tables645 dr = new DataRelation("HospitalLocationResource", //Relation Name646 m_dsGlobal.Tables["HospitalLocation"].Columns["HOSPITAL_LOCATION_ID"], //Parent647 m_dsGlobal.Tables["Resources"].Columns["HOSPITAL_LOCATION_ID"], false); //Child648 m_dsGlobal.Relations.Add(dr);649 650 //Build ScheduleUser table651 this.LoadScheduleUserTable();652 653 //Build Primary Key for ScheduleUser table654 dc = new DataColumn[1];655 dtTemp = m_dsGlobal.Tables["ScheduleUser"];656 dc[0] = dtTemp.Columns["USERID"];657 m_dsGlobal.Tables["ScheduleUser"].PrimaryKey = dc;658 659 //Build ResourceUser table660 this.LoadResourceUserTable();661 662 //Build Primary Key for ResourceUser table663 dc = new DataColumn[1];664 dtTemp = m_dsGlobal.Tables["ResourceUser"];665 dc[0] = dtTemp.Columns["RESOURCEUSER_ID"];666 m_dsGlobal.Tables["ResourceUser"].PrimaryKey = dc;667 668 //Create relation between BSDX Resource and BSDX Resource User tables669 dr = new DataRelation("ResourceUser", //Relation Name670 m_dsGlobal.Tables["Resources"].Columns["RESOURCEID"], //Parent671 m_dsGlobal.Tables["ResourceUser"].Columns["RESOURCEID"]); //Child672 m_dsGlobal.Relations.Add(dr);673 674 //Build active provider table675 sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND BMXIEN > 1";676 ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal);677 Debug.Write("LoadGlobalRecordsets -- Provider loaded\n");678 679 //Build the CLINIC_STOP table680 // sCommandText = "SELECT BMXIEN, CODE, NAME FROM CLINIC_STOP"; //SMH681 sCommandText = "SELECT BMXIEN, AMIS_REPORTING_STOP_CODE, NAME FROM CLINIC_STOP";682 ConnectInfo.RPMSDataTable(sCommandText, "ClinicStop", m_dsGlobal);683 Debug.Write("LoadGlobalRecordsets -- ClinicStop loaded\n");684 685 //Build the HOLIDAY table686 sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE DATE > '" + DateTime.Today.ToShortDateString() + "'";687 ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal);688 Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n");689 690 691 //Save the xml schema692 //m_dsGlobal.WriteXmlSchema(@"..\..\csSchema20060526.xsd");693 694 return true;695 }696 668 697 669 public void RegisterDocumentView(CGDocument doc, CGView view) … … 792 764 } 793 765 766 /// <summary> 767 /// Removes view and Handles Disconnection from Database if no views are left. 768 /// </summary> 769 /// <param name="sender"></param> 770 /// <param name="e"></param> 794 771 private void ViewClosed(object sender, EventArgs e) 795 772 { … … 996 973 CloseAll(); 997 974 m_bExitOK = true; 998 _current.m_ConnectInfo = new BMXNet.BMXNetConnectInfo();975 //_current.m_ConnectInfo = new BMXNet.BMXNetConnectInfo();//smh redundant 999 976 this.InitializeApp(true); 1000 977 //Create a new document … … 1068 1045 //System.IntPtr pHandle = this.Handle; 1069 1046 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(ConnectInfo.RPMSDataTable); 1070 dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName}); 1047 //dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName}); 1048 dtOut = rdtd.Invoke(sSQL, sTableName); 1071 1049 } 1072 1050 -
Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj
r1039 r1050 192 192 <SubType>Code</SubType> 193 193 </Compile> 194 <Compile Include="CGDocumentManager.cs"> 195 <SubType>Form</SubType> 196 </Compile> 194 <Compile Include="CGDocumentManager.cs" /> 197 195 <Compile Include="CGRange.cs" /> 198 196 <Compile Include="CGResource.cs" /> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user
r1049 r1050 37 37 </RemoteDebugMachine> 38 38 <StartAction>Project</StartAction> 39 <StartArguments>/s=1 72.16.16.51 /p=9250 /a=s.habiel /v=catdog.55</StartArguments>39 <StartArguments>/s=10.161.20.25 /p=9280 /a=s.habiel /v=catdog.55</StartArguments> 40 40 <StartPage> 41 41 </StartPage> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DSplash.cs
r627 r1050 13 13 { 14 14 private System.Windows.Forms.Label label1; 15 //private System.Windows.Forms.Label lblVersion;16 15 private System.Windows.Forms.LinkLabel lnkMail; 17 16 private System.Windows.Forms.Label lblStatus; 17 private Label lblVersion; 18 private Label label2; 18 19 /// <summary> 19 20 /// Required designer variable. … … 55 56 private void InitializeComponent() 56 57 { 58 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DSplash)); 57 59 this.label1 = new System.Windows.Forms.Label(); 58 60 this.lnkMail = new System.Windows.Forms.LinkLabel(); 59 61 this.lblStatus = new System.Windows.Forms.Label(); 62 this.lblVersion = new System.Windows.Forms.Label(); 63 this.label2 = new System.Windows.Forms.Label(); 60 64 this.SuspendLayout(); 61 65 // … … 63 67 // 64 68 this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 65 this.label1.Location = new System.Drawing.Point( 24, 32);69 this.label1.Location = new System.Drawing.Point(12, 67); 66 70 this.label1.Name = "label1"; 67 this.label1.Size = new System.Drawing.Size(4 48, 40);71 this.label1.Size = new System.Drawing.Size(464, 40); 68 72 this.label1.TabIndex = 0; 69 this.label1.Text = " VistAClinical Scheduling";73 this.label1.Text = "Clinical Scheduling"; 70 74 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 71 75 // … … 80 84 // 81 85 this.lblStatus.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 82 this.lblStatus.Location = new System.Drawing.Point(8 8, 160);86 this.lblStatus.Location = new System.Drawing.Point(80, 159); 83 87 this.lblStatus.Name = "lblStatus"; 84 88 this.lblStatus.Size = new System.Drawing.Size(328, 16); … … 86 90 this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 87 91 // 92 // lblVersion 93 // 94 this.lblVersion.AutoSize = true; 95 this.lblVersion.Location = new System.Drawing.Point(210, 117); 96 this.lblVersion.Name = "lblVersion"; 97 this.lblVersion.Size = new System.Drawing.Size(52, 13); 98 this.lblVersion.TabIndex = 5; 99 this.lblVersion.Text = "lblVersion"; 100 this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 101 // 102 // label2 103 // 104 this.label2.AutoSize = true; 105 this.label2.Font = new System.Drawing.Font("Book Antiqua", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 106 this.label2.Location = new System.Drawing.Point(180, 21); 107 this.label2.Name = "label2"; 108 this.label2.Size = new System.Drawing.Size(130, 46); 109 this.label2.TabIndex = 6; 110 this.label2.Text = "VISTA"; 111 // 88 112 // DSplash 89 113 // 90 114 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 115 this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); 91 116 this.ClientSize = new System.Drawing.Size(488, 252); 92 117 this.ControlBox = false; 118 this.Controls.Add(this.label2); 119 this.Controls.Add(this.lblVersion); 93 120 this.Controls.Add(this.lblStatus); 94 121 this.Controls.Add(this.lnkMail); 95 122 this.Controls.Add(this.label1); 96 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; 123 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 124 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 97 125 this.Name = "DSplash"; 98 126 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; … … 100 128 this.Load += new System.EventHandler(this.DSplash_Load); 101 129 this.ResumeLayout(false); 130 this.PerformLayout(); 102 131 103 132 } 104 133 #endregion 105 134 106 public void SetStatus(string sStatus) 135 public delegate void dSetStatus(string sStatus); 136 public delegate void dAny(); 137 138 public void SetStatus(string sStatus) 107 139 { 108 this.Status = sStatus; 140 if (this.InvokeRequired == true) 141 { 142 dSetStatus d = new dSetStatus(SetStatus); 143 this.Invoke(d, new object[] { sStatus }); 144 return; 145 } 146 147 System.Diagnostics.Debug.Assert(this.InvokeRequired == false); 148 this.lblStatus.Text = sStatus; 149 this.Refresh(); 109 150 } 110 151 111 152 private void DSplash_Load(object sender, System.EventArgs e) 112 153 { 113 //this.lblVersion.Text = "Version " + Application.ProductVersion;154 this.lblVersion.Text = "Version " + Application.ProductVersion; 114 155 } 115 156 116 #region Properties 117 /// <summary> 118 /// Gets or sets the value of the Status displayed on the splash screen 119 /// </summary> 120 public String Status 121 { 122 get 123 { 124 return lblStatus.Text; 125 } 126 set 127 { 128 lblStatus.Text = value; 129 } 130 } 131 #endregion Properties 157 public void RemoteClose() 158 { 159 dAny d = new dAny(this.Close); 160 this.Invoke(d); 161 } 162 163 public void RemoteHide() 164 { 165 dAny d = new dAny(this.Hide); 166 this.Invoke(d); 167 } 132 168 } 169 170 171 133 172 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DSplash.resx
r614 r1050 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 121 <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 122 <value> 123 AAABAAIAICAQAAAAAADoAgAAJgAAABAQEAAAAAAAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIAC 124 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAAAAD/AAD/ 125 AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIh3iI 126 iId4iAAAAAAAAAAACId4iIiHeIAiIiIggAAAAAAAAAAAAAgCqqqqoggAAAAAAAAAAACAKqqqqiAIAAiH 127 eId4iIiIAqqqqqIAAIAIh3iHeIiIgCqqqqogAACAAAAAAAAACAKqqqqiAAAAgAAAAAAAAIAqqqqqIAAA 128 AIAAAAAAAAgCqqqqogAAAAgAAAAAAAAAIiIiIiAAAACAAAAA////8AAAAAAAAAAIAAAAAP////8Aqqqq 129 IAAAgAAAAAD/iIj/gCqqqqIACAAAAAAA/4iI/4gCqqqqIIAAAAAAAP//////8AAAAAgAAAAAAAD///// 130 //+IiIiPAAAAAAAA/4iI/4iI/4iI/wAAAAAAAP+IiP+IiP+IiP8AAAAAAAD/////////////AAAAAAAA 131 /////////////wAAAAAAAP+IiP+IiP+IiP8AAAAAAAD/iIj/iIj/iIj/AAAAAAAA/////////////wAA 132 AAAAAP////////////8AAAAAAERERERERERERERERAAAAABEREREREREREREREQAAAAARERERERERERE 133 REREAAAAAERERERERERERERERAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////// 134 ///4AAAP+AAAB///gAP//wADgAAAAYAAAAH/+AAB//AAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8AA 135 AD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA///////// 136 //8oAAAAEAAAACAAAAABAAQAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAA 137 AACAAIAAgIAAAMDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAHh4iHgA 138 CAAAAAAAACIiAAh4eIgCqqIIAAAAACqqIAAAAAACqqIAAAAP/wAAAAAAAA+IgKqiAAAAD//4AADwAAAP 139 iPiPiPAAAA//////8AAAD4j4j4jwAAAP//////AAAERERERERAAAREREREREAAAAAAAAAAAA//8AAMAD 140 AAD/gQAAgAAAAP4AAADAAQAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAA//8AAA== 141 </value> 142 </data> 120 143 </root>
Note:
See TracChangeset
for help on using the changeset viewer.