Пример #1
0
        public void Edit(string id)
        {
            DataTable data = new usuario().Detalle(id);

            if (data != null)
            {
                DataRow row = data.Rows[0];
                nomUser.Text     = row["ID"].ToString();
                nombreTxt.Text   = row["Nombre"].ToString();
                apellidoTxt.Text = row["Apellido"].ToString();
                pass.Text        = row["Contraseña"].ToString();
                confirPass.Text  = row["Contraseña"].ToString();

                byte[]       img = (byte[])row["FotoPerfil"];
                MemoryStream ms  = new MemoryStream(img);
                perfil.Image = Image.FromStream(ms);
            }
            else
            {
                new popup("Error al mostrar información", popup.AlertType.error);
                this.DialogResult = DialogResult.Cancel;
                this.Close();
            }
        }
Пример #2
0
        // verificar usuario
        private bool verifica()
        {
            DataTable data = new usuario().Verifica(this.username.Text.Trim(), this.password.Text.Trim());

            return((data.Rows.Count != 0) ? true : false);
        }