Exemplo n.º 1
0
        private void cmdGrabarUsuario_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.textBoxPerfil.Text.Trim() != string.Empty)
                {
                    BLL.Tables.TBL_PERFILES      _perfil    = new BLL.Tables.TBL_PERFILES();
                    Entities.Tables.TBL_PERFILES _newPerfil = new Entities.Tables.TBL_PERFILES();
                    _newPerfil.NOMBREPERFIL      = this.textBoxPerfil.Text.ToString().Trim();
                    _newPerfil.DESCRIPCIONPERFIL = this.textBoxDescripcion.Text.ToString().Trim();

                    _perfil.Add(_newPerfil);

                    MessageBox.Show("Perfil dado de alta correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Debe ingresar una descripción de Perfil", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }