public List <T_OA_REQUIREDETAIL2> GetEmpSurveysSubjectList(string requireId) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { IQueryable <T_OA_REQUIREDETAIL2> detailList = empSurveysSubjectBll.GetInfoListByMasterId(requireId); if (detailList != null) { return(detailList.ToList()); } else { return(null); } } }
public V_EmployeeSurveySubject GetInfoByTitle(string masterTitle) { V_EmployeeSurveySubject listAll = new V_EmployeeSurveySubject(); string masterId=listAll.Master.REQUIREMASTERID; using (EmployeeSurveysMasterBll masterBll = new EmployeeSurveysMasterBll()) { IQueryable<T_OA_REQUIREMASTER> masterList = masterBll.GetInfoListByTitle(masterTitle); if (masterList == null) { return null; } else { listAll.Master=masterList.ToList()[0]; } } using (EmployeeSurveySubjectBll questionBll = new EmployeeSurveySubjectBll()) { IQueryable<T_OA_REQUIREDETAIL2> questionList = questionBll.GetInfoListByMasterId(masterId); if (questionList == null) { return null; } else { listAll.Question = questionList.ToList()[0]; } } using(EmployeeSurveysAnswerBll answerBll=new EmployeeSurveysAnswerBll()) { IQueryable<T_OA_REQUIREDETAIL> answerList =answerBll.GetInfoByMasterId(masterId); if(answerList==null) { return null; } else { listAll.Answer=answerList.ToList()[0]; } } return listAll; }
public V_EmployeeSurveySubject GetInfoByTitle(string masterTitle) { V_EmployeeSurveySubject listAll = new V_EmployeeSurveySubject(); string masterId = listAll.Master.REQUIREMASTERID; using (EmployeeSurveysMasterBll masterBll = new EmployeeSurveysMasterBll()) { IQueryable <T_OA_REQUIREMASTER> masterList = masterBll.GetInfoListByTitle(masterTitle); if (masterList == null) { return(null); } else { listAll.Master = masterList.ToList()[0]; } } using (EmployeeSurveySubjectBll questionBll = new EmployeeSurveySubjectBll()) { IQueryable <T_OA_REQUIREDETAIL2> questionList = questionBll.GetInfoListByMasterId(masterId); if (questionList == null) { return(null); } else { listAll.Question = questionList.ToList()[0]; } } using (EmployeeSurveysAnswerBll answerBll = new EmployeeSurveysAnswerBll()) { IQueryable <T_OA_REQUIREDETAIL> answerList = answerBll.GetInfoByMasterId(masterId); if (answerList == null) { return(null); } else { listAll.Answer = answerList.ToList()[0]; } } return(listAll); }
public List<T_OA_REQUIREDETAIL2> GetEmpSurveysSubjectList(string requireId) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { IQueryable<T_OA_REQUIREDETAIL2> detailList = empSurveysSubjectBll.GetInfoListByMasterId(requireId); if (detailList != null) { return detailList.ToList(); } else { return null; } } }
public bool DeleteEmpSurveys(List<T_OA_REQUIREMASTER> objList) { using (EmployeeSurveysMasterBll empSurveysCreateBll = new EmployeeSurveysMasterBll()) { using (EmployeeSurveysAnswerBll empSurveysAnswerBll = new EmployeeSurveysAnswerBll()) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { empSurveysCreateBll.BeginTransaction(); try { bool isSccess = true; foreach (T_OA_REQUIREMASTER obj in objList) { if (empSurveysCreateBll.Delete(obj.REQUIREMASTERID)) { //删除题目和答案 IQueryable<T_OA_REQUIREDETAIL2> objDetail2List = empSurveysSubjectBll.GetInfoListByMasterId(obj.REQUIREMASTERID); if (objDetail2List != null) { foreach (T_OA_REQUIREDETAIL2 objDetail2 in objDetail2List) { IQueryable<T_OA_REQUIREDETAIL> detailList = empSurveysAnswerBll.GetInfoListByMasterId(objDetail2.REQUIREMASTERID, objDetail2.SUBJECTID); if (detailList != null) { foreach (T_OA_REQUIREDETAIL objDetail in detailList) { if (empSurveysAnswerBll.DeleteEmployeeSurveysAnswer(objDetail.REQUIREDETAILID)) { } else { return false; } } } } } } } if (isSccess) { empSurveysCreateBll.CommitTransaction(); return true; } else { empSurveysCreateBll.RollbackTransaction(); return false; } } catch { empSurveysCreateBll.RollbackTransaction(); return false; } } } } }
public bool DeleteEmpSurveys(List <T_OA_REQUIREMASTER> objList) { using (EmployeeSurveysMasterBll empSurveysCreateBll = new EmployeeSurveysMasterBll()) { using (EmployeeSurveysAnswerBll empSurveysAnswerBll = new EmployeeSurveysAnswerBll()) { using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll()) { empSurveysCreateBll.BeginTransaction(); try { bool isSccess = true; foreach (T_OA_REQUIREMASTER obj in objList) { if (empSurveysCreateBll.Delete(obj.REQUIREMASTERID)) { //删除题目和答案 IQueryable <T_OA_REQUIREDETAIL2> objDetail2List = empSurveysSubjectBll.GetInfoListByMasterId(obj.REQUIREMASTERID); if (objDetail2List != null) { foreach (T_OA_REQUIREDETAIL2 objDetail2 in objDetail2List) { IQueryable <T_OA_REQUIREDETAIL> detailList = empSurveysAnswerBll.GetInfoListByMasterId(objDetail2.REQUIREMASTERID, objDetail2.SUBJECTID); if (detailList != null) { foreach (T_OA_REQUIREDETAIL objDetail in detailList) { if (empSurveysAnswerBll.DeleteEmployeeSurveysAnswer(objDetail.REQUIREDETAILID)) { } else { return(false); } } } } } } } if (isSccess) { empSurveysCreateBll.CommitTransaction(); return(true); } else { empSurveysCreateBll.RollbackTransaction(); return(false); } } catch { empSurveysCreateBll.RollbackTransaction(); return(false); } } } } }