public MainScreen() { LogManager.WriteLog("MainScreen() (START)", LogManager.enumLogLevel.Info); GC.Collect(); InitializeComponent(); btn_Notifications.Visibility = Visibility.Collapsed; ActiveInstance = this; MessageBox.parentOwner = this; LicenseScreenActive = false; CheckAppLaucherStatus(); _loadView += new Action<string>(this.LoadView); _listSelectionChanged += new Action<object, SelectionChangedEventArgs>(this.ListBoxSelectionChanged); CPerformDrop.BusyPropertyChanged += new PropertyChangedEventHandler(propChangedEventHandler); CDeclaration.BusyPropertyChanged += new PropertyChangedEventHandler(propChangedEventHandler); _enableControls += new Action<bool>(this.EnableControls); ColorBrush(); IsMinimizeBtnEnabled = CheckMinimizeBtnEnabled(); if (!IsMinimizeBtnEnabled) { btnMinimize.Visibility = Visibility.Collapsed; } #if INBUILD_XML Uri xmlUri = new Uri("/XMLData/Menudata.xml", UriKind.Relative); if (string.Compare(((App)Application.Current).CurrentCultureName, "en-US", true) != 0) { xmlUri = new Uri("/XMLData/Menudata_" + ((App)Application.Current).CurrentCultureName + ".XML", UriKind.Relative); } var xmlDataProvider = new XmlDataProvider { Source = xmlUri, IsAsynchronous = false, XPath = "/Root/ImageList/Image" }; #else string baseUri = Path.GetDirectoryName(typeof(MainScreen).Assembly.Location); string xmlUri = Path.Combine(baseUri, "Menudata.xml"); if (string.Compare(((App)Application.Current).CurrentCultureName, "en-US", true) != 0) { xmlUri = Path.Combine(baseUri, "Menudata_" + ((App)Application.Current).CurrentCultureName + ".XML"); } XmlDocument doc = new XmlDocument(); doc.Load(xmlUri); var xmlDataProvider = new XmlDataProvider { Document = doc, IsAsynchronous = false, XPath = "/Root/ImageList/Image" }; #endif _exchangeConnectionString = oCommonUtilities.CreateInstance().GetConnectionString(); lstLeftPane.ItemsSource = xmlDataProvider.Data as IEnumerable; bool isThemeRequiered = false; //Boolean.TryParse(BMC.Common.ConfigurationManagement.ConfigManager.Read("ThemeRequiered"),out isThemeRequiered); //if (isThemeRequiered) // btnTheme.Visibility = Visibility.Visible; //else btnTheme.Visibility = Visibility.Collapsed; _bLogout = false; lblDate.Visibility = Visibility.Hidden; lblwelcome.Visibility = Visibility.Hidden; if (oCommonUtilities.CreateInstance().GetSiteDetails() != null) _site = oCommonUtilities.CreateInstance().GetSiteDetails().Tables[0]; if ((_site != null) && (_site.Rows.Count > 0)) { lblPropertyName.Content = _site.Rows[0]["Name"] + " - " + _site.Rows[0]["Code"]; Settings.SiteCode = _site.Rows[0]["Code"].ToString(); Settings.SiteName = _site.Rows[0]["Name"].ToString(); Settings.Site_Address_1 = _site.Rows[0]["Site_Address_1"].ToString(); Settings.Site_Address_2 = _site.Rows[0]["Site_Address_2"].ToString(); string str_Header = ""; if (Settings.PrintHeaderFormat != null && Settings.PrintHeaderFormat != string.Empty) { foreach (string s in Settings.PrintHeaderFormat.Split(new string[1] { ";" }, StringSplitOptions.RemoveEmptyEntries)) { if (_site.Rows[0][s] != null) { str_Header += _site.Rows[0][s] + " "; } } str_Header = str_Header.Remove(str_Header.Length - 1, 1); Settings.PrintHeaderFormat = str_Header; } else { Settings.PrintHeaderFormat = Settings.SiteName; } } int nTimeOutSeconds = Settings.AUTOLOGOFF_TIMEOUT; timerLogoff = new System.Windows.Forms.Timer { Interval = 1000, Enabled = true }; timerLogoff.Tick += (sender, e) => { if (IdleTime.Milliseconds <= nTimeOutSeconds) return; if (PromotionActiveElement != null || CDeclaration.IsBusy || CPerformDrop.IsBusy) { return; } timerLogoff.Stop(); if (TimerMessageBox.ShowBox() == "NO") { LogOffScreen(); } else timerLogoff.Start(); }; #if! FLOORVIEW_REFRESH_NEW App.siteLicensingClient.SendToServer(App.siteLicensingClientObj, null); App.siteLicensingClientObj.ClientReceived += new ClientReceivedEvent(clientObj_SiteLicensingClientReceived); #else this.InitClientSubscriber(); #endif _serviceDetails = new SortedDictionary<string, ServiceDetail>(StringComparer.InvariantCultureIgnoreCase); CheckForLicenseActivation(); LogManager.WriteLog("Timer Started for AutoLogoff", LogManager.enumLogLevel.Info); LogManager.WriteLog("MainScreen() (END)", LogManager.enumLogLevel.Info); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Window = ((BMC.Presentation.MainScreen)(target)); #line 2 "..\..\MainScreen.xaml" this.Window.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden #line 2 "..\..\MainScreen.xaml" this.Window.Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); #line default #line hidden return; case 2: this.LayoutRoot = ((System.Windows.Controls.Grid)(target)); return; case 3: this.pnlLeftPane = ((System.Windows.Controls.Border)(target)); return; case 4: this.lstLeftPane = ((System.Windows.Controls.ListBox)(target)); #line 88 "..\..\MainScreen.xaml" this.lstLeftPane.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.lstLeftPane_SelectionChanged); #line default #line hidden return; case 5: this.grid = ((System.Windows.Controls.Grid)(target)); return; case 6: this.btnAppLauncher = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 7: this.btnAbout = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 8: this.btnReset = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 9: this.btnPassword = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 10: this.lblSpace = ((System.Windows.Controls.Label)(target)); return; case 11: this.btnLicenseActivation = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 12: this.btnTheme = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 13: this.btnShutdown = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 14: this.btnLogout = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 15: this.btnMinimize = ((BMC.Presentation.ControlBoxButtons)(target)); return; case 16: this.pnlStatus = ((System.Windows.Controls.Grid)(target)); return; case 17: this.lblwelcome = ((System.Windows.Controls.TextBlock)(target)); return; case 18: this.lblUsername = ((System.Windows.Controls.TextBlock)(target)); return; case 19: this.btn_Notifications = ((System.Windows.Controls.Button)(target)); #line 196 "..\..\MainScreen.xaml" this.btn_Notifications.Click += new System.Windows.RoutedEventHandler(this.btn_Notifications_Click); #line default #line hidden return; case 20: this.txt_NotificationText = ((System.Windows.Controls.TextBlock)(target)); return; case 21: this.btnServices = ((System.Windows.Controls.Button)(target)); #line 211 "..\..\MainScreen.xaml" this.btnServices.Click += new System.Windows.RoutedEventHandler(this.btnServices_Click); #line default #line hidden return; case 22: this.lblDatabase = ((System.Windows.Controls.TextBox)(target)); return; case 23: this.lblDate = ((System.Windows.Controls.TextBlock)(target)); return; case 24: this.lblPropertyName = ((System.Windows.Controls.Label)(target)); return; case 25: this.pnlContent = ((System.Windows.Controls.Grid)(target)); return; case 26: this.btnExit = ((System.Windows.Controls.Button)(target)); #line 235 "..\..\MainScreen.xaml" this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btnExit_Click); #line default #line hidden return; } this._contentLoaded = true; }
public CCoinDispenser(MainScreen mainScreen) { InitializeComponent(); _mainScreen = mainScreen; }
private void LoginApplication() { try { AuditViewerBusiness.CreateInstance(oCommonUtilities.CreateInstance().GetConnectionString()); if (txtUname.Text.ToUpper() == "CASH" && txtPWD.Password.ToUpper() == "DESK") { var userObect = new Security.Manager.UserManager(oCommonUtilities.CreateInstance().GetConnectionString()); SecurityHelper.CurrentUser = userObect.GetUserObject(txtUname.Text, txtUname.Text, txtUname.Text); SecurityHelper.CurrentUser.UserName = txtUname.Text; SecurityHelper.CurrentUser.SecurityUserID = 0; SecurityHelper.CurrentUser.User_No = 0; ExtensionMethods.CurrentCurrenyCulture = ConfigManager.Read("GetDefaultCultureForCurrency"); ExtensionMethods.CurrentDateCulture = ConfigManager.Read("GetDefaultCultureForDate"); if (!IsLicenseValid()) { //Close(); Clear(); return; } var objMainScreen = new MainScreen { UserName = txtUname.Text }; objMainScreen.LoginInstance = this; objMainScreen.Show(); Close(); objMainScreen.DisposeLoginInstanceIfAny(); } else if (txtUname.Text.ToUpper() == "BALLY" && CheckBallyuser(txtUname.Text, txtPWD.Password)) { SecurityHelper.CreateInstance(oCommonUtilities.CreateInstance().GetConnectionString(), false); var userObect = new Security.Manager.UserManager(oCommonUtilities.CreateInstance().GetConnectionString()); SecurityHelper.CurrentUser = userObect.GetUserObject(txtUname.Text, txtUname.Text, txtUname.Text); SecurityHelper.CurrentUser.UserName = txtUname.Text; SecurityHelper.CurrentUser.SecurityUserID = 0; ExtensionMethods.CurrentCurrenyCulture = ConfigManager.Read("GetDefaultCultureForCurrency"); ExtensionMethods.CurrentDateCulture = ConfigManager.Read("GetDefaultCultureForDate"); if (!IsLicenseValid()) { Clear(); return; } var objMainScreen = new MainScreen { UserName = txtUname.Text }; objMainScreen.LoginInstance = this; objMainScreen.Show(); Close(); objMainScreen.DisposeLoginInstanceIfAny(); } else { var loginResult = Checkuser(txtUname.Text, txtPWD.Password); if (loginResult == SecurityHelper.LoginResults.LoginSuccesful) { ((App)Application.Current).CurrentCultureName = SecurityHelper.GetCultureInfo(SecurityHelper.CurrentUser.SecurityUserID); ExtensionMethods.CurrentCurrenyCulture = SecurityHelper.GetCurrencyCultureInfo(SecurityHelper.CurrentUser.SecurityUserID); ExtensionMethods.CurrentDateCulture = SecurityHelper.GetDateCultureInfo(SecurityHelper.CurrentUser.SecurityUserID); if (string.IsNullOrEmpty(ExtensionMethods.CurrentCurrenyCulture)) ExtensionMethods.CurrentCurrenyCulture = ConfigManager.Read("GetDefaultCultureForCurrency"); if (string.IsNullOrEmpty(ExtensionMethods.CurrentDateCulture)) ExtensionMethods.CurrentDateCulture = ConfigManager.Read("GetDefaultCultureForDate"); GetInitialSettings(); GetAppSettings(); if (!IsLicenseValid()) { Clear(); return; } var objMainScreen = new MainScreen { UserName = SecurityHelper.CurrentUser.UserName }; objMainScreen.LoginInstance = this; objMainScreen.Show(); GetConnectedSites(); Audit("Login Successful for User-" + SecurityHelper.CurrentUser.DisplayName); Close(); objMainScreen.DisposeLoginInstanceIfAny(); } else { if (loginResult == SecurityHelper.LoginResults.IsUserTerminated) { MessageBox.ShowBox("MessageID446", BMC_Icon.Error); Audit("Account Terminated for User-" + txtUname.Text); } else if ((loginResult == SecurityHelper.LoginResults.PasswordExpired) || (loginResult == SecurityHelper.LoginResults.LoginReset)) { if (loginResult == SecurityHelper.LoginResults.PasswordExpired) { MessageBox.ShowBox("MessageID267", BMC_Icon.Information); Audit("Password expired for User-" + txtUname.Text); } else { MessageBox.ShowBox("MessageID268", BMC_Icon.Information); Audit("Password Reset for User-" + txtUname.Text); } var passwordRetry = new PasswordRetry(SecurityHelper.CurrentUser.SecurityUserID); if (passwordRetry.ShowDialogEx(this) == true) { ((App)Application.Current).CurrentCultureName = SecurityHelper.GetCultureInfo(SecurityHelper.CurrentUser.SecurityUserID); ExtensionMethods.CurrentCurrenyCulture = SecurityHelper.GetCurrencyCultureInfo(SecurityHelper.CurrentUser.SecurityUserID); ExtensionMethods.CurrentDateCulture = SecurityHelper.GetDateCultureInfo(SecurityHelper.CurrentUser.SecurityUserID); if (string.IsNullOrEmpty(ExtensionMethods.CurrentCurrenyCulture)) ExtensionMethods.CurrentCurrenyCulture = ConfigManager.Read("GetDefaultCultureForCurrency"); if (string.IsNullOrEmpty(ExtensionMethods.CurrentDateCulture)) ExtensionMethods.CurrentDateCulture = ConfigManager.Read("GetDefaultCultureForDate"); GetInitialSettings(); GetAppSettings(); if (!IsLicenseValid()) { Clear(); return; } var objMainScreen = new MainScreen { UserName = SecurityHelper.CurrentUser.UserName }; objMainScreen.Owner = this; objMainScreen.Show(); Hide(); } } else if (loginResult == SecurityHelper.LoginResults.MaxAttemptsExceeded) { MessageBox.ShowBox("MessageID269", BMC_Icon.Error); Audit("Account Locked for User-" + txtUname.Text); } else { MessageBox.ShowBox("MessageID3"); Audit("Invalid Login attempt for User-" + txtUname.Text); } } } } catch (Exception ex) { ExceptionManager.Publish(ex); MessageBox.ShowBox("MessageID3"); } }