private void UpdateAccountPosition(Position position)
 {
     foreach (Account account in position.Members)
     {
         if (account.Position.Id == position.Id)
         {
             continue;
         }
         account.Position = position;
         BllInstance.AccountBllInstance.UpdateAccount(account, _Operator);
         if (CompanyConfig.HasHrmisSystem)
         {
             IEmployeeFacade hrmisEmployeeFacade = InstanceFactory.CreateEmployeeFacade();
             Employee        currEmployee        = hrmisEmployeeFacade.GetEmployeeByAccountID(account.Id);
             if (currEmployee != null)
             {
                 hrmisEmployeeFacade.UpdateEmployeeProxy(currEmployee, _Operator);
             }
             else if (account.IsHRAccount)
             {
                 hrmisEmployeeFacade.InitEmployeeProxy(account.Id, _Operator);
             }
         }
     }
 }
示例#2
0
        /// <summary>
        /// 点击确定按钮后引发的事件
        /// </summary>
        public void BtnActionEvent()
        {
            foreach (IUpdateEmployeePresenter aPresenter in _ThePresenters)
            {
                if (!aPresenter.Vaildate())
                {
                    _ItsView.Message       = EmployeePresenterUtilitys._ErrorEmployeeNotCompleted;
                    _ItsView.ActionSuccess = false;
                    return;
                }
            }
            Employee theEmployee = _IEmployeeFacade.GetEmployeeByAccountID(int.Parse(_EmployeeId));

            foreach (IUpdateEmployeePresenter aPresenter in _ThePresenters)
            {
                aPresenter.CompleteTheObject(theEmployee);
            }
            if (!ValidateProhibation(theEmployee))
            {
                _ItsView.ActionSuccess = false;
                return;
            }
            try
            {
                _IEmployeeFacade.UpdateEmployeeProxy(theEmployee, _OperatorAccount);
                //重新绑定福利历史
                _ItsView.WelfareInfoView.EmployeeWelfareHistory = theEmployee.EmployeeWelfareHistory = _IEmployeeWelfareFacade.GetEmployeeWelfareHistoryByAccountID(Convert.ToInt32(_EmployeeId));;

                _ItsView.Message       = "操作成功";
                _ItsView.ActionSuccess = true;

                SetExtraInfoToView(_IEmployeeFacade.GetEmployeeByAccountID(int.Parse(_EmployeeId)));
            }
            catch (ApplicationException ae)
            {
                _ItsView.Message       = ae.Message;
                _ItsView.ActionSuccess = false;
            }
        }