///<summary></summary> public static void Update(Question quest) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),quest); return; } Crud.QuestionCrud.Update(quest); }
///<summary></summary> public static long Insert(Question quest) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { quest.QuestionNum=Meth.GetLong(MethodBase.GetCurrentMethod(),quest); return quest.QuestionNum; } return Crud.QuestionCrud.Insert(quest); }
///<summary></summary> public Question Copy() { Question q=new Question(); q.QuestionNum=QuestionNum; q.PatNum=PatNum; q.ItemOrder=ItemOrder; q.Description=Description; q.Answer=Answer; q.FormPatNum=FormPatNum; return q; }
private void SaveQuestions(){ FormPat form=new FormPat(); form.PatNum=PatCur.PatNum; form.FormDateTime=DateTime.Now; FormPats.Insert(form); Question quest; ArrayList ALval; for(int i=0;i<QuestionDefList.Length;i++) { quest=new Question(); quest.PatNum=PatCur.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=form.FormPatNum; Questions.Insert(quest); } }
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; }