Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 protected override void ExcuteSelf()
 {
     try
     {
         DiyStep currentStep = _PositionApplication.DiyProcess.FindCancelStep();
         DiyStep nextStep    = _PositionApplication.DiyProcess.FindCancelNextStep();
         using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
         {
             _PositionApplicationDal.UpdatePositionApplicationStatusByPositionApplicationID(_PositionApplicationID,
                                                                                            _RequestStatus, nextStep.DiyStepID);
             PositionApplicationFlow flow = new PositionApplicationFlow(0, _PositionApplicationID,
                                                                        new Account(_OperatorID, "", ""),
                                                                        DateTime.Now, _RequestStatus, _Reason, _PositionApplication);
             _PositionApplicationDal.InsertPositionApplicationFlow(flow);
             ts.Complete();
         }
         List <string> accounts =
             new GetDiyProcess(_DalEmployeeDiyProcess).GetAccountMailListByDiyProcessIDAccountID(
                 currentStep, _PositionApplication.Account.Id);
         new PositionApplicationMailAndPhoneDelegate().CancelMail(_PositionApplication.PKID, accounts, nextStep);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Ejemplo n.º 2
0
        private List <Model.AssessActivity> GetActivitysByStatusAndOperAccountId(int accountId, AssessStatus status)
        {
            List <Model.AssessActivity> retVal = new List <Model.AssessActivity>();

            List <Model.AssessActivity> employeeAssessActivitys = AssessActivityLogic.GetAssessActivityByEmployeeStatus(-1, status);

            foreach (Model.AssessActivity item in employeeAssessActivitys)
            {
                Account operAccount =
                    GetDiyStepAccount(item.ItsEmployee.Account.Id, item.DiyProcess.DiySteps[item.NextStepIndex]);
                if (operAccount == null)
                {
                    //mail通知人事
                    List <Account> accounts = new GetDiyProcess().GetHRPrincipalByAccountID(item.ItsEmployee.Account.Id);
                    if (accounts != null && accounts.Count > 0)
                    {
                        List <List <string> > mails = BllUtility.GetEmailsByAccountIds(accounts);
                        MailBody mailBody           = new MailBody();
                        mailBody.Subject = "绩效考核流程中断";

                        StringBuilder sbMailBody = new StringBuilder(item.ItsEmployee.Account.Name);
                        sbMailBody.Append("的");
                        sbMailBody.Append(
                            AssessActivityUtility.GetCharacterNameByType(item.AssessCharacterType));
                        sbMailBody.Append("未能找到下一步处理人,被系统自动中断!");
                        mailBody.Body = sbMailBody.ToString();
                        if (mails[0].Count > 0)
                        {
                            mailBody.MailTo = mails[0];
                        }
                        if (mails[1].Count > 0)
                        {
                            mailBody.MailCc = mails[1];
                        }
                        if (mails[0].Count > 0 || mails[1].Count > 0)
                        {
                            BllInstance.MailGateWayBllInstance.Send(mailBody);
                        }
                    }

                    new InterruptActivity(item.AssessActivityID).Excute();
                    continue;
                }
                if (operAccount.Id == accountId)
                {
                    retVal.Add(item);
                }
            }
            return(retVal);
        }
        /// <summary>
        /// 修改
        /// </summary>
        protected override void ExcuteSelf()
        {
            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    if (_OldPositionApplication.IfAutoCancel)
                    {
                        AutoCancelPositionApplication();
                    }
                    if (_IfSubmit)
                    {
                        _PositionApplication.Status = RequestStatus.Submit;
                        DiyStep currentStep = _PositionApplication.DiyProcess.FindFirstStep();
                        DiyStep nextStep    = _PositionApplication.DiyProcess.FindSecondStep();
                        _PositionApplication.NextStep = nextStep;
                        _PositionApplicationDal.UpdatePositionApplication(_PositionApplication);
                        PositionApplicationFlow flow = new PositionApplicationFlow(0, _PositionApplication.PKID,
                                                                                   _PositionApplication.Account,
                                                                                   DateTime.Now, RequestStatus.Submit, "", _PositionApplication);
                        _PositionApplicationDal.InsertPositionApplicationFlow(flow);

                        List <string> accounts =
                            new GetDiyProcess(_DalEmployeeDiyProcess).GetAccountMailListByDiyProcessIDAccountID(
                                currentStep, _PositionApplication.Account.Id);
                        new PositionApplicationMailAndPhoneDelegate().SubmitOperation(_PositionApplication.PKID, accounts, nextStep);
                    }
                    else
                    {
                        _PositionApplication.Status   = RequestStatus.New;
                        _PositionApplication.NextStep = _PositionApplication.DiyProcess.FindFirstStep();
                        _PositionApplicationDal.UpdatePositionApplication(_PositionApplication);
                    }
                    ts.Complete();
                }
            }
            catch
            {
                HrmisUtility.ThrowException(HrmisUtility._DbError);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="getDiyProcess"></param>
 public AutoRemindServerUtility(GetDiyProcess getDiyProcess)
 {
     _GetDiyProcess = getDiyProcess;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 绑定
        /// </summary>
        /// <returns></returns>
        public string ToBind()
        {
            string result = String.Empty;

            if (EmployeeFieldPara.Skill.Id.ToString() == _FieldParaBaseId)
            {
                List <Skill> all = new GetSkill().GetSkillByCondition("", -1);
                foreach (Skill item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.SkillName : "\n" + item.SkillName;
                }
            }
            if (EmployeeFieldPara.PositionGrade.Id.ToString() == _FieldParaBaseId)
            {
                List <PositionGrade> all = BllInstance.PositionBllInstance.GetAllPositionGrade();
                foreach (PositionGrade item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.EmployeeType.Id.ToString() == _FieldParaBaseId)
            {
                Dictionary <string, string> AllEmployeeType = EmployeeTypeUtility.GetAllEmployeeTypeEnum();
                foreach (KeyValuePair <string, string> item in AllEmployeeType)
                {
                    result += string.IsNullOrEmpty(result) ? item.Value : "\n" + item.Value;
                }
            }
            if (EmployeeFieldPara.Position.Id.ToString() == _FieldParaBaseId)
            {
                IPositionBll    _IPositionBll = BllInstance.PositionBllInstance;
                List <Position> all           = _IPositionBll.GetAllPosition();
                foreach (Position item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.Grades.Id.ToString() == _FieldParaBaseId)
            {
                var all = GradesType.GetAll();
                foreach (var item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.Department.Id.ToString() == _FieldParaBaseId)
            {
                IDepartmentBll    _IDepartmentBll = BllInstance.DepartmentBllInstance;
                List <Department> all             = _IDepartmentBll.GetAllDepartment();
                all = Tools.RemoteUnAuthDeparetment(all, AuthType.HRMIS, _OperatorAccount, HrmisPowers.A401);
                foreach (Department item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.Company.Id.ToString() == _FieldParaBaseId)
            {
                GetCompanyInvolve _GetCompanyInvolve = new GetCompanyInvolve();
                List <Department> all = _GetCompanyInvolve.GetAllCompanyHaveEmployee();
                foreach (Department item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.Gender.Id.ToString() == _FieldParaBaseId)
            {
                List <Gender> all = Gender.AllGenders;
                foreach (Gender item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.DimissionReasonType.Id.ToString() == _FieldParaBaseId)
            {
                List <DimissionReasonType> all = DimissionReasonType.GetAll();
                foreach (DimissionReasonType item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.DiyProcessApplicationTypeOut.Id.ToString() == _FieldParaBaseId)
            {
                GetDiyProcess     _GetDiyProcess = new GetDiyProcess();
                List <DiyProcess> all            =
                    _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.ApplicationTypeOut.Id);
                foreach (DiyProcess item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.DiyProcessApplicationTypeOverTime.Id.ToString() == _FieldParaBaseId)
            {
                GetDiyProcess     _GetDiyProcess = new GetDiyProcess();
                List <DiyProcess> all            =
                    _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.ApplicationTypeOverTime.Id);
                foreach (DiyProcess item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.DiyProcessAssess.Id.ToString() == _FieldParaBaseId)
            {
                GetDiyProcess     _GetDiyProcess = new GetDiyProcess();
                List <DiyProcess> all            =
                    _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.Assess.Id);
                foreach (DiyProcess item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.DiyProcessHRPrincipal.Id.ToString() == _FieldParaBaseId)
            {
                GetDiyProcess     _GetDiyProcess = new GetDiyProcess();
                List <DiyProcess> all            =
                    _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.HRPrincipal.Id);
                foreach (DiyProcess item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.DiyProcessLeaveRequest.Id.ToString() == _FieldParaBaseId)
            {
                GetDiyProcess     _GetDiyProcess = new GetDiyProcess();
                List <DiyProcess> all            =
                    _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.LeaveRequest.Id);
                foreach (DiyProcess item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.DiyProcessTraineeApplication.Id.ToString() == _FieldParaBaseId)
            {
                GetDiyProcess     _GetDiyProcess = new GetDiyProcess();
                List <DiyProcess> all            =
                    _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.TraineeApplication.Id);
                foreach (DiyProcess item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.EducationalBackground.Id.ToString() == _FieldParaBaseId)
            {
                List <EducationalBackground> all = EducationalBackground.AllEducationalBackgrounds;
                foreach (EducationalBackground item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.MaritalStatus.Id.ToString() == _FieldParaBaseId)
            {
                List <MaritalStatus> all = MaritalStatus.GetAllMaritalStatus();
                foreach (MaritalStatus item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.PoliticalAffiliation.Id.ToString() == _FieldParaBaseId)
            {
                List <PoliticalAffiliation> all = PoliticalAffiliation.AllPoliticalAffiliations;
                foreach (PoliticalAffiliation item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.WorkType.Id.ToString() == _FieldParaBaseId)
            {
                List <WorkType> all = WorkType.GetAll();
                foreach (WorkType item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            if (EmployeeFieldPara.CountryNationality.Id.ToString() == _FieldParaBaseId)
            {
                GetNationality     _GetNationality = new GetNationality();
                List <Nationality> all             = _GetNationality.GetNationalityByCondition(-1, "");
                foreach (Nationality item in all)
                {
                    result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
                }
            }
            return(result);
        }