Exemple #1
0
 /// <summary>
 /// 根据活动状态的ID,获取相应的考评活动
 /// </summary>
 /// <param name="AssessActivityID"></param>
 /// <returns></returns>
 public Model.AssessActivity GetAssessActivityByAssessActivityID(int AssessActivityID)
 {
     Model.AssessActivity assessActivity = _AssessActivityDal.GetAssessActivityById(AssessActivityID);
     assessActivity.ItsEmployee.Account =
         BllInstance.AccountBllInstance.GetAccountById(assessActivity.ItsEmployee.Account.Id);
     return(assessActivity);
 }
        private static decimal NewCalculateScores(Model.AssessActivity assessActivity)
        {
            Model.AssessActivity assess = _IAssessActivity.GetAssessActivityById(assessActivity.AssessActivityID);
            double totalScore           = 0;

            foreach (SubmitInfo submitInfo in assess.ItsAssessActivityPaper.SubmitInfoes)
            {
                foreach (AssessActivityItem item in submitInfo.ItsAssessActivityItems)
                {
                    if (item.AssessActivityItemType == AssessActivityItemType.HrItem)
                    {
                        totalScore += ((double)item.Grade * (double)item.Weight);
                    }
                    //else if (item.AssessActivityItemType == AssessActivityItemType.PersonalItem)
                    //{
                    //    totalScore += ((double)item.Grade * (double)item.Weight * 0.3);
                    //}
                    else if (item.AssessActivityItemType == AssessActivityItemType.ManagerItem)
                    {
                        totalScore += ((double)item.Grade * (double)item.Weight);
                    }
                }
            }
            decimal totle = Convert.ToDecimal(Math.Round(totalScore, 2));

            assess.ItsAssessActivityPaper.Score = totle;
            _IAssessActivity.UpdateAssessActivity(assess);
            return(totle);
        }
        public void btnConfirmClick(object sender, EventArgs e)
        {
            int assessActivityID;

            if (!int.TryParse(_StrAssessActivityId, out assessActivityID))
            {
                _View.Message = "绩效考核活动信息传入错误";
                return;
            }

            if (!Validation())
            {
                return;
            }

            try
            {
                InstanceFactory.AssessActivityFacade().ConfirmActivityExcute(assessActivityID, _View.AssessTempletPaperID,
                                                                             Convert.ToDateTime(
                                                                                 _View.ManagerExpectedFinish),
                                                                             Convert.ToDateTime(_View.PersonalExpectedTime),
                                                                             LoginUser.Name);
                Model.AssessActivity assessActivity =
                    _AssessActivityFacade.GetAssessActivityByAssessActivityID(assessActivityID);

                _View.SubmitID = assessActivity.ItsAssessActivityPaper.SubmitInfoes[0].SubmitInfoID.ToString();
                NextPageRedirect(assessActivityID);
            }
            catch (Exception ex)
            {
                _View.Message = ex.Message;
            }
        }
        public override void Initialize(bool isPostBack)
        {
            _View.Message = string.Empty;
            int assessActivityID;

            if (!int.TryParse(_StrAssessActivityId, out assessActivityID))
            {
                _View.Message = "绩效考核活动信息传入错误";
                return;
            }
            List <AssessTemplatePaper> allTemplatePaper =
                InstanceFactory.CreateAssessManagementFacade().GetAllTemplatePaper();

            if (!isPostBack)
            {
                _View.AssessTempletPaperNames = allTemplatePaper;
                _View.PersonalExpectedTime    = DateTime.Now.Date.AddDays(7).ToShortDateString();
                _View.ManagerExpectedFinish   = DateTime.Now.Date.AddDays(14).ToShortDateString();
                Model.AssessActivity assessActivity =
                    _AssessActivityFacade.GetAssessActivityByAssessActivityID(assessActivityID);
                if (assessActivity.AssessCharacterType == AssessCharacterType.Annual)
                {
                    int id =
                        _AssessManagementFacade.GetTempletPaperIDByEmployeePositionID(
                            _AccountBll.GetAccountById(assessActivity.ItsEmployee.Account.Id).Position.Id);
                    if (id > 0)
                    {
                        _View.AssessTempletPaperID = id;
                    }
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// 初始化主管人事个人在哪一个位置
        /// </summary>
        private static void GetIndex(Model.AssessActivity assessActivity, ref int submintInfoSelfIndex,
                                     ref int submintInfoManageIndex,
                                     ref int submintInfoHrIndex, ref int submitInfoCeoIndex)
        {
            for (int j = 0; j < assessActivity.ItsAssessActivityPaper.SubmitInfoes.Count; j++)
            {
                if (assessActivity.ItsAssessActivityPaper.SubmitInfoes[j].SubmitInfoType.Id ==
                    SubmitInfoType.ManagerAssess.Id)
                {
                    submintInfoManageIndex = j;
                }
                else if (assessActivity.ItsAssessActivityPaper.SubmitInfoes[j].SubmitInfoType.Id ==
                         SubmitInfoType.HRAssess.Id)
                {
                    submintInfoHrIndex = j;
                }

                else if (assessActivity.ItsAssessActivityPaper.SubmitInfoes[j].SubmitInfoType.Id ==
                         SubmitInfoType.MyselfAssess.Id)
                {
                    submintInfoSelfIndex = j;
                }
                else if (assessActivity.ItsAssessActivityPaper.SubmitInfoes[j].SubmitInfoType.Id ==
                         SubmitInfoType.Approve.Id)
                {
                    submitInfoCeoIndex = j;
                }
            }
        }
Exemple #6
0
 protected override void Validation()
 {
     _AssessActivity = _Dal.GetAssessActivityById(_AssessActivityID);
     if (_AssessActivity == null)
     {
         BllUtility.ThrowException(BllExceptionConst._InvalidActivityId);
     }
 }
Exemple #7
0
 private void PrepareData()
 {
     _AssessActivity = _DalAssessActivity.GetAssessActivityById(_AssessActivityId);
     _AssessActivity.ItsEmployee.Account =
         BllInstance.AccountBllInstance.GetAccountById(_AssessActivity.ItsEmployee.Account.Id);
     _AssessActivity.ItsEmployee.Account.Dept =
         _IDepartmentBll.GetDepartmentById(_AssessActivity.ItsEmployee.Account.Dept.Id, null);
 }
Exemple #8
0
 /// <summary>
 /// SystemAssess的构造函数,专为测试提供
 /// </summary>
 public ManualAssess(Model.AssessActivity assessActivity, IAssessActivity mockDal, IGoalBll iGoal, IEmployee iEmployee, IActiveFlow iActiveFlow)
 {
     _AssessActivity = assessActivity;
     _Dal            = mockDal;
     _IGoal          = iGoal;
     _IEmployee      = iEmployee;
     _IActiveFlow    = iActiveFlow;
 }
        private void PrepareData()
        {
            _AssessActivity = _DalAssessActivity.GetAssessActivityById(_AssessActivityId);
            _AssessActivity.ItsEmployee.Account =
                BllInstance.AccountBllInstance.GetAccountById(_AssessActivity.ItsEmployee.Account.Id);
            List <AssessActivityItem> assessActivityItems =
                _AssessActivity.ItsAssessActivityPaper.FindManagerAssessActivityItems();

            //todo yyb
            _AssessActivity.ItsAssessActivityPaper.ItsAssessActivityItems.Clear();
            _AssessActivity.ItsAssessActivityPaper.ItsAssessActivityItems = assessActivityItems;
            _AssessActivity.ItsEmployee.Account.Dept =
                _IDepartmentBll.GetDepartmentById(_AssessActivity.ItsEmployee.Account.Dept.Id, null);
        }
Exemple #10
0
        protected override void ValidateSelf()
        {
            Model.AssessActivity assessActivity = _IAssessActivity.GetAssessActivityById(_ActivityId);
            if (assessActivity != null)
            {
                string intention = assessActivity.Intention;

                if (_IfSubmit && !AssessActivityUtility.ValidateIntention(intention, _Intention))
                {
                    BllUtility.ThrowException(BllExceptionConst._InvalidIntention);
                }
            }
            if (_ItsAssessActivity.ItsAssessStatus != AssessStatus.PersonalFilling)
            {
                BllUtility.ThrowException(BllExceptionConst._InvalidStatus);
            }
        }
Exemple #11
0
 protected override void Validation()
 {
     try
     {
         _itsAssessActivity = _IAssessActivity.GetAssessActivityById(_ActivityId);
         _itsAssessActivity.ItsEmployee.Account =
             BllInstance.AccountBllInstance.GetAccountById(_itsAssessActivity.ItsEmployee.Account.Id);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
     if (_itsAssessActivity == null)
     {
         BllUtility.ThrowException(BllExceptionConst._InvalidActivityId);
     }
     ValidateSelf();
 }
 public static string ExportAssessFormEvent(string employeeTemplateLocationAnnual, string employeeTemplateLocationNormal, int id)
 {
     Model.AssessActivity assess =
         InstanceFactory.AssessActivityFacade().GetAssessActivityByAssessActivityID(
             id);
     if (assess.AssessCharacterType == AssessCharacterType.Annual)
     {
         return
             (InstanceFactory.AssessActivityFacade().ExportAnnualAssessForm(
                  id, employeeTemplateLocationAnnual));
     }
     else
     {
         return
             (InstanceFactory.AssessActivityFacade().ExportExportNormalForContractAssessForm(
                  id, employeeTemplateLocationNormal));
     }
 }
Exemple #13
0
 protected override void Validation()
 {
     _AssessActivity = _Dal.GetAssessActivityById(_AssessActivityID);
     if (_AssessActivity == null)
     {
         BllUtility.ThrowException(BllExceptionConst._InvalidActivityId);
     }
     _AssessActivity.ItsEmployee.Account =
         BllInstance.AccountBllInstance.GetAccountById(_AssessActivity.ItsEmployee.Account.Id);
     if (_AssessActivity.ItsAssessStatus == AssessStatus.Finish)
     {
         BllUtility.ThrowException(BllExceptionConst._Activity_Is_Finish);
     }
     if (_AssessActivity.ItsAssessStatus == AssessStatus.Interrupt)
     {
         BllUtility.ThrowException(BllExceptionConst._Activity_Is_Interrupt);
     }
 }
Exemple #14
0
        private static string WriteEmailContent(Model.AssessActivity assessActivityItem, Contract contract)
        {
            StringBuilder emailContentBuilder = new StringBuilder();

            emailContentBuilder.Append("根据");
            emailContentBuilder.Append("第");
            emailContentBuilder.Append(contract.ContractID);
            emailContentBuilder.Append("号合同——");
            emailContentBuilder.Append(contract.ContractType.ContractTypeName);
            emailContentBuilder.Append(contract.StartDate.ToShortDateString());
            emailContentBuilder.Append("---");
            emailContentBuilder.Append(contract.EndDate.ToShortDateString());
            emailContentBuilder.Append(",系统自动为 ");
            emailContentBuilder.Append(assessActivityItem.ItsEmployee.Account.Name);
            emailContentBuilder.Append(" 发起一次");
            emailContentBuilder.Append(AssessActivityUtility.GetCharacterNameByType(assessActivityItem.AssessCharacterType));
            emailContentBuilder.Append("; ");
            return(emailContentBuilder.ToString());
        }
        private void NextPageRedirect(int assessActivityID)
        {
            Model.AssessActivity assessActivity =
                _AssessActivityFacade.GetAssessActivityByAssessActivityID(assessActivityID);
            Account operAccount = _AssessActivityFacade.GetDiyStepAccount(assessActivity.ItsEmployee.Account.Id,
                                                                          assessActivity.DiyProcess.DiySteps[
                                                                              assessActivity.NextStepIndex]);

            ;
            if (operAccount.Id == LoginUser.Id
                &&
                assessActivity.DiyProcess.DiySteps[assessActivity.NextStepIndex].Status == AssessActivityName.HRAssess)
            {
                ToFillAssessPage("HRFillAssess.aspx?", null);
            }
            else
            {
                ToFillAssessPage("GetConfirmAssesses.aspx", null);
            }
        }
Exemple #16
0
 protected override void Validation()
 {
     try
     {
         _ItsAssessActivity = _IAssessActivity.GetAssessActivityById(_ActivityId);
         _ItsAssessActivity.ItsEmployee.Account =
             BllInstance.AccountBllInstance.GetAccountById(_ItsAssessActivity.ItsEmployee.Account.Id);
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
     if (_ItsAssessActivity == null)
     {
         BllUtility.ThrowException(BllExceptionConst._InvalidActivityId);
     }
     if (_ItsAssessActivity.ItsAssessStatus != AssessStatus.HRComfirming)
     {
         BllUtility.ThrowException(BllExceptionConst._InvalidStatus);
     }
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="assessActivity"></param>
 /// <returns></returns>
 public decimal CalculateScores(Model.AssessActivity assessActivity)
 {
     return(NewCalculateScores(assessActivity));
     //double count = 0;
     //double totalScore = 0;
     //foreach (AssessActivityItem item in assessActivity.ItsAssessActivityPaper.ItsAssessActivityItems)
     //{
     //    if(item.AssessTemplateItemType==AssessTemplateItemType.Option)
     //    {
     //        if (item is HRItem)
     //        {
     //            count++;
     //            totalScore += item.Grade;
     //        }
     //        else if (item is PersonalItem)
     //        {
     //            count += 0.5;
     //            totalScore += (item.Grade * 0.3);
     //        }
     //        else if (item is ManagerItem)
     //        {
     //            count += 0.5;
     //            totalScore += (item.Grade * 0.7);
     //        }
     //    }
     //}
     //if(count.Equals(0))
     //{
     //    return 0;
     //}
     //else
     //{
     //    double score = totalScore / (count * 5);
     //    return Convert.ToDecimal(Math.Round(score * 100));
     //}
 }
Exemple #18
0
 /// <summary>
 ///
 /// </summary>
 public MakeAssessPaper(AssessTemplatePaper assessTemplatePaper, Model.AssessActivity assessActivity)
 {
     _AssessTemplatePaper = assessTemplatePaper;
     _AssessActivity      = assessActivity;
 }
Exemple #19
0
        protected override void ExcuteSelf()
        {
            _MailBodyListToHR = new List <MailBody>();
            List <ApplyAssessCondition> applyAssessConditions = _IContract.GetApplyAssessConditionByCurrDate(_CurrDate);

            if (_CurrDate.Month == 12 && _CurrDate.Day == 1)
            {
                applyAssessConditions = applyAssessConditions ?? new List <ApplyAssessCondition>();
                var contracts = _IContract.GetEmployeeContractByContractTypeId(5);
                if (contracts != null)
                {
                    foreach (var contract in contracts)
                    {
                        applyAssessConditions.Add(new ApplyAssessCondition(0)
                        {
                            EmployeeContractID = contract.ContractID, ApplyAssessCharacterType = AssessCharacterType.Annual, AssessScopeFrom = new DateTime(_CurrDate.Year, 1, 1), AssessScopeTo = new DateTime(_CurrDate.Year, 12, 31)
                        });
                    }
                }
            }


            foreach (ApplyAssessCondition conditionItem in applyAssessConditions)
            {
                Contract contract = _IContract.GetEmployeeContractByContractId(conditionItem.EmployeeContractID);
                Employee employee = _GetEmployee.GetEmployeeBasicInfoByAccountID(contract.EmployeeID);
                if (employee.EmployeeType == EmployeeTypeEnum.DimissionEmployee ||
                    employee.EmployeeType == EmployeeTypeEnum.BorrowedEmployee)
                {
                    continue;
                }
                Model.AssessActivity assessActivityItem = new Model.AssessActivity();
                assessActivityItem.AssessCharacterType = conditionItem.ApplyAssessCharacterType;
                assessActivityItem.ScopeFrom           = conditionItem.AssessScopeFrom;
                assessActivityItem.ScopeTo             = conditionItem.AssessScopeTo;
                assessActivityItem.ItsEmployee         = employee;
                assessActivityItem.EmployeeDept        = employee.Account.Dept.DepartmentName;
                assessActivityItem.AssessProposerName  = "系统自动发起";
                assessActivityItem.Reason = WriteEmailContent(assessActivityItem, contract);
                //新增考核活动
                _ManualAssess = new ManualAssess(assessActivityItem);
                try
                {
                    _ManualAssess.Excute();
                }
                catch (Exception ex)
                {
                    new AutoRemindServerUtility(_GetDiyProcess).CreateHREmail(employee.Account.Id,
                                                                              _MailBodyListToHR,
                                                                              "系统自动发起的" + employee.Account.Name +
                                                                              "绩效考核失败,失败原因:" + ex.Message + "(相关参考信息:" +
                                                                              assessActivityItem.Reason + ")",
                                                                              Environment.NewLine);
                }
                employee.EmployeeDetails = null;
            }
            if (_MailBodyListToHR.Count > 0)
            {
                try
                {
                    //发给人事邮件
                    SendEmailToHR(_MailBodyListToHR);
                }
                catch
                {
                    throw new Exception("人力资源部邮件提醒发送失败");
                }
            }
        }
Exemple #20
0
 /// <summary>
 /// ManualAsses的构造函数
 /// </summary>
 public ManualAssess(Model.AssessActivity assessActivity)
 {
     _AssessActivity = assessActivity;
 }
        public override void Initialize(bool isPostBack)
        {
            _View.Message = string.Empty;
            int assessActivityID;

            if (!int.TryParse(_StrAssessActivityId, out assessActivityID))
            {
                _View.Message = "考核信息传入错误";
                return;
            }

            _AssessActivity = InstanceFactory.AssessActivityFacade().GetAssessActivityByAssessActivityID(assessActivityID);
            if (_AssessActivity.AssessCharacterType == AssessCharacterType.ProbationII)
            {
                _View.SalaryName = "转正后工资&nbsp;<span class=\"redstar\">*</span>";
            }
            else if (_AssessActivity.AssessCharacterType == AssessCharacterType.Annual)
            {
                _View.SalaryName = "建议工资";
            }
            int submitID;

            if (!int.TryParse(_StrSubmitId, out submitID))
            {
                _View.Message = "考核信息传入错误";
                return;
            }

            if (submitID == 0)
            {
                _SubmitInfo = _AssessActivity.ItsAssessActivityPaper.SubmitInfoes[_AssessActivity.NextStepIndex];
            }
            else
            {
                for (int i = 0; i < _AssessActivity.ItsAssessActivityPaper.SubmitInfoes.Count; i++)
                {
                    if (_AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SubmitInfoID == submitID)
                    {
                        _SubmitInfo = _AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i];
                    }
                }
            }
            for (int i = 0; i < _AssessActivity.ItsAssessActivityPaper.SubmitInfoes.Count; i++)
            {
                if (_AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SubmitInfoType.Id ==
                    SubmitInfoType.HRAssess.Id)
                {
                    _SalaryNow = _AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SalaryNow;
                }
                else if (_AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SubmitInfoType.Id ==
                         SubmitInfoType.Approve.Id)
                {
                    _SalaryChange = _AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SalaryChange;
                }
                else if (_AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SubmitInfoType.Id ==
                         SubmitInfoType.ManagerAssess.Id)
                {
                    if (
                        !string.IsNullOrEmpty(
                            _AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SalaryChange.ToString()))
                    {
                        _ManageSalary =
                            string.Format("主管意见:{0}",
                                          _AssessActivity.ItsAssessActivityPaper.SubmitInfoes[i].SalaryChange);
                    }
                }
            }
        }