/[AnywhereTS-MSSQL]/trunk/TSAdminTool/frmAdmin.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/frmAdmin.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSAdminTool/frmAdmin.cs	2012/07/12 16:47:17	57
+++ trunk/TSAdminTool/frmAdmin.cs	2012/07/12 18:17:31	63
@@ -9,7 +9,8 @@
     using System.Windows.Forms;
     using System.Runtime.InteropServices;
     using System.IO;
-    using System.Data.SqlClient; // For File operations
+    using System.Data.SqlClient;
+    using System.Security.Permissions; // For File operations
     
 
     public partial class frmAdmin : Form
@@ -23,38 +24,12 @@
         private string selectedClientMacAddress; // The MAC address of the currently selected client.
         public frmAdmin()
         {
-            InitializeComponent();
-            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
-        }
-
-        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
-        {
-            Exception ex = (e.ExceptionObject as Exception);
-            if (ex == null)
-            {
-                Logging.ATSAdminLog.Error("Encountered unhandled Exception, but the exception was null");
-                return;
-            }
-            if (ex.GetType() == typeof(SqlException))
-            {
-                SqlException sql_ex = (ex as SqlException);
-                using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", sql_ex.Number.ToString(), sql_ex.Message, System.Environment.NewLine, sql_ex.ToString())))
-                {
-                    Logging.ATSAdminLog.Error("Encountered unhandled SqlException");
-                }
-            }
-            else
-            {
-                using (log4net.NDC.Push(string.Format("Exception: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString())))
-                {
-                    Logging.ATSAdminLog.Error("Encountered unhandled Exception");
-                }
-            }
-        }
+            InitializeComponent();            
+        }  
 
         private void frmAdmin_Load(object sender, EventArgs e)
-        {
-            this.Cursor = Cursors.WaitCursor;
+        {            
+            //this.Cursor = Cursors.WaitCursor;
 
             UpdateControlsToReflectProgramVersion();
 
@@ -634,7 +609,10 @@
                 }
                 else
                 {
-                    throw new Exception("Error: Cannot find record to delete (43556)");
+                    //throw new Exception(string.Format("Error: Cannot find record to delete (43556) for mac address: "));
+                    string error = string.Format("Error: Cannot find record to delete (43556) for mac address: {0}", selectedClientMacAddress);
+                    Logging.ATSAdminLog.Error(error);
+                    MessageBox.Show(error);                    
                 }
             }
         }
@@ -763,9 +741,10 @@
 
 
         // Configure AnywhereTS
-        // Run first time starting ATS and can also be invoked from the Tools menu.
+        // Run first time starting ATS and can also be invoked from the Tools menu.        
         private bool ConfigureATS()
         {
+
             DialogResult result;
 
             if (!ProSupport.IsAnAdministrator())

 

  ViewVC Help
Powered by ViewVC 1.1.22