Esempio n. 1
0
 public bool AddEmployeeSurveyQuestion(T_OA_REQUIREDETAIL2 addId)
 {
     using (EmployeeSurveySubjectBll questionBll = new EmployeeSurveySubjectBll())
     {
         return(questionBll.AddEmployeeSurveySubject(addId));
     }
 }
Esempio n. 2
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. 3
0
 public int AddEmpSurveysSubject(T_OA_REQUIREDETAIL2 obj)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         int n = empSurveysSubjectBll.Add(obj) ? 1 : 0;
         return(n);
     }
 }
Esempio n. 4
0
        public bool AddEmployeeSurveyQuestion(T_OA_REQUIREDETAIL2 addId)
        {

            using (EmployeeSurveySubjectBll questionBll = new EmployeeSurveySubjectBll())
            {
                return questionBll.AddEmployeeSurveySubject(addId);

            }
        }
Esempio n. 5
0
 public int DelEmpSurveysSubject(T_OA_REQUIREDETAIL2 obj)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         if (!empSurveysSubjectBll.DeleteEmployeeSurveySubject(obj.REQUIREDETAIL2ID))
         {
             return(-1);
         }
         return(1);
     }
 }
Esempio n. 6
0
 public int UpdateEmpSurveysSubject(T_OA_REQUIREDETAIL2 objSubject)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         if (empSurveysSubjectBll.UpdateEmployeeSurveySubject(objSubject) != 1)
         {
             return(-1);
         }
         return(1);
     }
 }
Esempio n. 7
0
 public int AddEmpSurveysSubjectList(List <T_OA_REQUIREDETAIL2> objList)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         int n = 0;
         foreach (T_OA_REQUIREDETAIL2 obj in objList)
         {
             n += empSurveysSubjectBll.Add(obj) ? 1 : 0;
         }
         return(n);
     }
 }
Esempio n. 8
0
 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);
         }
     }
 }
Esempio n. 9
0
 public int Save_SubjectAnswer(List <V_EmployeeSurveySubject> lstAdd, List <V_EmployeeSurveySubject> lstUpd)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         int n = 0;
         foreach (V_EmployeeSurveySubject i in lstAdd)
         {
             n += empSurveysSubjectBll.Add(i.SubjectInfo) ? 1 : 0;
         }
         foreach (V_EmployeeSurveySubject i in lstAdd)
         {
             n += empSurveysSubjectBll.UpdateEmployeeSurveySubject(i.SubjectInfo);
         }
         return(n);
     }
 }
Esempio n. 10
0
 public int UpdateEmpSurveysSubjectList(List <T_OA_REQUIREDETAIL2> objList)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         int nRet = 0;
         foreach (T_OA_REQUIREDETAIL2 obj in objList)
         {
             nRet = empSurveysSubjectBll.UpdateEmployeeSurveySubject(obj);
         }
         if (nRet == -1)//没有修改也成功
         {
             return(-1);
         }
         return(1);
     }
 }
        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;
 
            }
Esempio n. 12
0
        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);
        }
Esempio n. 13
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 UpdateEmpSurveysSubjectList(List<T_OA_REQUIREDETAIL2> objList)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         int nRet = 0;
         foreach (T_OA_REQUIREDETAIL2 obj in objList)
         {
             nRet = empSurveysSubjectBll.UpdateEmployeeSurveySubject(obj);
         }
         if (nRet == -1)//没有修改也成功
         {
             return -1;
         }
         return 1;
     }
 }
 public int UpdateEmpSurveysSubject(T_OA_REQUIREDETAIL2 objSubject)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         if (empSurveysSubjectBll.UpdateEmployeeSurveySubject(objSubject) != 1)
         {
             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 Save_SubjectAnswer(List<V_EmployeeSurveySubject> lstAdd,List<V_EmployeeSurveySubject> lstUpd)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         int n = 0;
         foreach (V_EmployeeSurveySubject i in lstAdd)
             n += empSurveysSubjectBll.Add(i.SubjectInfo) ? 1 : 0;
         foreach (V_EmployeeSurveySubject i in lstAdd)
             n += empSurveysSubjectBll.UpdateEmployeeSurveySubject(i.SubjectInfo);
         return n;
     }
 }
 public int AddEmpSurveysSubjectList(List<T_OA_REQUIREDETAIL2> objList)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         //事物
         int n = 0;
         foreach (T_OA_REQUIREDETAIL2 obj in objList)
             n += empSurveysSubjectBll.Add(obj) ? 1 : 0;
         return n;
     }
 }
 public int AddEmpSurveysSubject(T_OA_REQUIREDETAIL2 obj)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         int n = empSurveysSubjectBll.Add(obj) ? 1 : 0;
         return n;
     }
 }
 public int DelEmpSurveysSubject(T_OA_REQUIREDETAIL2 obj)
 {
     using (EmployeeSurveySubjectBll empSurveysSubjectBll = new EmployeeSurveySubjectBll())
     {
         if (!empSurveysSubjectBll.DeleteEmployeeSurveySubject(obj.REQUIREDETAIL2ID))
         {
             return -1;
         }
         return 1;
     }
 }
 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;
                        }
                    }
                }
            }
        }