Exemplo n.º 1
0
        public void setDiplomas()
        {
            if (TestDiplomaIfEmpty())
            {
                DiplomaContext context = new DiplomaContext();
                foreach (Student st in StudentData.testStudents)
                {
                    context.Diplomas.Add(new Diploma(st.facultyNumber));
                }

                context.SaveChanges();
            }
        }
Exemplo n.º 2
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            DiplomaContext context = new DiplomaContext();
            Diploma        result  = (from dp in context.Diplomas where dp.student == tempuser.facultyNumber select dp).First();
            DialogDipl     dialog  = new DialogDipl("Vuvedete tema", "Web sait");

            if (dialog.ShowDialog() == true)
            {
                result.topic = dialog.Answer;
            }
            diplomaTxt.Text = result.topic;
            context.SaveChanges();                       // promenite se zapazvat v bazata danni mojete da runete query
        }