示例#1
0
        public actionDialogProject(list_project listProject, int IdProjeto)
        {
            Label label = new Label();

            label.Text     = "Oque você deseja fazer a seguir?";
            label.Font     = new Font("Arial", 10, FontStyle.Regular);
            label.Size     = new Size(230, 25);
            label.Location = new Point(35, 20);
            this.Controls.Add(label);

            MaterialFlatButton edit = new MaterialFlatButton();

            edit.Text = "Editar";
            // adiciona ação ao clique do button
            edit.Click   += delegate(object sender, EventArgs args) { this.Close(); listProject.retornaEdicao(IdProjeto); };
            edit.Location = new Point(10, 50);
            this.Controls.Add(edit);

            MaterialFlatButton taskList = new MaterialFlatButton();

            taskList.Text = "Tarefas";
            // adiciona ação ao clique do button
            taskList.Click   += delegate(object sender, EventArgs args) { this.Close(); listProject.retornaTarefa(IdProjeto); };
            taskList.Location = new Point(85, 50);
            this.Controls.Add(taskList);

            MaterialRaisedButton delete = new MaterialRaisedButton();

            delete.Text = "Remover";
            // adiciona ação ao clique do button
            delete.Click   += delegate(object sender, EventArgs args) { this.Close(); listProject.removerProjeto(IdProjeto); };
            delete.Location = new Point(190, 50);
            this.Controls.Add(delete);
        }
示例#2
0
        private void concluir()
        {
            this.Hide();
            Form f = new list_project();

            f.Closed += (s, args) => this.Close();
            f.Show();
        }
        private void voltarBtn_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form f = new list_project();

            f.Closed += (s, args) => this.Close();
            f.Show();
        }
示例#4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string autorizacao = "select count(1) from usuario where nome = @nome and senha = @senha";

            using (NpgsqlConnection conexao = new NpgsqlConnection(strConexao))
            {
                conexao.Open();

                try
                {
                    using (NpgsqlCommand comando = new NpgsqlCommand(autorizacao, conexao))
                    {
                        comando.Parameters.AddWithValue("@nome", lineUsuario.Text);
                        comando.Parameters.AddWithValue("@senha", lineSenha.Text);

                        string userFound = comando.ExecuteScalar().ToString();

                        if (int.Parse(userFound) >= 1)
                        {
                            this.Hide();
                            Form f = new list_project();
                            f.Closed += (s, args) => this.Close();
                            f.Show();
                        }
                        else
                        {
                            MessageBox.Show("Acesso negado");
                        }
                    }
                }
                catch (NpgsqlException ex)
                {
                    MessageBox.Show(ex.Message + ex.StackTrace);
                }
                finally
                {
                    conexao.Close();
                }
            }
        }