/// <summary> /// Clones the current option. /// </summary> /// <param name="newIdQuestion">The new question Id.</param> /// <returns>The id of the cloned option.</returns> public int Clone(int newIdQuestion) { ExamOption clonedOption = new ExamOption(); clonedOption.IdQuestion = newIdQuestion; clonedOption.OptionText = OptionText; clonedOption.Points = Points; clonedOption.Create(); return(clonedOption.IdOption); }
/// <summary> /// Gathers all options and saves them in memory. /// </summary> public void GatherOptions() { options = new List <ExamOption>(); List <Dictionary <string, string> > option = Common.GetRS("SELECT * FROM ExamOption WHERE IdQuestion = " + IdQuestion); foreach (Dictionary <string, string> record in option) { ExamOption examOption = new ExamOption(Convert.ToInt32(record["IdOption"])); options.Add(examOption); } }
/// <summary> /// Gathers all options and saves them in memory. /// </summary> public void GatherOptions() { options = new List<ExamOption>(); List<Dictionary<string, string>> option = Common.GetRS("SELECT * FROM ExamOption WHERE IdQuestion = " + IdQuestion); foreach (Dictionary<string, string> record in option) { ExamOption examOption = new ExamOption(Convert.ToInt32(record["IdOption"])); options.Add(examOption); } }
/// <summary> /// Clones the current option. /// </summary> /// <param name="newIdQuestion">The new question Id.</param> /// <returns>The id of the cloned option.</returns> public int Clone(int newIdQuestion) { ExamOption clonedOption = new ExamOption(); clonedOption.IdQuestion = newIdQuestion; clonedOption.OptionText = OptionText; clonedOption.Points = Points; clonedOption.Create(); return clonedOption.IdOption; }