private void DoBatchDelete() { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { // SurveyQuestion.DoBatchDelete(idList.ToArray()); for (var v = 0; v < idList.Count; v++) { // 人员 问卷 QuestionItem[] Qent = QuestionItem.FindAllByProperties(QuestionItem.Prop_SurveyId, idList[v].ToString()); QuestionAnswerItem[] Aent = QuestionAnswerItem.FindAllByProperties(QuestionAnswerItem.Prop_SurveyId, idList[v].ToString()); SurveyFinallyUsr[] FuEnt = SurveyFinallyUsr.FindAllByProperties(SurveyFinallyUsr.Prop_SurveyId, idList[v].ToString()); SurveyCanReaderUsr[] Ruent = SurveyCanReaderUsr.FindAllByProperties(SurveyCanReaderUsr.Prop_SurveyId, idList[v].ToString()); SurveyedObj[] SoEnt = SurveyedObj.FindAllByProperties(SurveyedObj.Prop_SurveyId, idList[v].ToString()); SurveyReaderObj[] RoEnt = SurveyReaderObj.FindAllByProperties(SurveyReaderObj.Prop_SurveyId, idList[v].ToString()); foreach (var ent in Qent) { ent.DoDelete(); } foreach (var ent in Aent) { ent.DoDelete(); } foreach (var ent in FuEnt) { ent.DoDelete(); } foreach (var ent in Ruent) { ent.DoDelete(); } foreach (var ent in SoEnt) { ent.DoDelete(); } foreach (var ent in RoEnt) { ent.DoDelete(); } } SurveyQuestion.DoBatchDelete(idList.ToArray()); } }
private void DoBatchDelete() { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { SurveyQuestion.DoBatchDelete(idList.ToArray()); foreach (var v in idList.ToArray()) { string sql = @" delete from FL_Culture..QuestionAnswerItem where surveyid='{0}'; delete from FL_Culture..QuestionItem where surveyid='{0}' "; sql = string.Format(sql, v.ToString()); DataHelper.ExecSql(sql); } } }
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()); } }