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

Diff of /trunk/TSAdminTool/frmClientProperties.cs

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

--- trunk/TSAdminTool/frmClientProperties.cs	2012/07/11 14:19:13	4
+++ trunk/TSAdminTool/frmClientProperties.cs	2012/07/12 14:17:14	46
@@ -249,6 +249,10 @@
                 if (rowThisClient == null)
                 {   // We have exceeded the license limit, terminate.
                     MessageBox.Show("The maxiumum number of licensed clients is reached. Please contact your system administrator.");
+                    using (log4net.NDC.Push(string.Format("client macaddress={0}", macAddress)))
+                    {
+                        Logging.ATSAdminLog.Warn("The maxiumum number of licensed clients has been reached");
+                    }
                     Application.Exit();
                     return;
                 }
@@ -477,6 +481,10 @@
                         {
                             tabClientProperties.SelectTab("TabGeneral");
                             MessageBox.Show("MAC address " + txtMacAddress.Text.ToUpper() + " is already in use by another client! Maybe you are trying to add the same client twice?");
+                            using (log4net.NDC.Push(string.Format("macaddress={0}", strValidatedMacAdress)))
+                            {
+                                Logging.ATSAdminLog.Warn("Attempt to duplicate an already existing MAC Address.");
+                            }
                             txtMacAddress.Focus();
                             txtMacAddress.SelectAll();
                             return;
@@ -559,10 +567,17 @@
                     {
                         currentConfig.ServerPort = Int32.Parse(txtServerPort.Text.Trim());
                     }
-                    catch (Exception)
+                    catch (Exception e)
                     {
                         tabClientProperties.SelectTab("tabRdp");
                         MessageBox.Show("Invalid server port!");
+                        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                        {
+                            using (log4net.NDC.Push(string.Format("serverport={0}", txtServerPort.Text)))
+                            {
+                                Logging.ATSAdminLog.ErrorFormat("Invalid server port!");
+                            }
+                        }
                         txtServerPort.Focus();
                         txtServerPort.SelectAll();
                         return;
@@ -570,7 +585,11 @@
                     if (currentConfig.ServerPort < 0 || currentConfig.ServerPort > 65535)
                     {   // Value to high or to low
                         tabClientProperties.SelectTab("tabRdp");
-                        MessageBox.Show("Invalid server port!");
+                        MessageBox.Show("Invalid server port!");                       
+                            using (log4net.NDC.Push(string.Format("serverport={0}", txtServerPort.Text)))
+                            {
+                                Logging.ATSAdminLog.ErrorFormat("Invalid server port!");
+                            }                        
                         txtServerPort.Focus();
                         txtServerPort.SelectAll();
                         return;
@@ -601,10 +620,17 @@
             {
                 currentConfig.ScreenResolutionX = Int32.Parse(txtScreenResX.Text.Trim());
             }
-            catch (Exception)
+            catch (Exception ex)
             {
                 tabClientProperties.SelectTab("TabInterface");
                 MessageBox.Show("Invalid screen resolution!");
+                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("ScreenResolutionX={0}", txtScreenResX.Text)))
+                    {
+                        Logging.ATSAdminLog.ErrorFormat("Invalid X screen resolution!");
+                    }
+                }
                 txtScreenResX.Focus();
                 txtScreenResX.SelectAll();
                 return;
@@ -613,6 +639,12 @@
             {   // Value to high or to low
                 tabClientProperties.SelectTab("TabInterface");
                 MessageBox.Show("Invalid screen resolution!");
+
+                using (log4net.NDC.Push(string.Format("ScreenResolutionX={0}", txtScreenResX.Text)))
+                {
+                    Logging.ATSAdminLog.ErrorFormat("Invalid X screen resolution!");
+                }
+                
                 txtScreenResX.Focus();
                 txtScreenResX.SelectAll();
                 return;
@@ -622,10 +654,17 @@
             {
                 currentConfig.ScreenResolutionY = Int32.Parse(txtScreenResY.Text.Trim());
             }
-            catch (Exception)
+            catch (Exception ex)
             {
                 tabClientProperties.SelectTab("TabInterface");
                 MessageBox.Show("Invalid screen resolution!");
+                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("ScreenResolutionY={0}", txtScreenResY.Text)))
+                    {
+                        Logging.ATSAdminLog.ErrorFormat("Invalid Y screen resolution!");
+                    }
+                }
                 txtScreenResY.Focus();
                 txtScreenResY.SelectAll();
                 return;
@@ -634,6 +673,10 @@
             {   // Value to high or to low
                 tabClientProperties.SelectTab("TabInterface");
                 MessageBox.Show("Invalid screen resolution!");
+                using (log4net.NDC.Push(string.Format("ScreenResolutionY={0}", txtScreenResY.Text)))
+                {
+                    Logging.ATSAdminLog.ErrorFormat("Invalid Y screen resolution!");
+                }
                 txtScreenResY.Focus();
                 txtScreenResY.SelectAll();
                 return;

 

  ViewVC Help
Powered by ViewVC 1.1.22