public int DelEmpSurveysSubject(T_OA_REQUIREDETAIL2 obj) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { if (!empSurveysSubjectBll.DeleteEmployeeSurveySubject(obj.REQUIREDETAIL2ID)) { return(-1); } return(1); } }
public int DelEmpSurveysSubjectList(List <T_OA_REQUIREDETAIL2> objList) { using (EmployeeSurveysAnswerBll empSurveysAnswerBll = new EmployeeSurveysAnswerBll()) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { //事务 bool sucess = true; foreach (T_OA_REQUIREDETAIL2 obj in objList) { if (empSurveysSubjectBll.DeleteEmployeeSurveySubject(obj.REQUIREDETAIL2ID)) { IQueryable <T_OA_REQUIREDETAIL> detailList = empSurveysAnswerBll.GetInfoListByMasterId(obj.REQUIREMASTERID, obj.SUBJECTID); if (detailList != null) { foreach (T_OA_REQUIREDETAIL objDetail in detailList) { if (empSurveysAnswerBll.DeleteEmployeeSurveysAnswer(objDetail.REQUIREDETAILID)) { } else { sucess = false; break; } } } if (sucess == false) { return(-1); } } else { return(-1); } } return(1); } } }
public int DelEmpSurveysSubjectList(List<T_OA_REQUIREDETAIL2> objList) { using (EmployeeSurveysAnswerBll empSurveysAnswerBll = new EmployeeSurveysAnswerBll()) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { //事务 bool sucess = true; foreach (T_OA_REQUIREDETAIL2 obj in objList) { if (empSurveysSubjectBll.DeleteEmployeeSurveySubject(obj.REQUIREDETAIL2ID)) { IQueryable<T_OA_REQUIREDETAIL> detailList = empSurveysAnswerBll.GetInfoListByMasterId(obj.REQUIREMASTERID, obj.SUBJECTID); if (detailList != null) { foreach (T_OA_REQUIREDETAIL objDetail in detailList) { if (empSurveysAnswerBll.DeleteEmployeeSurveysAnswer(objDetail.REQUIREDETAILID)) { } else { sucess = false; break; } } } if (sucess == false) { return -1; } } else { return -1; } } return 1; } } }
public int DelEmpSurveysSubject(T_OA_REQUIREDETAIL2 obj) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { if (!empSurveysSubjectBll.DeleteEmployeeSurveySubject(obj.REQUIREDETAIL2ID)) { return -1; } return 1; } }