Exemple #1
0
        private void btnVENTAS_Click(object sender, EventArgs e)
        {
            using (BDAPOLOFEEntities db = new BDAPOLOFEEntities())
            {
                try
                {
                    string username = this.txtusuer.Text.Trim();
                    string password = this.txtclave.Text.Trim();
                    int    empresa  = Convert.ToInt32(this.cmb_empresa.SelectedValue);

                    var validacion = (from c in db.APOPERADOR
                                      where (c.CODIGO == username && c.CLAVE == password && c.EMPRESA == empresa)
                                      select c);

                    int resultado = validacion.Count();

                    if (resultado == 1)
                    {
                        FormMenu f = new FormMenu(Convert.ToInt32(this.cmb_empresa.SelectedValue), this.cmb_empresa.SelectedText);
                        f.WindowState = FormWindowState.Maximized;
                        f.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Datos Incorrectos", "Sistema Apolo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Sistema Apolo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemple #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new FormMineSweeper());

            //Models
            M_jogador = new Jogador();
            M_menu    = new Menu();
            M_mapa    = new Mapa();
            M_Login   = new Login();

            //Views
            V_Menu            = new FormMenu();
            V_Mapa            = new FormMineSweeper();
            V_Instrucoes      = new Instrucoes();
            V_Login           = new FormLogin();
            V_OnOff           = new FormOnOff();
            V_PedirNome       = new PedirNome();
            V_ConsultarPerfil = new FormConsultarPerfil();

            //Controllers
            C_menu  = new ControllerMenu();
            C_mapa  = new ControllerMapa();
            C_Login = new ControllerLogin();

            Application.Run(V_OnOff);
        }
Exemple #3
0
 static void Main()
 {
     // 判断配置文件是否存在
     if (File.Exists(Application.StartupPath + "\\HJZBYSJ.ini"))
     {
         // 从配置文件中读取连接字符串的参数值
         MrOwlIniFile iniFile = new MrOwlIniFile(Application.StartupPath + "\\HJZBYSJ.ini");
         string       str     = "";
         iniFile.GetValueOfKey("Connection", "Server", ref MrOwlDB_SQLserver.server);
         iniFile.GetValueOfKey("Connection", "Database", ref MrOwlDB_SQLserver.database);
         iniFile.GetValueOfKey("Connection", "User", ref MrOwlDB_SQLserver.user);
         iniFile.GetValueOfKey("Connection", "Password", ref MrOwlDB_SQLserver.password);
     }
     else
     {
         MrOwlDB_SQLserver.server   = "";
         MrOwlDB_SQLserver.database = "";
         MrOwlDB_SQLserver.user     = "";
         MrOwlDB_SQLserver.password = "";
         MessageBox.Show("未找到配置文件.");
     }
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     frmMenu = new FormMenu();
     Application.Run(frmMenu);
 }
Exemple #4
0
 private void btnDangNhap_Click(object sender, EventArgs e)
 {
     if (txtTaiKhoan.Text == "" || txtMatKhau.Text == "")
     {
         MessageBox.Show("Nhập tài khoản mật khẩu", "Thông báo");
     }
     else
     {
         UserDTO u = new UserDTO();
         u.TaiKhoan = txtTaiKhoan.Text;
         u.MatKhau  = txtMatKhau.Text;
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             if (dt.Rows[i]["TaiKhoan"].ToString() == u.TaiKhoan && dt.Rows[i]["MatKhau"].ToString() == u.MatKhau)
             {
                 FormMenu frm = new FormMenu();
                 frm.TaiKhoan    = u.TaiKhoan;
                 frm.MatKhau     = u.MatKhau;
                 frm.FormClosed += new FormClosedEventHandler(frm_FormClose);
                 frm.Show();
                 this.Hide();
                 return;
                 //closeForm();
             }
         }
         MessageBox.Show("Sai tài khoản mật khẩu", "Thông báo");
         txtMatKhau.Text  = "";
         txtTaiKhoan.Text = "";
     }
 }
Exemple #5
0
        private void cancelarBtn_Click(object sender, EventArgs e)
        {
            FormMenu inicio = new FormMenu();

            this.Hide();
            inicio.ShowDialog();
            this.Close();
        }
        private void btnVolver_Click(object sender, EventArgs e)
        {
            this.Hide();
            FormMenu mainMenu = new FormMenu();

            mainMenu.Show();
            this.Dispose();
        }
        private void goToMenu()
        {
            FormMenu formMenu = new FormMenu();

            this.Hide();
            formMenu.ShowDialog();
            this.Close();
        }
        private void volverButton_Click(object sender, EventArgs e)
        {
            FormMenu inicio = new FormMenu();

            this.Hide();
            inicio.ShowDialog();
            this.Close();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            FormMenu menu = new FormMenu();

            this.Hide();
            menu.ShowDialog();
            this.Close();
        }
Exemple #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            Top10    top10 = new Top10();
            FormMenu menu  = new FormMenu();

            top10.Dispose();
            menu.Show();
        }
Exemple #11
0
        private void btnCancelar_Click(object sender, EventArgs e)
        {
            FormMenu menu = new FormMenu();

            this.Hide();
            menu.ShowDialog();
            this.Close();

            /* esto se deberia adaptar segun el loguin del admin y los hoteles q administra (al que quiere modificar)*/
        }
Exemple #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Ir a un Form y cargar solo las funcionalidades que tenga el usuario.
            usuario.Id_Rol = Convert.ToInt32(comboBox1.SelectedValue.ToString());
            FormMenu formMenu = new FormMenu(usuario);

            this.Hide();
            formMenu.ShowDialog();
            this.Close();
        }
Exemple #13
0
        public TicTacToe()
        {
            _gameControllers = new List <GameController>();
            _viewControllers = new List <ViewController>();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            _menu = new FormMenu(this);

            Application.Run(_menu);
        }
Exemple #14
0
 private void btnMaestros_Click(object sender, EventArgs e)
 {
     if (clienteConectado)
     {
         FormMenu frm2 = new FormMenu();
         frm2.ShowDialog();
     }
     else
     {
         MessageBox.Show("Debe conectarse primero con el servidor", "No es posible realizar la acción solicitada", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Exemple #15
0
        public void LoginEstudante(string email, string senha)
        {
            try
            {
                string sqlLeitura = @"select * from estudante
                                      where email = @email and senha = @senha";

                MySqlCommand cmdMysql = new MySqlCommand(sqlLeitura, connection);

                cmdMysql.Parameters.AddWithValue("@email", email);
                cmdMysql.Parameters.AddWithValue("@senha", senha);

                connection.Open();

                MySqlDataReader data = cmdMysql.ExecuteReader();

                if (data.Read())
                {
                    string nivelAcesso = data.GetString("nivel_acesso");
                    id = int.Parse(data.GetString("id_estudante"));
                    if (nivelAcesso.Equals("Estudante"))
                    {
                        FormMenu menu = new FormMenu();
                        menu.MenuEmpresas.Enabled     = false;
                        menu.MenuEmpresas.Visible     = false;
                        menu.btnMaisIndicados.Visible = false;
                        CandidaturaDAO candidatura = new CandidaturaDAO();
                        menu.dgvMinhasVagas.DataSource = candidatura.RecuperarMinhasVagas(id);
                        VagaestagioDAO vaga = new VagaestagioDAO();
                        menu.dgvVagasOuEstudantes.DataSource = vaga.ReadVaga();
                        menu.cbVaga.DataSource    = vaga.ReadVaga();
                        menu.cbVaga.DisplayMember = "ID";
                        EstudantesDAO estudante = new EstudantesDAO();
                        menu.cbId.DataSource    = estudante.ReadEstudantes2(id);
                        menu.cbId.DisplayMember = "ID";
                        menu.cbId.Enabled       = false;
                        menu.Show();
                        connection.Close();
                    }
                }
                else
                {
                    MessageBox.Show("Email ou senha incorretos!");
                    connection.Close();
                }
            }
            catch (Exception erroLogin)
            {
                MessageBox.Show("Erro ao logar, tente novamente! " + erroLogin);
                connection.Close();
            }
        }
Exemple #16
0
        private void invitadoBtn_Click(object sender, EventArgs e)
        {
            // cargo el rol de guest en la variable global del sistema
            Program.idRol = 1;

            MessageBox.Show("Bienvenido al sistema, usted ingresó como invitado", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //new de la ventana que se tiene que abrir

            FormMenu menu = new FormMenu();

            this.Hide();
            menu.ShowDialog();
            this.Close();
        }
Exemple #17
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MainMenu x = new MainMenu();

            this.textBox1.Text = string.Empty;
            MenuSystem       console = new FormMenu(this.textBox1, this.menuItemMenuMenu, this.labelPause);
            BluetoothTesting program = new BluetoothTesting();

            program.console = console;
            console.AddMenus(program);
            console.RunMenu();
            //
            this.Text = this.Text + " -- " + GetCpuBitSize();
        }
Exemple #18
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     formMenu      = new FormMenu();
     formPelicula  = new FormPelicula();
     formSala      = new FormSala();
     formAsiento   = new FormAsiento();
     formBoleto    = new FormBoleto();
     formCartelera = new FormCartelera();
     formCliente   = new FormCliente();
     formReser     = new FormReservacion();
     formTaqui     = new FormTaquillero();
     Application.Run(new FormMenu());
 }
 private void btnVolver_Click(object sender, EventArgs e)
 {
     if (x == 0)
     {
         FormMenu inicio = new FormMenu();
         this.Hide();
         inicio.ShowDialog();
         this.Close();
     }
     else if (x == 1)
     {
         FormListaDeHoteles listado = new FormListaDeHoteles();
         this.Hide();
         listado.ShowDialog();
         this.Close();
     }
 }
 private void VolverButton_Click(object sender, EventArgs e)
 {
     if (x == 0)
     {
         FormMenu inicio = new FormMenu();
         this.Hide();
         inicio.ShowDialog();
         this.Close();
     }
     else if (x == 1)
     {
         FormBuscadorDeClientes listado = new FormBuscadorDeClientes();
         this.Hide();
         listado.ShowDialog();
         this.Close();
     }
 }
Exemple #21
0
        private void button_LoginHuesped_Click(object sender, EventArgs e)
        {
            Usuario usuario = new Usuario();

            usuario.hotel = 0;
            usuario.id    = "guest";
            Rol rol = new Rol(3, "guest");

            usuario.rol = rol;

            VarGlobal.usuario = usuario;
            FormMenu formMenu = new FormMenu();

            this.Hide();
            formMenu.ShowDialog();
            this.Close();
        }
Exemple #22
0
 /// <summary>
 /// Инициализация формы
 /// </summary>
 public override void InitializeForm()
 {
     _formMenu = new FormMenu();
     _formMenu.BackgroundImage = Properties.Resources.menuView;
     _formMenu.StartPosition   = FormStartPosition.CenterScreen;
     _formMenu.Size            = Properties.Resources.menuView.Size;
     _formMenu.MaximizeBox     = false;
     _formMenu.Text            = "Tetris";
     _playButton.Location      = new Point((_formMenu.Width - _playButton.Width) / 2, (_formMenu.Height + _playButton.Height) / 2);
     _playButton.Text          = "Play";
     _playButton.BackColor     = Color.White;
     _scoreButton.Location     = new Point(_playButton.Left, _playButton.Top + PlayButton.Height + 10);
     _scoreButton.Text         = "Score";
     _scoreButton.BackColor    = Color.White;
     _exitButton.Text          = "Exit";
     _exitButton.Location      = new Point(_playButton.Left, ScoreButton.Top + ScoreButton.Height + 10);
     _formMenu.Controls.Add(_playButton);
     _formMenu.Controls.Add(_scoreButton);
     _formMenu.Controls.Add(_exitButton);
 }
Exemple #23
0
        private static void Main(string[] agrs)
        {
            SetFlags(agrs);
            if (string.Compare(DomainName, AdHelper.GetDomainName(), true) != 0 && !_skipDomainCheck)
            {
                MessageBox.Show("Unauthorized enviroment. Exit now...");
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var loginForm = new LoginForm();

            Application.Run(loginForm);
            if (!loginForm.Authorized)
            {
                return;
            }
            var menu = new FormMenu(loginForm.Username, loginForm.Role);

            Application.Run(menu);
        }
 private void buttonEnter_Click(object sender, EventArgs e)
 {
     if (textBoxLogin.Text == "" && textBoxPassword.Text == "")
     {
         MessageBox.Show("Введите данные!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         bool key = false;
         foreach (Users user in Program.RBS_Project.Users)
         {
             if (textBoxLogin.Text == user.Login && textBoxPassword.Text == user.Password)
             {
                 key            = true;
                 users.login    = user.Login;
                 users.password = user.Password;
                 users.type     = user.Type;
                 if (user.Id_Staff != null)
                 {
                     users.name = user.StaffSet.LastName + " " + user.StaffSet.FirstName.Remove(1) + "." + user.StaffSet.MiddleName.Remove(1) + ".";
                 }
                 else
                 {
                     users.name = "admin";
                 }
             }
         }
         if (!key)
         {
             MessageBox.Show("Проверьте данные", "Пользователь не найден", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             FormMenu menu = new FormMenu(this);
             menu.Show();
             this.Hide();
         }
     }
 }
Exemple #25
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string usr = txtUsername.Text;
            string psw = txtPassword.Text;

            con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=I:/JasaEkspedisi/DB/DB_JasaEkspedisi.accdb;Persist Security Info = False;");
            cmd = new OleDbCommand();
            con.Open();
            cmd.Connection  = con;
            cmd.CommandText = "SELECT * FROM Login where username_login='******' AND password_login='******'";
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                FormMenu fm = new FormMenu();
                fm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Username or password is incorrect");
            }

            con.Close();
        }
Exemple #26
0
        private void button1_Click(object sender, EventArgs e)
        {
            Login log = new Login();
            log.Usuario = txtUser.Text;
            log.Password = txtPass.Text;

            clsLogin clsl = new clsLogin();
            int variabledeevaluacion = clsl.acceso(log);

            if (variabledeevaluacion == 1)
            {

                MessageBox.Show("WELCOM");
                FormMenu frm = new FormMenu();
                frm.Show();
                this.Hide();
            }

            else
            {

                MessageBox.Show("FALSE");
            }
        }
        private void BtnGiris_Click(object sender, EventArgs e)
        {
            string userName = txtKullaniciAdi.Text.ToLower().Trim();
            string userPass = txtSifre.Text.Trim();

            if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(userPass) && !userName.Equals("kullanıcı adı"))
            {
                var giris = HelperBorsaKullanici.checkUserLogin(userName, userPass);

                if (giris.Item1)
                {
                    if (giris.Item3)
                    {
                        MessageBox.Show("Bu kullanıcı pasif duruma geçmiştir.\n" +
                                        "Lütfen adminle iletişime geçiniz", "Kullanıcı Pasif Durumda", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        FormMenu fm = new FormMenu(giris.Item2);
                        fm.Show();
                        timerSayac.Start();
                        this.Hide();
                    }
                }
                else
                {
                    MessageBox.Show("Kullanıcı Adı veya Şifre Hatalı!!! Lütfen tekrar deneyiniz...",
                                    "Giriş Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı veya Şifre boş bırakılamaz!!!",
                                "Giriş Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #28
0
 //Конструтор
 public FormAddNewSpotsmen(FormMenu setForm)
 {
     InitializeComponent();
     GetForm = setForm;
 }
Exemple #29
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                FormMenu FormMenu = new FormMenu();
                //Pesquisa no Config o ID/Cliente

                DataSet ds;
                string  sXMLFile = (CaminhoDadosXML(caminho) + @"System.net.b.xml");
                ds = new DataSet();
                ds.ReadXml(sXMLFile);

                //Fazer uma busca no DataSet para encontrar o cliente com o ID da QueryString
                DataRow dRow    = ds.Tables["B_dado"].Select(" Cliente = '" + comboBox2.Text + "'")[0];
                string  id      = dRow.ItemArray[0].ToString();
                string  idURL   = dRow.ItemArray[2].ToString();
                string  idPassw = dRow.ItemArray[4].ToString();
                string  idLogin = dRow.ItemArray[3].ToString();
                //


                // Salva na sessão a configuração ID/Cliente
                using (DataSet dsResultado = new DataSet())
                {
                    dsResultado.ReadXml(CaminhoDadosXML(caminho) + @"System.net.sess.xml");
                    if (dsResultado.Tables.Count != 0)
                    {
                        sessao sessao = new sessao();
                        sessao.Cliente  = comboBox2.Text.Replace(" ", "");
                        sessao.id       = id.Replace(" ", "");
                        sessao.url      = idURL;
                        sessao.Password = idPassw;
                        sessao.Username = idLogin;

                        XmlTextWriter writer = new XmlTextWriter(CaminhoDadosXML(caminho) + @"System.net.sess.xml", System.Text.Encoding.UTF8);

                        writer.WriteStartDocument(true);
                        writer.Formatting  = Formatting.Indented;
                        writer.Indentation = 2;
                        writer.WriteStartElement("B_sessao");
                        writer.WriteStartElement("B_ses");

                        writer.WriteStartElement("id");
                        writer.WriteString(sessao.id);
                        writer.WriteEndElement();

                        writer.WriteStartElement("Cliente");
                        writer.WriteString(sessao.Cliente);
                        writer.WriteEndElement();


                        writer.WriteStartElement("url");
                        writer.WriteString(sessao.url);
                        writer.WriteEndElement();

                        writer.WriteStartElement("Password");
                        writer.WriteString(sessao.Password);
                        writer.WriteEndElement();

                        writer.WriteStartElement("Username");
                        writer.WriteString(sessao.Username);
                        writer.WriteEndElement();


                        writer.WriteEndElement();
                        writer.WriteEndDocument();
                        writer.Close();
                        dsResultado.ReadXml(CaminhoDadosXML(caminho) + @"System.net.sess.xml");
                    }
                }


                MessageBox.Show("Salvo com sucesso !", ".:: Atenção ::.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                FormMenu.GetValSessaoMenu();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro " + ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #30
0
        public void LoginEmpresa(string email, string senha)
        {
            try
            {
                string sqlLeitura = @"select * from empresa
                                      where email_recrut = @email and senha = @senha";

                MySqlCommand cmdMysql = new MySqlCommand(sqlLeitura, connection);

                cmdMysql.Parameters.AddWithValue("@email", email);
                cmdMysql.Parameters.AddWithValue("@senha", senha);

                connection.Open();

                MySqlDataReader data = cmdMysql.ExecuteReader();

                if (data.Read())
                {
                    string nivelAcesso = data.GetString("nivel_acesso");
                    int    id          = int.Parse(data.GetString("id_unidd_empresa"));
                    if (nivelAcesso.Equals("Empresa"))
                    {
                        FormMenu menu = new FormMenu();
                        menu.MenuEstudantes.Enabled     = false;
                        menu.MenuEstudantes.Visible     = false;
                        menu.labelIdVaga.Visible        = true;
                        menu.labelEscalaDominio.Visible = false;
                        menu.labelRequisito1.Visible    = false;
                        menu.labelRequisito2.Visible    = false;
                        menu.labelRequisito3.Visible    = false;
                        menu.txtDomReq1.Visible         = false;
                        menu.txtDomReq2.Visible         = false;
                        menu.txtDomReq3.Visible         = false;
                        menu.btnCandidatar.Visible      = false;
                        EmpresaDAO empresaDao = new EmpresaDAO();
                        menu.cbId.DataSource    = empresaDao.ReadEmpresas2(id);
                        menu.cbId.DisplayMember = "ID";
                        menu.cbId.Enabled       = false;
                        EstudantesDAO estudantes = new EstudantesDAO();
                        menu.dgvVagasOuEstudantes.DataSource = estudantes.ReadEstudantes();
                        menu.cbVaga.DataSource    = estudantes.ReadEstudantes();
                        menu.cbVaga.DisplayMember = "ID";
                        VagaestagioDAO vagas = new VagaestagioDAO();
                        menu.dgvMinhasVagas.DataSource = vagas.ReadVaga2(id);
                        menu.cbVaga.DataSource         = vagas.ReadVaga2(id);
                        menu.cbVaga.DisplayMember      = "ID";
                        menu.Show();
                        connection.Close();
                    }
                }
                else
                {
                    MessageBox.Show("Email ou senha incorretos!");
                    connection.Close();
                }
            }
            catch (Exception erroLogin)
            {
                MessageBox.Show("Erro ao logar, tente novamente! " + erroLogin);
                connection.Close();
            }
        }