Пример #1
0
        public static void InserirUsuario(UsuarioVO u)
        {
            string sql = String.Format("set dateformat dmy; " +
            "insert into UserDev (idUserDev, tipoCadastro, nomeUserDev, nascimento, username, senha, email, caminhoDaFoto) values " +
            "({0}, '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}');", u.GetId(), u.GetTipoCadastro(),
            u.GetNome(), u.GetNascimento(), u.GetUsuario(), u.GetSenha(), u.GetEmail(), u.GetCaminhoDoArquivo());

            Metodos.ExecutaSql(sql);
        }
        private void PreencherUsuarioSA(UsuarioVO u)
        {
            try
            {
                txtNome.Text = u.GetNome().Substring(0, u.GetNome().IndexOf(" "));
                txtSobrenome.Text = u.GetNome().Substring(u.GetNome().IndexOf(" ") + 1);
                txtNascimento.Text = u.GetNascimento().ToString("dd/MM/yyyy");
                txtUsuario.Text = u.GetUsuario();
                txtSenha.Text = u.GetSenha();
                txtEmail.Text = u.GetEmail();
                txtID.Text = u.GetId().ToString();

                if (u.GetTipoCadastro().ToString() == "U")
                    txtTipoCadastro.Text = "Usuário";
                else
                    txtTipoCadastro.Text = "Desenvolvedor";

                if (u.GetCaminhoDoArquivo() != "padrão")
                {
                    pbSAUser.ImageLocation = ondeEstamos + "userimgs\\" + u.GetId() + u.GetCaminhoDoArquivo();
                }
                else
                {
                    pbSAUser.Image = Properties.Resources.unknown_person;
                }
            }
            catch { }
        }