예제 #1
0
        private void BtnAdicionar_Click(object sender, RoutedEventArgs e)
        {
            CadFuncionario cad = new CadFuncionario();

            cad.ShowDialog();
            AtualizarDG();
        }
예제 #2
0
        private void OpcaoAlterar_Click(object sender, RoutedEventArgs e)
        {
            MenuItem menuItem = (MenuItem)sender;

            ContextMenu contextMenu = (ContextMenu)menuItem.Parent;

            DataGrid item = (DataGrid)contextMenu.PlacementTarget;

            if (item.SelectedCells.Count > 0)
            {
                Usuario user = (Usuario)item.SelectedCells[0].Item;

                UsuarioRepositorio repos = new UsuarioRepositorio();

                CadFuncionario window = new CadFuncionario();

                window.FuncionarioAlteracao = user;

                window.ShowDialog();

                AtualizarDG();
            }
        }