コード例 #1
0
        public ActionResult QuestionAddUpdateEdit(int? id, int cft_id)
        {
            int questionId = id ?? -1;
            QuestionCreateEditViewModel obsQCVM;

            if (questionId < 1)
            {
                obsQCVM = new QuestionCreateEditViewModel();
                obsQCVM.questn.obs_question_eff_st_dt = DateTime.Now;
                obsQCVM.questn.obs_question_eff_end_dt = Convert.ToDateTime("2060/12/31");
            }
            else
            {
                obsQCVM = new QuestionCreateEditViewModel(questionId);
                foreach (qatTags qatTag in obsQCVM.Quest_Assigned_qatTags)
                {
                    //if this qat_id is not on any of the forms
                    if (db.OBS_COL_FORM_QUESTIONS.Where(item => item.obs_qat_id == qatTag.QAT.obs_qat_id && item.obs_cft_id != cft_id).Count() == 0)
                    {
                        qatTag.editable = "true";
                    }

                }
            }
            // Finally Set the ActiveForm Id Flag if needed
            obsQCVM.activeFormId = cft_id.ToString();
            return View("QuestionAddUpdateEditLight", obsQCVM);
        }
コード例 #2
0
        public ActionResult QuestionAddUpdateEdit(int? id)
        {
            int questionId = id ?? -1;
            QuestionCreateEditViewModel obsQCVM = new QuestionCreateEditViewModel(questionId);

            return View("QuestionAddUpdate", obsQCVM);

        }