private void DoSelect() { if (!string.IsNullOrEmpty(QuestionContentId)) { IList <QuestionItem> items = QuestionItem.FindAllByProperty(QuestionItem.Prop_QuestionContentId, QuestionContentId); this.PageState.Add("DataList", items); } }
private void DoSave() { if (!string.IsNullOrEmpty(QuestionContentId)) { IList <QuestionItem> qiEnts = QuestionItem.FindAllByProperty(QuestionItem.Prop_QuestionContentId, QuestionContentId); foreach (QuestionItem items in qiEnts) { items.DoDelete(); } IList <string> DataList = RequestData.GetList <string>("data"); if (DataList.Count > 0) { qiEnts = DataList.Select(tent => JsonHelper.GetObject <QuestionItem>(tent) as QuestionItem).ToArray(); foreach (QuestionItem itms in qiEnts) { itms.DoCreate(); } } } }
private void DoBatchDelete() { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { foreach (var v in idList) { IList <QuestionContent> qcEnt = QuestionContent.FindAllByProperty(QuestionContent.Prop_SurveyQuestionId, v.ToString()); IList <QuestionItem> qIEnt = QuestionItem.FindAllByProperty(QuestionItem.Prop_SurveyQuestionId, v.ToString()); foreach (QuestionContent items in qcEnt) { items.DoDelete(); } foreach (QuestionItem items in qIEnt) { items.Delete(); } } SurveyQuestion.DoBatchDelete(idList.ToArray()); } }