public static bool Save(string pDisciplina) { Disciplinas disc = new Disciplinas(); disc.Nome = pDisciplina; DisciplinasDB.save(disc); return true; }
public static string update(Disciplinas pDisc) { DataBase db = getDataBase(); Disciplinas disciplina = (from d in db.Disciplinas where d.IdDisc == pDisc.IdDisc select d).First(); disciplina.Nome = pDisc.Nome; db.SubmitChanges(); return "Update feito com Sucesso!"; }
public static string update(Disciplinas pDisc) { DataBase db = getDataBase(); Disciplinas disciplina = (from d in db.Disciplinas where d.IdDisc == pDisc.IdDisc select d).First(); disciplina.Nome = pDisc.Nome; db.SubmitChanges(); return("Update feito com Sucesso!"); }
private void listarAlunos(Models.Disciplinas disc) { List <Models.Alunos> alunos = Models.AlunosDB.getAlunos(disciplina.IdDisc); if (alunos.Count != 0) { lbxAlunos.ItemsSource = alunos; } else { lbxAlunos.ItemsSource = null; } }
public static string save(Disciplinas pDisc) { if (pDisc.Nome != "") { DataBase db = getDataBase(); db.Disciplinas.InsertOnSubmit(pDisc); db.SubmitChanges(); } else { return("Preencha o campo Nome."); } return(pDisc.Nome + " cadastrado com Sucesso!"); }
public static string save(Disciplinas pDisc) { if (pDisc.Nome != "") { DataBase db = getDataBase(); db.Disciplinas.InsertOnSubmit(pDisc); db.SubmitChanges(); } else { return "Preencha o campo Nome."; } return pDisc.Nome+" cadastrado com Sucesso!"; }
private void novo() { try { if (txtSubjects.Text != string.Empty) { Models.Disciplinas disc = new Models.Disciplinas(); disc.Nome = txtSubjects.Text; Models.DisciplinasDB.save(disc); } else { MessageBox.Show("Preencha o campo disciplina."); } } catch { MessageBox.Show("Não foi possivel salvar a disciplina.", "ERRO", MessageBoxButton.OK); } }
private void MenuItem_Tap(object sender, System.Windows.Input.GestureEventArgs e) { disciplina = (sender as MenuItem).DataContext as Models.Disciplinas; AbrePagina("/UpdatePage.xaml"); }
private void lbxDisciplinas_SelectionChanged(object sender, SelectionChangedEventArgs e) { disciplina = (sender as ListBox).SelectedItem as Models.Disciplinas; AbrePagina("/Views/AlunosPage.xaml"); }
public static List<Alunos>Get(Disciplinas pDisciplina) { List<Alunos> alunos = AlunosDB.getAlunos(pDisciplina.IdDisc); return alunos; }