public MainWindow() { try { db.C_Users.ToList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } InitializeComponent(); var s = new Singelton(); Singelton.Frame = RfitFrame; Singelton.MainWindow = this; db.C_Setting.Single().ImportInBdSetting(); Singelton.WatcherSetting.StartWatching(); db.SaveChanges(); var p = new StartUpPage(); Singelton.Frame.NavigationService.Navigate(p); }
private void Authorize_Click(object sender, RoutedEventArgs e) { try { using (var db = new RfidContext()) { var rfid = Convert.ToInt64(TBGetRfidId.Text); var dsd = db.Database.SqlQuery <M_Users>(new SqlSearchUserForRfid().SQl_SearchUserForRfid, rfid) .SingleOrDefault(); Singelton.AuthorizedUser = dsd; } } catch { MessageBox.Show((string)Application.Current.Resources[StringsMapper.ErrorUserNFound], (string)Application.Current.Resources[StringsMapper.ErrorHeader], MessageBoxButton.OK, MessageBoxImage.Error); } var p = new StartUpPage(); Singelton.Frame.Navigate(p); }