Пример #1
0
        private void LogBtn_Click(object sender, EventArgs e)
        {
            loginForm login = new loginForm();

            login.StartPosition = FormStartPosition.CenterParent;
            login.ShowDialog();
            login.Dispose();
        }
Пример #2
0
        //private void OpenDocument_ShowObject1(object sender, object e)
        //{
        //    if (e is MetroUserControl)
        //        menuControl.Show(e);
        //    else
        //        userControlHelper.ShowControl(e as Control, true, OpenControlHelper.ControlPosition.Center, this as Control);
        //}

        protected override void OnLoad(EventArgs e)
        {
            var configFound = ActivationManager.Load();

            // Mi connetto al Database
            GlobalInfo.DBaseInfo.dbManager = new SqlManager();
            if (!GlobalInfo.DBaseInfo.dbManager.CreateConnection())
            {
                this.Close();
                return;
            }

            GlobalInfo.globalPref = new PreferencesManager <GlobalPreferences>("", null).ReadPreference();
            if (GlobalInfo.globalPref.ForceLanguage)
            {
                var lang = Enum.GetName(typeof(Languages), GlobalInfo.globalPref.Language).Replace('_', '-');
                System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang, false);
            }
            ControlBox = GlobalInfo.globalPref.ShowControlBox;

            metroStyleManager.Style       = GlobalInfo.globalPref.CustmColor;
            StyleManager.Style            = GlobalInfo.globalPref.CustmColor;
            GlobalInfo.StyleManager.Style = GlobalInfo.globalPref.CustmColor;
            metroStyleManager.Update();

            this.StyleManager.Clone(menuControl);
            metroStyleManager.Update();

            // Carico l'attivazione
            if (!configFound)
            {
                if (!ShowRegistrationForm())
                {
                    this.Close();
                }
                return;
            }

            // Faccio la login
            // Controllo se devo saltarla
            using (var login = new loginForm())
            {
                this.StyleManager.Clone(login);
                if (!GlobalInfo.LoginInfo.RememberLastLogin || !login.CheckUser(GlobalInfo.LoginInfo.LastUser, GlobalInfo.LoginInfo.LastPassword))
                {
                    if (login.ShowDialog() != DialogResult.OK)
                    {
                        this.Close();
                        return;
                    }
                }
            }
            base.OnLoad(e);
        }
 public Form1()
 {
     InitializeComponent();
     while (!user.isLoggedIn())
     {
         loginForm login  = new loginForm();
         var       result = login.ShowDialog();
         if (result == DialogResult.Cancel)
         {
             break;
         }
     }
 }
Пример #4
0
        public MainWindow()
        {
            InitializeComponent();

            loginForm login = new loginForm();

            login.ShowDialog();
            if (login.DialogResult == true)
            {
                data.getAllMembers();
                data.getBookItems();
                data.getBooks();
            }
            ;
            data.getAllMembers();
            data.getBookItems();
            data.getBooks();
            HomePage.DataContext                   = homePageViewModel;
            RenewForm.ToggleForm                  += ToggleForm;
            ReturnBookForm.ToggleForm             += ToggleForm;
            ReturnFullInfor.ToggleForm            += ToggleForm;
            CheckOutConfirm.ToggleForm            += ToggleForm;
            ReseverBookForm.ToggleForm            += ToggleForm;
            ReserveConfirm.ToggleForm             += ToggleForm;
            AddBookForm.ToggleForm                += ToggleForm;
            DeleteBookBoard.ToggleForm            += ToggleForm;
            EditBook.ToggleForm                   += ToggleForm;
            CurrentMemberReserverBooks.ToggleForm += ToggleForm;
            AddBookSuccessForm.ToggleForm         += ToggleForm;

            AddNewMemberForm.ToggleForm += ToggleForm;
            BlockConfirm.ToggleForm     += ToggleForm;
            UnBlockConfirm.ToggleForm   += ToggleForm;
            DeleteConfirn.ToggleForm    += ToggleForm;
            AddSuccess.ToggleForm       += ToggleForm;
            EditForm.ToggleForm         += ToggleForm;

            LibrarianEdit.ToggleForm += ToggleForm;

            LibrarianIconNavigationViewModel.updatebar += LibrarianIconNavigationViewModel_updatebar;
            LibrarianBar.logout += LibrarianBar_logout;


            HomeNavigationViewModel.ChangePage += HomeNavigationViewModel_ChangePage;
            this.DataContext = new MemberViewModel();
        }
Пример #5
0
        private void Index_Load(object sender, EventArgs e)
        {
            relogio.Enabled = true;

            this.Hide();

            loginForm loginForm = new loginForm();

            if (loginForm.ShowDialog() == DialogResult.OK)
            {
                UsuarioModel user = (UsuarioModel)loginForm.Tag;

                labelDadosUsuario.Text = "Usuário logado: " + user.Login;
                this.Show();
            }
            else
            {
                this.Close();
            }
        }