Exemplo n.º 1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            Rol           rol = new Rol();
            DataContext   context = new DataContext();
            RolRepository rolRepository = new RolRepository(context);
            UserWindow    window = new UserWindow();
            string        name, details;

            name    = tbName.Text;
            details = tbDetail.Text;
            if (!rolRepository.Exist(rolRepository.ObtainId(name)))
            {
                rol.Name    = name;
                rol.Details = details;
                rolRepository.Create(rol);
                MessageBox.Show("Rol Created! " + name);
                window.RefreshComboBox();
                RefreshGrid();
            }
            else
            {
                MessageBox.Show("Rol exist, change the name.");
            }
        }
Exemplo n.º 2
0
        private void BtnUsers_Click(object sender, RoutedEventArgs e)
        {
            UserWindow window = new UserWindow();

            window.Show();
        }
Exemplo n.º 3
0
        private void Window_Closed(object sender, EventArgs e)
        {
            UserWindow window = new UserWindow();

            window.RefreshComboBox();
        }