private void save(object sender, RoutedEventArgs e) { Context context = new Context(); int tf = -1; for (int i = 0; i < Questions.Length; i++) { if (Questions[i].type == 2) { if (Answer[i] == "False") { tf = 0; } if (Answer[i] == "True") { tf = 1; } } if (Answer[i] != "") { context.Database.ExecuteSqlCommand($"Answer_Question_proc {user_id},{ExamId},{Questions[i].Question_Id} ,[{Answer[i]}],{tf} ;", parameters: new object[] { }); } } ResultStudent result = new ResultStudent(user_id); //Id student result.Show(); this.Close(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { ResultStudent res = new ResultStudent(user_id); res.Show(); }