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

Diff of /trunk/TSAdminTool/frmConfigServices.cs

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

--- trunk/TSAdminTool/frmConfigServices.cs	2012/07/11 14:19:13	4
+++ trunk/TSAdminTool/frmConfigServices.cs	2012/07/12 18:56:31	64
@@ -26,7 +26,7 @@
 
         private void frmConfigureMode_Load(object sender, EventArgs e)
         {
-            this.Cursor = Cursors.WaitCursor;
+            //this.Cursor = Cursors.WaitCursor;
             
             tftpUncPaths = new List<string>(); // Create a list for the TFTP UNC paths.
 
@@ -101,7 +101,15 @@
             else if (radTSother.Checked)
                 ATSGlobals.terminalServerConfig = 1;
             else
-                throw new Exception("Undefined terminal servers config. 42001");
+            {
+                string error = "Error: Undefined terminal servers config (42001)";
+                using (log4net.NDC.Push(string.Format("terminalServerConfig={0}", ATSGlobals.terminalServerConfig)))
+                {
+                    Logging.ATSAdminLog.Error(error);
+                }
+                MessageBox.Show(string.Format("{0} -> {1}", error, string.Format("terminalServerConfig={0}", ATSGlobals.terminalServerConfig)));
+                return;
+            }
 
            
             string strPath; // The TFTP path
@@ -123,6 +131,10 @@
                 {
                     this.Cursor = Cursors.Default;
                     MessageBox.Show("Invalid path for the AnywhereTS shared network files.");
+                    using (log4net.NDC.Push(string.Format("path={0}", strPath)))
+                    {
+                        Logging.ATSAdminLog.Error("Invalid path for the AnywhereTS shared network files.");
+                    }
                     txtTFTPpath.Focus();
                     return;
                 }
@@ -136,6 +148,13 @@
                 {
                     this.Cursor = Cursors.Default;
                     MessageBox.Show("Could not create directory '" + strPath + "'. Error: " + ex.Message);
+                    using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString())))
+                    {
+                        using (log4net.NDC.Push(string.Format("directory={0}", strPath)))
+                        {
+                            Logging.ATSAdminLog.Error("Could not create directory.");
+                        }
+                    }
                     txtTFTPpath.Select();
                     return;
                 }
@@ -524,6 +543,10 @@
                 {
                     this.Cursor = Cursors.Default;
                     MessageBox.Show("Could not set user access rights for TFTP directory. Do you have sufficient right? (29991). Error: " + ex.Message);
+                    using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString())))
+                    {
+                        Logging.ATSAdminLog.Error("Could not set user access rights for TFTP directory.");                      
+                    }
                     return;
                 }
             }
@@ -630,7 +653,7 @@
             DialogResult result = folderBrowserDialog.ShowDialog();
             if (result == DialogResult.OK)
             {
-                string strPath; // The path provided by the user 
+                string strPath=""; // The path provided by the user 
 
                 // Browse to a folder by displaying the folder browse Dialog
                 try
@@ -640,6 +663,10 @@
                 catch (NotSupportedException)
                 {   // User has browsed to a non folder
                     MessageBox.Show("Object is not a file folder.");
+                    using (log4net.NDC.Push(string.Format("path={0}", strPath)))
+                    {
+                        Logging.ATSAdminLog.Error("Object is not a file folder.");
+                    }
                     goto Rebrowse;
                 }
                 txtTFTPpath.Text = strPath;

 

  ViewVC Help
Powered by ViewVC 1.1.22