Example #1
0
        private void SelectClick(object sender, RoutedEventArgs e)
        {
            LoginDataContext bd = new LoginDataContext();

            grid.ItemsSource = null;
            grid.ItemsSource = (from g in bd.GrupoUsuario select g).ToList();
        }
Example #2
0
        private void InsertClick(object sender, RoutedEventArgs e)
        {
            GrupoUsuario g = new GrupoUsuario();

            g.Id        = int.Parse(txtId.Text);
            g.Descricao = txtDesc.Text;

            LoginDataContext bd = new LoginDataContext();

            bd.GrupoUsuario.InsertOnSubmit(g);
            bd.SubmitChanges();
        }