Esempio n. 1
0
 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);
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public int DelEmpSurveysAnswerList(List <T_OA_REQUIREDETAIL> objList)
 {
     using (EmployeeSurveysAnswerBll empSurveysAnswerBll = new EmployeeSurveysAnswerBll())
     {
         //事物
         bool sucess = true;
         foreach (T_OA_REQUIREDETAIL obj in objList)
         {
             sucess = empSurveysAnswerBll.DeleteEmployeeSurveysAnswer(obj.REQUIREDETAILID);
         }
         if (sucess == false)
         {
             return(-1);
         }
         return(1);
     }
 }
Esempio n. 3
0
 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 DelEmpSurveysAnswerList(List<T_OA_REQUIREDETAIL> objList)
 {
     using (EmployeeSurveysAnswerBll empSurveysAnswerBll = new EmployeeSurveysAnswerBll())
     {
         //事物
         bool sucess = true;
         foreach (T_OA_REQUIREDETAIL obj in objList)
         {
             sucess = empSurveysAnswerBll.DeleteEmployeeSurveysAnswer(obj.REQUIREDETAILID);
         }
         if (sucess == false)
         {
             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 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;
                        }
                    }
                }
            }
        }