예제 #1
0
 private void Init()
 {
     _view.Message           = string.Empty;
     _view.SearchByName     += view_SearchByName;
     _view.SearchByIndexKey += view_SearchByIndexKey;
     _view.SaveLinkman      += view_SaveLinkman;
     _view.DeleteLinkman    += _view_DeleteLinkman;
     //获取公司id
     _CompanyId = _IEmployeeFacade.GetEmployeeByAccountID(_view.UserId).EmployeeDetails.Work.Company.DepartmentID;
 }
예제 #2
0
        /// <summary>
        /// ÐÞ¸Ä
        /// </summary>
        public void ExecutEvent(object source, EventArgs e)
        {
            if (!new EmployeeValidater(_ItsView).Validation())
            {
                return;
            }

            _ItsView.ResultMessage = string.Empty;

            Account account = new EmployeeDataCollector(_ItsView).AccountDataCollect();

            account.Id = _ItsView.EmployeeID;
            try
            {
                if (!CompanyConfig.HasHrmisSystem)
                {
                    BllInstance.AccountBllInstance.UpdateAccount(account, LoginUser);
                    GoToListPage();
                    return;
                }

                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    BllInstance.AccountBllInstance.UpdateAccount(account, LoginUser);

                    IEmployeeFacade hrmisEmployeeFacade = new EmployeeFacade();
                    Employee        currEmployee        = hrmisEmployeeFacade.GetEmployeeByAccountID(account.Id);
                    if (currEmployee != null)
                    {
                        hrmisEmployeeFacade.UpdateEmployeeProxy(currEmployee, LoginUser);
                    }
                    else if (account.IsHRAccount)
                    {
                        hrmisEmployeeFacade.InitEmployeeProxy(account.Id, LoginUser);
                    }
                    ts.Complete();
                }
                GoToListPage();
            }
            catch (Exception ex)
            {
                _ItsView.ResultMessage =
                    //"&nbsp;&nbsp;&nbsp;<img src='../../image/icon03.jpg' align='absmiddle'' />&nbsp;&nbsp;&nbsp;<span class='fontred'>" +
                    ex.Message;// +"</span>";
            }
        }