using System; using CoreSavingLibrary; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Collections.Generic; using DataLibrary; using System.Globalization; namespace Saving.CustomControl { public partial class TopBarControl : System.Web.UI.UserControl { //important js protected String bgImageUrl = ""; //used 1 public String LoadBegin(WebState state, XmlConfigService xml, DateTime dtTime, bool dbConnected) { String timming = ""; bgImageUrl = state.SsUrl + "Image/topbar.jpg"; XmlService xs = new XmlService(WebUtil.GetGcoopPath()); XmlConnection xc = xs.GetXmlConnection(state.SsConnectionIndex); LbDbProfile.Text = xc.Profile + " " + (xml.SavShowDbProfile ? "[" + xc.UserService + "]" : ""); LbWorkDate.Text = state.SsWorkDate.ToString("dd-MM-yyyy", new CultureInfo("th-TH")); LbApplication.Text = string.IsNullOrEmpty(state.SsApplication) ? "NULL" : state.SsApplication.ToUpper(); LbUsername.Text = state.SsUsername.ToUpper() + "@" + state.SsCoopId; LbIpAddress.Text = state.SsClientIp; TimeSpan timeEnd = DateTime.Now - dtTime; timming = timeEnd.TotalSeconds.ToString("0.00"); LbLoadTime.Text = "  |   Load: " + timming; return timming; } public void SetLog(int status, String message) { LbLog.Text = status.ToString(); LbLog.ToolTip = message; } } }