예제 #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     User = new UsuarioAdmin();
     ActualizarDatos();
     datos = u.LlenadoDatos();
     User.Crear(datos);
     img.Registrar_foto(pbUser, txbNick.Text);
     DatagridDatos();
     MessageBox.Show("Usuario creado correctamente.",
                     "AGREGADO", MessageBoxButtons.OK, MessageBoxIcon.Information);//ventana de error con diseño
     txbNick.Clear(); txbName.Clear(); txbTel.Clear(); txbApP.Clear(); txbCorreo.Clear(); TxbPass.Clear(); txbApM.Clear();
     cbDepa.Text       = null; cbExt.Text = null; cbStatus.Text = null; cbNivel.Text = null;
     pbUser.Image      = BackgroundImage;
     txbNick.Enabled   = false; txbName.Enabled = false; txbTel.Enabled = false; txbApP.Enabled = false;
     txbCorreo.Enabled = false; cbDepa.Enabled = false;
     cbExt.Enabled     = false; cbStatus.Enabled = false; cbNivel.Enabled = false; dgvUsuarios.Enabled = true;
     pbUser.Enabled    = false;
 }
예제 #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            User   = new UsuarioAdmin();
            u.Nick = txbNick.Text;
            DialogResult dialogResult = MessageBox.Show("Realmente desea borrar a '" + u.Nick + "'?",
                                                        "CERRARA LA VENTANA", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (dialogResult == DialogResult.OK)
            {
                User.Delete(u.Nick);
                DatagridDatos();
            }
            txbNick.Clear(); txbName.Clear(); txbTel.Clear(); txbApP.Clear(); txbCorreo.Clear(); TxbPass.Clear(); txbApM.Clear();
            cbDepa.Text         = null; cbExt.Text = null; cbStatus.Text = null; cbNivel.Text = null;
            pbUser.Image        = BackgroundImage;
            txbNick.Enabled     = false; txbName.Enabled = false; txbTel.Enabled = false; txbApP.Enabled = false;
            txbCorreo.Enabled   = false; cbDepa.Enabled = false;
            cbExt.Enabled       = false; cbStatus.Enabled = false; cbNivel.Enabled = false;
            dgvUsuarios.Enabled = true; pbUser.Enabled = false;
        }