Пример #1
0
        private void TryLogin()
        {
            int login  = DBMethods.TryLogin(txtUser.Text, txtPass.Text);
            int userID = DBMethods.GetUserID(txtUser.Text);

            if (login == 0) //login failed
            {
                MessageBox.Show("Wrong username or password");
            }
            else //login successful
            {
                this.Hide();
                if (login == 3) //corporate
                {
                    FormMainCorporate f = new FormMainCorporate(userID, _DomainController);
                    f.Show();
                }
                else //not corporate
                {
                    FormMain formMain = new FormMain(userID, _DomainController);
                    formMain.Show();
                    if (login == 1) //admin
                    {
                        FormAdmin formAdmin = new FormAdmin(_DomainController, formMain);
                        formAdmin.Show();
                    }
                }
            }
        }
Пример #2
0
 public FormManageTypesCorporate(DomainController dc, int userID, FormMainCorporate fm)
 {
     InitializeComponent();
     this.dc     = dc;
     this.UserID = userID;
     this.fm     = fm;
     UpdateCategoryListBoxs();
     listExpenseCategories2.SelectedIndex = -1;
 }
Пример #3
0
        private void BtnShow_Click(object sender, EventArgs e)
        {
            _MainUI.Close();

            int userID = DBMethods.GetUserID(listUsers.Text);

            if (DBMethods.GetAccountType(userID) == "Corporate")
            {
                FormMainCorporate f = new FormMainCorporate(userID, _DomainController);
                f.Show();
                _MainUI = f;
            }
            else
            {
                FormMain f = new FormMain(userID, _DomainController);
                f.Show();
                _MainUI = f;
            }
        }