Пример #1
0
        public Home()
        {
            InitializeComponent();
            this.grafoService    = DependencyFactory.Resolve <IGrafoService>();
            this.aulaService     = DependencyFactory.Resolve <IAulaService>();
            this.dataBaseService = DependencyFactory.Resolve <IDataBaseService>();

            try
            {
                Configuracoes.CarregarInfosArquivo();
                this.IniciarConexaoBanco();
            }
            catch
            {
                DialogResult resultado = MessageBox.Show("Falha na leitura do arquivo de configuração. " +
                                                         "Deseja abrir as configurações agora ?", "Config file", MessageBoxButtons.YesNo,
                                                         MessageBoxIcon.Question);
                if (resultado == DialogResult.Yes)
                {
                    this.configuracoes.ShowDialog();
                }
                else
                {
                    return;
                }
            }

            try
            {
                this.login           = new Login();
                this.sobre           = new Sobre();
                this.buscarUsuario   = new BuscaUsuario();
                this.cadastroUsuario = new FormUsuario(0);
                this.editarUsuario   = new FormEditarUsuario();
                this.buscarPerfil    = new BuscarPerfil();
                this.formperfil      = new FormEditarPerfil();

                this.login.FormClosed         += Login_FormClosed;
                this.editarUsuario.FormClosed += EditarUsuario_FormClosed;
                this.periodos    = new HashSet <string>();
                this.materias    = new HashSet <string>();
                this.professores = new HashSet <string>();
                this.dias        = new HashSet <string>();
                this.horarios    = new HashSet <string>();

                this.AcoesLogout();
            }
            catch
            {
                DialogResult resultado = MessageBox.Show("Houve um problema na abertura do sistema. conecte ao banco e abra o aplicativo novamente", "Config file",
                                                         MessageBoxButtons.OK, MessageBoxIcon.Question);
                this.Close();
            }

            this.btnCadastrar.Visible     = false;
            this.btnBuscarUsuario.Visible = false;
            this.btnPerfil.Visible        = false;
        }
Пример #2
0
        public Home()
        {
            InitializeComponent();
            this.grafoService = DependencyFactory.Resolve <IGrafoService>();
            this.aulaService  = DependencyFactory.Resolve <IAulaService>();

            try
            {
                this.periodos    = new HashSet <string>();
                this.materias    = new HashSet <string>();
                this.professores = new HashSet <string>();
                this.dias        = new HashSet <string>();
                this.horarios    = new HashSet <string>();
            }
            catch
            {
                DialogResult resultado = MessageBox.Show("Houve um problema na abertura do sistema.", "Config file",
                                                         MessageBoxButtons.OK, MessageBoxIcon.Question);
                this.Close();
            }
        }