protected override void Validation()
 {
     //离职员工需要离职信息
     if (_Employee.EmployeeType == EmployeeTypeEnum.DimissionEmployee)
     {
         if (_Employee.EmployeeDetails == null || _Employee.EmployeeDetails.Work == null || _Employee.EmployeeDetails.Work.DimissionInfo == null)
         {
             BllUtility.ThrowException(BllExceptionConst._Employee_NeedDimissionInformation);
         }
     }
 }
 protected override void ExcuteSelf()
 {
     try
     {
         _DalFBQuesType.InsertFBQuesType(_TrainFBQuesType);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
 protected override void ExcuteSelf()
 {
     try
     {
         _DalLog.InsertInAndOutRecordLog(_Log);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #4
0
 /// <summary>
 /// 调用下层的新增技能的方法
 /// </summary>
 protected override void ExcuteSelf()
 {
     try
     {
         _DalSkill.InsertSkill(_Skill);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
 /// <summary>
 /// 删除员工合同有效性判断:
 /// 1、该员工必须是已经存在的员工
 /// 2、该合同必须是已经存在的合同
 /// </summary>
 protected override void Validation()
 {
     if (_DalEmployee.GetEmployeeByAccountID(_EmployeeID) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Employee_Name_NotExist);
     }
     if (_DalContract.GetEmployeeContractByContractId(_ContractID) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Contract_NotExist);
     }
 }
Beispiel #6
0
 protected override void ExcuteSelf()
 {
     try
     {
         _DalFBQuesType.DeleteFBQuesType(_TrainFBQuesType.ParameterID);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #7
0
 protected override void ExcuteSelf()
 {
     try
     {
         _VacationDal.Update(_Vacation);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #8
0
 /// <summary>
 /// 删除合同类型有效性判断:
 /// 1、要删除的合同类型必须是已经存在的合同类型
 /// 2、没有合同属于这个要删除的合同类型
 /// </summary>
 protected override void Validation()
 {
     if (_DalContractType.GetContractTypeByPkid(_ContractTypeId) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._ContractType_Name_NotExist);
     }
     if (_DalContract.GetEmployeeContractByContractTypeId(_ContractTypeId).Count != 0)
     {
         BllUtility.ThrowException(BllExceptionConst._ConstractType_HasConstract);
     }
 }
Beispiel #9
0
 // 修改技能有效性判断:
 //1、修改的技能要存在
 ////修改的技能当前没有被实用(暂定为可以修改)
 //2、技能名称不能与已有的其他技能名称重名
 protected override void Validation()
 {
     if (_DalSkill.GetSkillByPKID(_Skill.SkillID) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Skill_Name_NotExist);
     }
     if (_DalSkill.CountSkillByNameDiffPKID(_Skill.SkillID, _Skill.SkillName) != 0)
     {
         BllUtility.ThrowException(BllExceptionConst._Skill_Name_Repeat);
     }
 }
Beispiel #10
0
        /// <summary>
        /// 得到第一个工作表,如果工作表个数不是1则抛错
        /// </summary>
        public static string FirstSheetName(OleDbConnection conn)
        {
            DataTable sheetNames = conn.GetOleDbSchemaTable
                                       (OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });

            if (sheetNames.Rows.Count < 1)
            {
                BllUtility.ThrowException(BllExceptionConst._Sheet_Count_NotOne);
            }
            return(sheetNames.Rows[0][2].ToString());
        }
Beispiel #11
0
 protected override void ExcuteSelf()
 {
     try
     {
         _DalSkillType.DeleteSkillType(_SkillTypeId);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #12
0
 protected override void Validation()
 {
     if (_DalSkillType.GetSkillTypeByPkid(_SkillTypeId) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._SkillType_Name_NotExist);
     }
     if (_DalSkill.GetSkillByCondition(string.Empty, _SkillTypeId).Count > 0)
     {
         BllUtility.ThrowException(BllExceptionConst._SkillType_HasSkill);
     }
 }
 protected override void ExcuteSelf()
 {
     try
     {
         _DalTrain.DeleteTrainCourse(_CourseId);;
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #14
0
 /// <summary>
 /// 新增技能类型有效性判断:
 /// 1、技能类型不能与已有技能类型重名
 /// </summary>
 protected override void Validation()
 {
     if (_DalSkillType.GetSkillTypeByPkid(_SkillType.ParameterID) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._SkillType_Name_NotExist);
     }
     //技能类型不能与已有技能类型重名
     if (_DalSkillType.CountSkillTypeByNameDiffPKID(_SkillType.ParameterID, _SkillType.Name) != 0)
     {
         BllUtility.ThrowException(BllExceptionConst._SkillType_Name_Repeat);
     }
 }
Beispiel #15
0
 protected override void Validation()
 {
     _Course = _DalTrain.GetTrainCourseByPKID(_CourseId);
     if (_Course == null)
     {
         BllUtility.ThrowException(BllExceptionConst._TrainCourse_NotExist);
     }
     else if (_Course.Status == TrainStatusEnum.End)
     {
         BllUtility.ThrowException(BllExceptionConst._TrainCourse_End);
     }
 }
Beispiel #16
0
 //修改合同类型业务逻辑:
 //判断有效性
 //如果通过判断
 // 调用下层的修改合同类型的方法
 protected override void ExcuteSelf()
 {
     try
     {
         using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
         {
             _DalContractType.UpdateContractType(_ContractType);
             new CreateContractBookMark(_ContractType);
             ts.Complete();
         }
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
        /// <summary>
        /// 更新培训反馈问题有效性判断
        /// </summary>
        protected override void Validation()
        {
            if (_DalFBQuestion.CountFBQuestionByNameDiffPKID(_TrainFBQuesiton.FBQuestioniD, _TrainFBQuesiton.Description) > 0)
            {
                BllUtility.ThrowException(BllExceptionConst._TrainFBQuesiton_Repeate);
            }


            //foreach (TrainFBItem item in _TrainFBItems)
            //{
            //    if (!_TrainFBQuesiton.FindNotExistItems(item.Description))
            //    {
            //        BllUtility.ThrowException(BllExceptionConst._TrainFBItem_Repeate);
            //    }
            //}
        }
        protected override void ExcuteSelf()
        {
            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    _DalFBQuestion.UpdateFBQuestion(_TrainFBQuesiton);
                    ts.Complete();
                }
            }

            catch
            {
                BllUtility.ThrowException(BllExceptionConst._DbError);
            }
        }
Beispiel #19
0
        /// <summary>
        /// 新增员工合同有效性判断:
        /// 1、要签合同的员工是已经存在的员工
        /// 2、离职的员工不能签合同
        /// 3、合同类型必须是已经存在的合同类型
        /// </summary>
        protected override void Validation()
        {
            Employee employee = _DalEmployee.GetEmployeeByAccountID(_Employee.Account.Id);

            if (employee == null)
            {
                BllUtility.ThrowException(BllExceptionConst._Employee_Name_NotExist);
            }
            else if (employee.EmployeeType == EmployeeTypeEnum.DimissionEmployee)
            {
                BllUtility.ThrowException(BllExceptionConst._Employee_HasLeft);
            }
            if (_DalContractType.GetContractTypeByPkid(_Contract.ContractType.ContractTypeID) == null)
            {
                BllUtility.ThrowException(BllExceptionConst._ContractType_Name_NotExist);
            }
        }
Beispiel #20
0
        /// <summary>
        /// 员工姓名在dt中的列号
        /// </summary>
        public static int GetEmployeeRow(DataTable dt, string employeeName, string title)
        {
            int j = GetColumnIndex(dt, title);

            if (j == -1)
            {
                BllUtility.ThrowException(BllExceptionConst._WithOut_EmployeeName);
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i][j].ToString() == employeeName)
                {
                    return(i);
                }
            }
            return(-1);
        }
 /// <summary>
 /// 调用下层的删除员工合同的方法
 /// </summary>
 protected override void ExcuteSelf()
 {
     try
     {
         using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
         {
             _DalContract.DeleteApplyAssessConditionsByEmployeeContractID(_ContractID);
             _DalEmployeeContractBookMark.DeleteEmployeeContractBookMarkByContractID(_ContractID);
             _DalContract.DeleteEmployeeContract(_ContractID);
             ts.Complete();
         }
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #22
0
 /// <summary>
 /// 调用下层的新增课程的方法
 /// </summary>
 protected override void ExcuteSelf()
 {
     try
     {
         //把反馈人信息先删除
         _Course.TrainFBResult.TrainEmployeeFBs.Remove(
             _Course.TrainFBResult.TrainEmployeeFBs.Find(FindTrainEmployeeFB));
         _Course.TrainFBResult.TrainEmployeeFBs.Add(_TrainEmployeeFb);
         using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
         {
             _DalTrain.UpdateTrainCourse(_Course);
             ts.Complete();
         }
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #23
0
 protected override void Validation()
 {
     _ItsCordinator = _IAccountBll.GetAccountByName(_Course.Coordinator.Name);
     if (_ItsCordinator == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Condinator_Cannot_Find);
     }
     if (_Course.Status == TrainStatusEnum.End || _Course.Status == TrainStatusEnum.Interrupt)
     {
         BllUtility.ThrowException(BllExceptionConst._TrainCourseNew_Cannot_End);
     }
     //if (_Course.Status != TrainStatusEnum.Start)
     //{
     //    BllUtility.ThrowException(BllExceptionConst._TrainCourseNew_Cannot_End);
     //}
     if (!IsLoginUserManage(_ItsCordinator, _LoginUser))
     {
         //throw new ApplicationException("您没有管理该协调员的权限");
         BllUtility.ThrowException(BllExceptionConst._Condinator_NoAuth);
     }
 }
Beispiel #24
0
        protected override void Validation()
        {
            _Course = _DalTrain.GetTrainCourseByPKID(_CourseId);
            if (_Course == null)
            {
                BllUtility.ThrowException(BllExceptionConst._TrainCourse_NotExist);
            }
            else
            {
                switch (_Course.Status)
                {
                case TrainStatusEnum.Interrupt:
                    BllUtility.ThrowException(BllExceptionConst._TrainCourse_Interrupt);
                    break;

                case TrainStatusEnum.End:
                    BllUtility.ThrowException(BllExceptionConst._TrainCourse_End);
                    break;
                }
            }
        }
        protected override void ExcuteSelf()
        {
            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    //foreach (TrainFBItem items in _TrainFBQuesiton.FBItems)
                    //{
                    //    _TrainFBQuesiton.FBItems.Remove(items);
                    //}

                    _DalFBQuestion.DeleteFBQuestion(_TrainFBQuesiton.FBQuestioniD);
                    ts.Complete();
                }
            }

            catch
            {
                BllUtility.ThrowException(BllExceptionConst._DbError);
            }
        }
Beispiel #26
0
        /// <summary>
        /// 判断登陆用户是否可以选择该协调员
        /// </summary>
        private bool IsLoginUserManage(Account addAccont, Account loginUser)
        {
            Auth myAuth = loginUser.FindAuth(AuthType.HRMIS, HrmisPowers.A801);

            if (myAuth == null)
            {
                //throw new ApplicationException("您没有管理培训课程的权限");
                BllUtility.ThrowException(BllExceptionConst._TrainCourseManagement_NoAuth);
            }

            if (myAuth.Departments.Count == 0)
            {
                return(true);
            }

            if (Tools.IsDeptListContainsDept(myAuth.Departments, _IAccountBll.GetAccountById(addAccont.Id).Dept))
            {
                return(true);
            }

            return(false);
        }
        protected override void Validation()
        {
            Course oldcourse = _DalTrain.GetTrainCourseByPKID(_Course.CourseID);

            if (oldcourse == null)
            {
                BllUtility.ThrowException(BllExceptionConst._Skill_Name_NotExist);
            }
            else if (oldcourse.CourseFeedBackPaper.FeedBackPaperId.Equals(_Course.CourseFeedBackPaper.FeedBackPaperId))
            {
                _IsFeedBackPaperUpdate = false;
            }

            if (oldcourse != null)
            {
                switch (oldcourse.Status)
                {
                case TrainStatusEnum.Interrupt:
                    BllUtility.ThrowException(BllExceptionConst._TrainCourse_Interrupt);
                    break;

                case TrainStatusEnum.End:
                    BllUtility.ThrowException(BllExceptionConst._TrainCourse_End);
                    break;
                }
            }
            _ItsCordinator = _IAccountBll.GetAccountByName(_Course.Coordinator.Name);
            if (_ItsCordinator == null)
            {
                BllUtility.ThrowException(BllExceptionConst._Employee_Not_Found);
            }

            if (!IsLoginUserManage(_ItsCordinator, _LoginUser))
            {
                // throw new ApplicationException("您没有管理该协调员的权限");
                BllUtility.ThrowException(BllExceptionConst._Condinator_NoAuth);
            }
        }
Beispiel #28
0
 public void Excute()
 {
     try
     {
         using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
         {
             _Dal.DeleteVacationByAccountID(_Employee.Account.Id);
             if (_VacationList != null && _VacationList.Count > 0)
             {
                 foreach (Model.Vacation vacation in _VacationList)
                 {
                     vacation.Employee = _Employee;
                     _Dal.Insert(vacation);
                 }
             }
             ts.Complete();
         }
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
        /// <summary>
        /// 调用下层的新增课程的方法
        /// </summary>
        protected override void ExcuteSelf()
        {
            //如果反馈表更新了,就重新新增一个课程
            if (_IsFeedBackPaperUpdate)
            {
                new DeleteTrainCourse(_Course.CourseID).Excute();
                new AddTrainCourse(_Course, _Skills, _Employees, _LoginUser).Excute();
                return;
            }
            try
            {
                _Course.Skill = new List <Skill>();
                foreach (Skill skill in _Skills)
                {
                    _Course.Skill.Add(skill);
                }
                _Course.TrainFBResult = new TrainFBResult();
                _Course.TrainFBResult.TrainEmployeeFBs = new List <TrainEmployeeFB>();

                TrainEmployeeFB employeeFb;
                foreach (TrainEmployeeFB fb in GetFbResults())
                {
                    foreach (Account employee in _Employees)
                    {
                        if (fb.Trainee.Id.Equals(employee.Id))
                        {
                            //如果该员工有信息,添加其信息
                            _Course.TrainFBResult.TrainEmployeeFBs.Add(fb);
                            _Employees.Remove(employee);
                            break;
                        }
                    }
                }
                //无信息,未起新建一条数据
                if (_Employees.Count != 0)
                {
                    foreach (Account employee in _Employees)
                    {
                        employeeFb         = new TrainEmployeeFB(null, string.Empty);
                        employeeFb.Trainee = employee;
                        _Course.TrainFBResult.TrainEmployeeFBs.Add(employeeFb);
                    }
                }
                _Course.Coordinator = _ItsCordinator;
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    _DalTrain.UpdateTrainCourse(_Course);
                    ts.Complete();
                }
                if (_Course.Status == TrainStatusEnum.End)
                {
                    List <Skill>           skills      = _Course.Skill;
                    List <TrainEmployeeFB> employeeFBs = _Course.TrainFBResult.TrainEmployeeFBs;
                    foreach (TrainEmployeeFB fb in employeeFBs)
                    {
                        if (fb.FBTime != null)
                        {
                            new FinishTrainCourse(_Course.CourseID).InsertEmployeeSkill(fb.Trainee.Id, skills);
                        }
                    }
                }
            }
            catch
            {
                BllUtility.ThrowException(BllExceptionConst._DbError);
            }
        }