protected override void Validation()
        {
            if (_IAccountBll == null)
            {
                _IAccountBll = BllInstance.AccountBllInstance;
            }
            _ItsAccount = _IAccountBll.GetAccountByName(_EmpName);
            // _ItsEmployee = _EmployeeDal.GetEmployeeByAccountID(account.Id);

            //_ItsEmployee = _EmployeeDal.GetEmployeeByAccountID(_EmpName);
            if (_EmpName == null || _ItsAccount == null)
            {
                BllUtility.ThrowException(BllExceptionConst._Employee_Not_Found);
            }
            if (!IsLoginUserManage(_ItsAccount, _LoginAccount))
            {
                throw new ApplicationException("没有权限访问");
            }
            List <AttendanceBase> allAttendances = _AttendanceDal.GetAttendanceByEmpId(_ItsAccount.Id);

            foreach (AttendanceBase attendance in allAttendances)
            {
                if (IsTheSameAttendanceType(attendance) && AlreadyHaveTheSameDay(attendance))
                {
                    BllUtility.ThrowException(RepetExceptions());
                }
            }
        }
 protected override void Validation()
 {
     if (_AttendanceDal.GetAttendanceById(_AttendanceId) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Attendance_Not_Exist);
     }
 }
 /// <summary>
 /// 新增培训反馈问题有效性判断
 /// </summary>
 protected override void Validation()
 {
     if (_DalFBQuestion.CountFBQuestionByName(_TrainFBQuesiton.Description) > 0)
     {
         BllUtility.ThrowException(BllExceptionConst._TrainFBQuesiton_Repeate);
     }
 }
Example #4
0
        /// <summary>
        /// 调用下层的修改员工合同的方法
        /// </summary>
        protected override void ExcuteSelf()
        {
            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    _DalContract.UpdateEmployeeContract(_Contract);

                    if (_Contract.EmployeeContractBookMark != null && _Contract.EmployeeContractBookMark.Count > 0)
                    {
                        _DalEmployeeContractBookMark.DeleteEmployeeContractBookMarkByContractID(_Contract.ContractID);
                        foreach (EmployeeContractBookMark o in _Contract.EmployeeContractBookMark)
                        {
                            o.EmployeeContractID = _Contract.ContractID;
                            _DalEmployeeContractBookMark.InsertEmployeeContractBookMark(o);
                        }
                    }

                    _DalContract.DeleteApplyAssessConditionsByEmployeeContractID(_Contract.ContractID);
                    if (_Contract.ApplyAssessConditions != null)
                    {
                        foreach (ApplyAssessCondition eachConditioin in _Contract.ApplyAssessConditions)
                        {
                            eachConditioin.EmployeeContractID = _Contract.ContractID;
                            _DalContract.InsertApplyAssessCondition(eachConditioin);
                        }
                    }
                    ts.Complete();
                }
            }
            catch
            {
                BllUtility.ThrowException(BllExceptionConst._DbError);
            }
        }
Example #5
0
 /// <summary>
 /// 新增反馈问题类型有效性判断
 /// </summary>
 protected override void Validation()
 {
     if (_DalFBQuesType.CountFBQuesTypeByName(_TrainFBQuesType.Name) > 0)
     {
         BllUtility.ThrowException(BllExceptionConst._FBQuesType_Repeat);
     }
 }
        protected override void ExcuteSelf()
        {
            EmployeeWelfare employeeWelfareDatabase = _EmployeeWelfareDal.GetEmployeeWelfareByAccountID(_EmployeeID);

            if (!_EmployeeWelfare.Equals(employeeWelfareDatabase))
            {
                try
                {
                    using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                    {
                        if (employeeWelfareDatabase == null)
                        {
                            _EmployeeWelfareID =
                                _EmployeeWelfareDal.InsertEmployeeWelfareByAccountID(_EmployeeWelfare, _EmployeeID);
                        }
                        else
                        {
                            _EmployeeWelfareDal.UpdateEmployeeWelfareByAccountID(_EmployeeWelfare, _EmployeeID);
                        }
                        new CreateEmployeeWelfareHistoryByAccountID(_EmployeeWelfare, _EmployeeID, _OperationName,
                                                                    DateTime.Now,
                                                                    _EmployeeWelfareHistoryDal).Excute();
                        ts.Complete();
                    }
                }
                catch
                {
                    BllUtility.ThrowException(BllExceptionConst._DbError);
                }
            }
        }
 protected override void Validation()
 {
     if (!File.Exists(_FilePath))
     {
         BllUtility.ThrowException(BllExceptionConst._Upload_Failed);
     }
 }
Example #8
0
 /// <summary>
 /// 调用下层的新增课程的方法
 /// </summary>
 protected override void ExcuteSelf()
 {
     try
     {
         _Course.Skill = new List <Skill>();
         foreach (Skill skill in _Skills)
         {
             _Course.Skill.Add(skill);
         }
         _Course.TrainFBResult                  = new TrainFBResult();
         _Course.TrainFBResult.FBPaperItem      = GetFBItem();
         _Course.TrainFBResult.TrainEmployeeFBs = new List <TrainEmployeeFB>();
         foreach (Account employee in _Employees)
         {
             TrainEmployeeFB 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.InsertTrainCourse(_Course);
             ts.Complete();
         }
         new AddCourseSendMail(_Employees, _Course).Excute();
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #9
0
 protected override void ExcuteSelf()
 {
     try
     {
         using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
         {
             _Course.Status = TrainStatusEnum.End;
             _DalTrain.UpdateTrainCourse(_Course);
             List <Skill>           skills      = _Course.Skill;
             List <TrainEmployeeFB> employeeFBs = _Course.TrainFBResult.TrainEmployeeFBs;
             foreach (TrainEmployeeFB fb in employeeFBs)
             {
                 if (fb.FBTime != null)
                 {
                     InsertEmployeeSkill(fb.Trainee.Id, skills);
                 }
             }
             ts.Complete();
         }
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #10
0
 /// <summary>
 /// 新增技能类型有效性判断:
 /// 1、技能类型不能与已有技能类型重名
 /// </summary>
 protected override void Validation()
 {
     //技能类型不能与已有技能类型重名
     if (_DalSkillType.CountSkillTypeByName(_SkillType.Name) != 0)
     {
         BllUtility.ThrowException(BllExceptionConst._SkillType_Name_Repeat);
     }
 }
Example #11
0
 protected override void Validation()
 {
     //if (_DalFBQuestion.GetFBQuestionByConditon(string.Empty, _TrainFBQuesType.ParameterID) != null &&
     if (_DalFBQuestion.GetFBQuestionByConditon(string.Empty, _TrainFBQuesType.ParameterID).Count > 0)
     {
         BllUtility.ThrowException(BllExceptionConst._TrainFBQuesitonType_Hasused);
     }
 }
Example #12
0
 /// <summary>
 /// 新增合同类型有效性判断:
 /// 1、合同类型不能与已有合同类型重名
 /// </summary>
 protected override void Validation()
 {
     //合同类型不能与已有合同类型重名
     if (_DalContractType.CountContractTypeByName(_ContractType.ContractTypeName) != 0)
     {
         BllUtility.ThrowException(BllExceptionConst._ContractType_Name_Repeat);
     }
 }
Example #13
0
 /// <summary>
 /// 新增技能有效性判断:
 /// 1、技能不能与已有技能重名
 /// </summary>
 protected override void Validation()
 {
     //技能不能与已有技能重名
     if (_DalSkill.CountSkillByName(_Skill.SkillName) != 0)
     {
         BllUtility.ThrowException(BllExceptionConst._Skill_Name_Repeat);
     }
 }
Example #14
0
 protected override void Validation()
 {
     //¸Ã¸½¼þÊÇ·ñ´æÔÚ
     if (_VacationDal.GetVacationByVacationID(_VacationID) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Vacation_Not_Exist);
     }
 }
Example #15
0
 //删除的类型要存在
 //删除的类型当前没有被使用
 protected override void Validation()
 {
     if (_DalSkill.GetSkillByPKID(_SkillId) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Skill_Name_NotExist);
     }
     if (_DalEmployeeSkill.CountEmployeeSkillBySkillID(_SkillId) > 0)
     {
         BllUtility.ThrowException(BllExceptionConst._Skill_HasEmployeeSkillOrCourse);
     }
 }
Example #16
0
 protected override void ExcuteSelf()
 {
     try
     {
         _DalSkill.DeleteSkillByPKID(_SkillId);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #17
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);
     }
 }
Example #18
0
 protected override void ExcuteSelf()
 {
     try
     {
         _DalFBQuesType.DeleteFBQuesType(_TrainFBQuesType.ParameterID);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #19
0
 protected override void ExcuteSelf()
 {
     try
     {
         _VacationDal.DeleteVacationByVacationID(_VacationID);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #20
0
 protected override void ExcuteSelf()
 {
     try
     {
         _VacationDal.Insert(_Vacation);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #21
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);
     }
 }
Example #22
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());
        }
Example #23
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);
     }
 }
Example #25
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);
     }
 }
Example #26
0
 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
     {
         _DalLog.InsertInAndOutRecordLog(_Log);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #28
0
 /// <summary>
 /// 调用下层的新增技能类型的方法
 /// </summary>
 protected override void ExcuteSelf()
 {
     try
     {
         _DalSkillType.UpdateSkillType(_SkillType);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Example #29
0
 // 修改合同类型有效性判断:
 //1、修改的类型要存在
 //2、合同类型不能与已有的其他合同类型重名
 protected override void Validation()
 {
     if (_DalContractType.GetContractTypeByPkid(_ContractType.ContractTypeID) == null)
     {
         BllUtility.ThrowException(BllExceptionConst._ContractType_Name_NotExist);
     }
     if (_DalContractType.CountContractTypeByNameDiffPKID(_ContractType.ContractTypeID, _ContractType.ContractTypeName) != 0)
     {
         BllUtility.ThrowException(BllExceptionConst._ContractType_Name_Repeat);
     }
 }
Example #30
0
 protected override void ExcuteSelf()
 {
     try
     {
         _DalFBQuesType.InsertFBQuesType(_TrainFBQuesType);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }