/// <summary> /// Create a new QUESTION_MULTIPLE_CHOICE object. /// </summary> /// <param name="question_multiple_choice_id">Initial value of the question_multiple_choice_id property.</param> /// <param name="question_id">Initial value of the question_id property.</param> /// <param name="choice_text">Initial value of the choice_text property.</param> public static QUESTION_MULTIPLE_CHOICE CreateQUESTION_MULTIPLE_CHOICE(global::System.Int32 question_multiple_choice_id, global::System.Int32 question_id, global::System.String choice_text) { QUESTION_MULTIPLE_CHOICE qUESTION_MULTIPLE_CHOICE = new QUESTION_MULTIPLE_CHOICE(); qUESTION_MULTIPLE_CHOICE.question_multiple_choice_id = question_multiple_choice_id; qUESTION_MULTIPLE_CHOICE.question_id = question_id; qUESTION_MULTIPLE_CHOICE.choice_text = choice_text; return qUESTION_MULTIPLE_CHOICE; }
/// <summary> /// Deprecated Method for adding a new object to the QUESTION_MULTIPLE_CHOICE EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToQUESTION_MULTIPLE_CHOICE(QUESTION_MULTIPLE_CHOICE qUESTION_MULTIPLE_CHOICE) { base.AddObject("QUESTION_MULTIPLE_CHOICE", qUESTION_MULTIPLE_CHOICE); }
public ActionResult MultipleChoiceCreate(MultipleChoiceItem choices) { if (!String.IsNullOrEmpty(choices.ChoiceText1)) { var question_multiple_choice = new QUESTION_MULTIPLE_CHOICE(); question_multiple_choice.question_id = choices.QID; question_multiple_choice.choice_text = choices.ChoiceText1; if (ModelState.IsValid) { db.QUESTION_MULTIPLE_CHOICE.AddObject(question_multiple_choice); db.SaveChanges(); } } if (!String.IsNullOrEmpty(choices.ChoiceText2)) { var question_multiple_choice = new QUESTION_MULTIPLE_CHOICE(); question_multiple_choice.question_id = choices.QID; question_multiple_choice.choice_text = choices.ChoiceText2; if (ModelState.IsValid) { db.QUESTION_MULTIPLE_CHOICE.AddObject(question_multiple_choice); db.SaveChanges(); } } if (!String.IsNullOrEmpty(choices.ChoiceText3)) { var question_multiple_choice = new QUESTION_MULTIPLE_CHOICE(); question_multiple_choice.question_id = choices.QID; question_multiple_choice.choice_text = choices.ChoiceText3; if (ModelState.IsValid) { db.QUESTION_MULTIPLE_CHOICE.AddObject(question_multiple_choice); db.SaveChanges(); } } if (!String.IsNullOrEmpty(choices.ChoiceText4)) { var question_multiple_choice = new QUESTION_MULTIPLE_CHOICE(); question_multiple_choice.question_id = choices.QID; question_multiple_choice.choice_text = choices.ChoiceText4; if (ModelState.IsValid) { db.QUESTION_MULTIPLE_CHOICE.AddObject(question_multiple_choice); db.SaveChanges(); } } if (!String.IsNullOrEmpty(choices.ChoiceText5)) { var question_multiple_choice = new QUESTION_MULTIPLE_CHOICE(); question_multiple_choice.question_id = choices.QID; question_multiple_choice.choice_text = choices.ChoiceText5; if (ModelState.IsValid) { db.QUESTION_MULTIPLE_CHOICE.AddObject(question_multiple_choice); db.SaveChanges(); } } ModelState.Clear(); return View(choices); }