private void butDelete_Click(object sender, EventArgs e) { //only visible if editing existing quesionnaire. if (!MsgBox.Show(this, true, "Delete this questionnaire?")) { return; } FormPats.Delete(FormPatCur.FormPatNum); DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, System.EventArgs e) { if (QuestionDefList.Length == 0) { MsgBox.Show(this, "No questions to save."); return; } //only visible if IsNew FormPats.Insert(FormPatCur); Question quest; ArrayList ALval; for (int i = 0; i < QuestionDefList.Length; i++) { quest = new Question(); quest.PatNum = FormPatCur.PatNum; quest.ItemOrder = QuestionDefList[i].ItemOrder; quest.Description = QuestionDefList[i].Description; if (QuestionDefList[i].QuestType == QuestionType.FreeformText) { ALval = multInput.GetCurrentValues(i); if (ALval.Count > 0) { quest.Answer = ALval[0].ToString(); } //else it will just be blank } else if (QuestionDefList[i].QuestType == QuestionType.YesNoUnknown) { quest.Answer = Lan.g("enumYN", multInput.GetCurrentValues(i)[0].ToString()); } quest.FormPatNum = FormPatCur.FormPatNum; Questions.Insert(quest); } DialogResult = DialogResult.OK; }