private void btnConfirm_Click_1(object sender, EventArgs e) { // Создаём тест TestDB test = new TestDB(); test.name = tbName.Text; test.group_id = Convert.ToInt32(((KeyValuePair <string, string>)cbGroup.SelectedItem).Key); MainForm main_fm = (MainForm)Application.OpenForms["MainForm"]; AdminDB user = new AdminDB(main_fm.login); test.owner_id = user.id; test.date_created = DateTime.Now; test.date_last_saved = DateTime.Now; test.AddToDB(); this.Close(); EditTest et = new EditTest(test.name); test = null; et.Show(); main_fm.UpdateDGV_Tests(); }
private void btnConfirm_Click_1(object sender, EventArgs e) { // Редактируем ответ ответ answer_obj.name = tbName.Text; if (cbCorrect.Checked == true) { answer_obj.correct = 1; } else { answer_obj.correct = 0; } answer_obj.Save(); EditTest edit_test = (EditTest)Application.OpenForms["EditTest"]; edit_test.UpdateDgvAnswers(answer_obj.questions_id); this.Close(); }
private void btnConfirm_Click_1(object sender, EventArgs e) { // Создаём ответ TestDB.Answers answer = new TestDB.Answers(); answer.name = tbName.Text; answer.questions_id = this.question_id; if (cbCorrect.Checked == true) { answer.correct = 1; } else { answer.correct = 0; } answer.AddToDB(); EditTest edit_test = (EditTest)Application.OpenForms["EditTest"]; edit_test.UpdateDgvAnswers(this.question_id); this.Close(); }