Example #1
0
        private void tb_usuario_Leave(object sender, EventArgs e)
        {
            try
            {
                Conexao.Open();
            }
            catch
            {
            }

            if (Conexao.State == ConnectionState.Open)
            {
                cls_login cls_login = new cls_login();
                string    SQL       = "select * from tbl_usuario where login = '******';";

                MySqlDataAdapter Adapter = new MySqlDataAdapter(SQL, Conexao);

                DataSet Dados = new DataSet();

                Adapter.Fill(Dados, "Liberar_Cadastro");

                if (Dados.Tables[0].Rows.Count > 0)
                {
                    _cadastroLiberado = 0;
                }
                else
                {
                    _cadastroLiberado = 1;
                }
            }
        }
        private void CarregarDadosUsuario()
        {
            try
            {
                Conexao.Open();
            }
            catch
            {
            }

            if (Conexao.State == ConnectionState.Open)
            {
                cls_login cls_login = new cls_login();
                string    SQL       = "select nome, foto from tbl_usuario where codigo = " + cls_login._id + ";";

                MySqlDataAdapter Adapter = new MySqlDataAdapter(SQL, Conexao);

                DataSet Dados = new DataSet();

                Adapter.Fill(Dados, "dados");

                if (Dados.Tables[0].Rows.Count > 0)
                {
                    this.Text = "Sofuxe - Agenda  | " + Dados.Tables[0].Rows[0]["nome"].ToString();
                    picFoto1.ImageLocation = Dados.Tables[0].Rows[0]["foto"].ToString();
                }
            }
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            cls_login cls = new cls_login();

            if (cls.Autenticar(textBox1.Text, textBox2.Text) == true)
            {
                Tela_Principal _telaPrincipal = new Tela_Principal();
                _telaPrincipal.Show();
                this.Hide();
            }

            else
            {
            }
        }
        public void CarregarCompromissos()
        {
            try
            {
                Conexao.Open();
            }
            catch
            {
            }

            if (Conexao.State == ConnectionState.Open)
            {
                cls_login cls_login = new cls_login();
                string    SQL       = "select * from tbl_compromissos where tbl_usuario_codigo = " + cls_login._id + ";";

                MySqlDataAdapter Adapter = new MySqlDataAdapter(SQL, Conexao);

                DataSet Dados = new DataSet();

                Adapter.Fill(Dados, "compromissos");

                if (Dados.Tables[0].Rows.Count > 0)
                {
                    for (int x = 0; Dados.Tables[0].Rows.Count >= x; x++)
                    {
                        if (DateTime.Parse(Dados.Tables[0].Rows[x]["data_compromisso"].ToString()).Date <DateTime.Now.Date || DateTime.Parse(Dados.Tables[0].Rows[x]["data_compromisso"].ToString()).Date> DateTime.Now.AddDays(7))
                        {
                        }
                        else
                        {
                            lst_compromissos.Items.Add(Dados.Tables[0].Rows[x]["evento"].ToString());
                        }
                    }
                }
            }
        }