private void setDefault() { #region Variable var clsSQL = new clsSQL(); #endregion #region Procedure dtFrom.Value = new DateTime(DateTime.Now.AddDays(-1).Year, DateTime.Now.AddDays(-1).Month, DateTime.Now.AddDays(-1).Day, 0, 0, 0); dtTo.Checked = false; lblFooterDetail.Text = string.Format("Server : {0}", clsSQL.getAppSettingServerName(clsGlobal.cs)); #endregion }
private void setDefault() { #region Variable var clsSQL = new clsSQL(); #endregion #region Procedure lblHeader.Text = clsGlobal.ApplicationName+" v."+clsGlobal.ApplicationVersion; lblSubHeader.Text = "ศูนย์รวมบริหารและจัดการเซิฟเวอร์สำหรับรีโมท"; lblFooterDetail.Text = string.Format("Server : {0}", clsSQL.getAppSettingServerName(clsGlobal.cs)); ttDefault.SetToolTip(btMinimize, "ย่อหน้าต่าง"); ttDefault.SetToolTip(btClose, "ออกจากโปรแกรม"); ttDefault.SetToolTip(btMove, "ย้ายตำแหน่งหน้าต่าง"); ttDefault.SetToolTip(btReport, "ดูรายงาน"); if (!getAdminChecker()) btReport.Visible = false; txtUsername.Text = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName+@"\"+clsGlobal.WindowsLogonBuilder(); var savePassword = System.Configuration.ConfigurationManager.AppSettings["savePassword"]; if (savePassword.Trim() != "") { var clsSecurity = new clsSecurity(); txtPassword.Text = clsSecurity.Decrypt(savePassword); } if (clsGlobal.ServerMode) { try { txtUsername.Enabled = false; txtPassword.Enabled = false; lvServerList.Visible = false; tbContent.RowStyles[1].Height = 0; tmDefault.Enabled = true; tmDefault.Start(); } catch(Exception ex) { try { wsDefault.ServiceSoapClient wsDefault = new wsDefault.ServiceSoapClient(); wsDefault.MailSend(System.Configuration.ConfigurationManager.AppSettings["mailTo"], clsGlobal.ApplicationName, "<h2>" + clsGlobal.IPAddress() + "</h2>" + ex.Message, "*****@*****.**", System.Configuration.ConfigurationManager.AppSettings["siteCode"] + " : " + clsGlobal.ApplicationName, "", "", "", false); } catch (Exception) { } } } else { lvSession.Visible = false; tbContent.RowStyles[0].Height = 0; tmClient.Enabled = true; tmClient.Start(); } #endregion }