Пример #1
0
 public TeamUI(ColaboratorUI colabUI)
 {
     instance     = Instance.GetInstance;
     this.colabUI = colabUI;
     InitializeComponent();
     loadTeams();
 }
Пример #2
0
        private void BtnLogIn_Click(object sender, EventArgs e)
        {
            string email    = this.TxtEmail.Text;
            string password = this.TxtPassword.Text;

            try
            {
                if (RdoColaborator.Checked)
                {
                    instance.Session = instance.SessionHandler.LogInColaborator(email, password);
                    ColaboratorUI colaboratorUI = new ColaboratorUI();
                    colaboratorUI.Show();
                    this.Hide();
                }
                else if (RdoAdmin.Checked)
                {
                    instance.Session = instance.SessionHandler.LogInAdministrator(email, password);
                    AdministratorUI administratorUI = new AdministratorUI();
                    administratorUI.Show();
                    this.Hide();
                }
            }
            catch (UserException ex)
            {
                String msgError = ex.Message;
                MessageBox.Show(msgError, "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #3
0
        private void BtnCancel_Click(object sender, EventArgs e)
        {
            Type typeOfUser = instance.Session.user.GetType();

            if (typeOfUser.Equals(typeof(Administrator)))
            {
                AdministratorUI administratorUI = new AdministratorUI();
                administratorUI.Show();
                this.Hide();
            }
            else
            {
                ColaboratorUI colaboratorUI = new ColaboratorUI();
                colaboratorUI.Show();
                this.Hide();
            }
        }