예제 #1
0
        private void BindInfoToView(bool pageIsPostBack)
        {
            int id;

            if (!int.TryParse(_EmployeeId, out id))
            {
                _ItsView.Message          = "初始化信息失败,请联系管理员";
                _ItsView.BtnActionVisible = false;
                _ItsView.ActionSuccess    = false;
                return;
            }

            Employee theEmployee = _IEmployeeFacade.GetEmployeeByAccountID(id);

            //福利信息绑定
            theEmployee.EmployeeWelfare        = _IEmployeeWelfareFacade.GetEmployeeWelfareByAccountID(id);
            theEmployee.EmployeeWelfareHistory = _IEmployeeWelfareFacade.GetEmployeeWelfareHistoryByAccountID(id);

            //假期信息绑定
            _TheVocationPresenter.InitTheVacation(theEmployee);
            if (!pageIsPostBack)
            {
                //tab页面的信息绑定
                foreach (IUpdateEmployeePresenter aPresenter in _ThePresenters)
                {
                    aPresenter.DataBind(theEmployee);
                }
                //员工页面中上方的信息条
                SetExtraInfoToView(theEmployee);
            }
        }
 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);
             }
         }
     }
 }
        public void DataBind()
        {
            _View.Message = string.Empty;
            int companyId = _IEmployeeFacade.GetEmployeeByAccountID(_LoginUser.Id).EmployeeDetails.Work.Company.DepartmentID;

            _View.Linkmans = _contactService.LoadSomeContactByName(CompanyConfig.SYSTEMID, 0, companyId, _View.ContactName).Linkmans;
        }
        private void BindInfoToView(bool pageIsPostBack)
        {
            int id;

            if (!int.TryParse(_EmployeeId, out id))
            {
                _ItsView.Message          = "初始化信息失败,请联系管理员";
                _ItsView.BtnActionVisible = false;
                return;
            }

            if (!pageIsPostBack)
            {
                Employee theEmployee = _IEmployeeFacade.GetEmployeeByAccountID(id);
                theEmployee.EmployeeWelfare        = _IEmployeeWelfareFacade.GetEmployeeWelfareByAccountID(id);
                theEmployee.EmployeeWelfareHistory = _IEmployeeWelfareFacade.GetEmployeeWelfareHistoryByAccountID(id);
                foreach (IViewEmployeePresenter aPresenter in _ThePresenters)
                {
                    aPresenter.DataBind(theEmployee);
                }
                //额外的界面信息绑定
                if (theEmployee.EmployeeDetails.Work != null)
                {
                    _ItsView.ComeDate = theEmployee.EmployeeDetails.Work.ComeDate <= Convert.ToDateTime("1900-01-01")
                ? string.Empty
                : theEmployee.EmployeeDetails.Work.ComeDate.ToShortDateString();
                }
                _ItsView.Department   = theEmployee.Account.Dept.Name;
                _ItsView.EmployeeName = theEmployee.Account.Name;
                _ItsView.AccountNo    = theEmployee.Account.Id.ToString();
                _ItsView.Position     = theEmployee.Account.Position.Name;
                _ItsView.PositionID   = theEmployee.Account.Position.Id.ToString();
            }
        }
예제 #5
0
        private void BindInfoToView(bool pageIsPostBack)
        {
            int id;

            if (!int.TryParse(_EmployeeId, out id))
            {
                _ItsView.Message          = "初始化信息失败,请联系管理员";
                _ItsView.BtnActionVisible = false;
                return;
            }

            if (!pageIsPostBack)
            {
                Employee theEmployee = _IEmployeeHistoryFacade.GetEmployeeHistoryByEmployeeHistoryID(id).Employee;
                Employee getPhoto    = _IEmployeeFacade.GetEmployeeByAccountID(theEmployee.Account.Id);
                theEmployee.EmployeeDetails.Photo = getPhoto.EmployeeDetails.Photo;
                foreach (IViewEmployeePresenter aPresenter in _ThePresenters)
                {
                    aPresenter.DataBind(theEmployee);
                }
                //额外的界面信息绑定
                _ItsView.ComeDate     = theEmployee.EmployeeDetails.Work.ComeDate.ToShortDateString();
                _ItsView.Department   = theEmployee.Account.Dept.Name;
                _ItsView.EmployeeName = theEmployee.Account.Name;
                _ItsView.AccountNo    = theEmployee.Account.Id.ToString();
                _ItsView.Position     = theEmployee.Account.Position.Name;
            }
        }
예제 #6
0
        /// <summary>
        /// 定义前台显示员工详情时,哪些信息不可见
        /// </summary>
        /// <param name="pageIsPostBack"></param>
        protected override void InitOthers(bool pageIsPostBack)
        {
            _ItsView.DimissionInfoVisible = false;
            _ItsView.VocationInfoVisible  = true;
            _ItsView.MailToHRVisible      = true;
            _ItsView.BtnExportVisible     = false;
            Employee theEmployee = _IEmployeeFacade.GetEmployeeByAccountID(Convert.ToInt32(_EmployeeId));

            _TheVacationPresenter.InitTheVacation(theEmployee);
            _ItsView.WelfareInfoView.EmployeeWelfareVisible = false;
        }
예제 #7
0
 private List <Employee> SearchEmployee()
 {
     _EmployeeList = Session["Employess"] as List <Employee>;
     foreach (Employee emplyee in _EmployeeList)
     {
         Employee e = _IEmployeeFacade.GetEmployeeByAccountID(emplyee.Account.Id);
         emplyee.EmployeeDetails   = e.EmployeeDetails;
         emplyee.Account           = e.Account;
         emplyee.EmployeeContracts = _IEmployeeContractFacade.GetEmployeeContractByAccountID(emplyee.Account.Id);
     }
     return(_EmployeeList);
 }
예제 #8
0
 public void AddEvent()
 {
     try
     {
         int companyId = _IEmployeeFacade.GetEmployeeByAccountID(LoginUser.Id).EmployeeDetails.Work.Company.DepartmentID;
         //userid为0,代表为公司
         _contactService.SaveLinkman(CompanyConfig.SYSTEMID, 0, companyId, CompleteLogData());
         _View.ActionSuccess = true;
     }
     catch (Exception ae)
     {
         _View.Message = ae.Message;
     }
 }
예제 #9
0
        /// <summary>
        /// 年假
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void ViewVacationEvent(object sender, CommandEventArgs e)
        {
            if (!int.TryParse(e.CommandArgument.ToString(), out _EmployeeIDForContract))
            {
                _View.ErrorMessage = "Employee ID is not exist";
                return;
            }
            try
            {
                Employee employee = _IEmployeeFacade.GetEmployeeByAccountID(_EmployeeIDForContract);
                if (employee == null)
                {
                    _View.ErrorMessage = "Employee is not exist";
                    return;
                }

                _ToVacationUpdatePageEvent();
            }
            catch (Exception ex)
            {
                _View.ErrorMessage = "<span class='fontred'>" + ex.Message + "</span>";
            }
        }
예제 #10
0
        private void GetCurrEmployee(List <Employee> employees, int employeeType, int positionID, int?gradesID, int departmentID)
        {
            Employee currEmployee = _IEmployeeFacade.GetEmployeeByAccountID(_Operator.Id);

            if (currEmployee != null)
            {
                if ((employeeType == -1 || (int)currEmployee.EmployeeType == employeeType) &&
                    (positionID == -1 || (int)currEmployee.Account.Position.Id == positionID) &&
                    (departmentID == -1 || (int)currEmployee.Account.Dept.Id == departmentID) &&
                    (gradesID == null || currEmployee.Account.GradesID == gradesID)
                    )
                {
                    employees.Add(currEmployee);
                }
            }
        }
예제 #11
0
        public void Init(bool isPostBack)
        {
            AttachViewEvent();
            _IReimburseView.SetFormReadonly   = false;
            _IReimburseView.Operation         = "新增报销单";
            _IReimburseView.SetOutCityVisible = false;
            if (!isPostBack)
            {
                _IReimburseView.ReimburseCategoriesEnumDataSrc = ReimburseCategoriesEnum.GetAll();
                _IReimburseView.ConsumeDateFrom       = DateTime.Now.ToShortDateString();
                _IReimburseView.ConsumeDateFromHour   = DateTime.Now.Hour.ToString();
                _IReimburseView.ConsumeDateFromMinute = DateTime.Now.Minute.ToString();
                _IReimburseView.ConsumeDateTo         = _IReimburseView.ConsumeDateFrom;
                _IReimburseView.ConsumeDateToHour     = _IReimburseView.ConsumeDateFromHour;
                _IReimburseView.ConsumeDateToMinute   = _IReimburseView.ConsumeDateFromMinute;
                _IReimburseView.Message = string.Empty;

                _IReimburseView.Employee           = _IEmployeeFacade.GetEmployeeByAccountID(LoginUser.Id);
                _IReimburseView.DepartmentName     = LoginUser.Dept.DepartmentName;
                _IReimburseView.ApplyDate          = DateTime.Now.ToShortDateString();
                _IReimburseView.ExchangeRateSource = ExchangeRateLogic.GetExchangeRateDistinctName();
                //if (_IReimburseView.ReimburseItemSource == null)
                //{
                _IReimburseView.ReimburseItemSource = new List <hrmisModel.ReimburseItem>();
                //}
                //else
                //{
                //    _IReimburseView.ReimburseItemSource = _IReimburseView.ReimburseItemSource;
                //}
                _IReimburseView.ReimburseHistorySource = null;
            }
            // Add bjl start
            // 差旅报销
            if (_IReimburseView.ReimburseCategoriesEnumID == "0")
            {
                _IReimburseView.IsTravelReimburse = true;
            }
            // 非差旅报销
            else if (_IReimburseView.ReimburseCategoriesEnumID == "1")
            {
                _IReimburseView.IsTravelReimburse = false;
            }
            // Add bjl end
        }
예제 #12
0
 public void UpdateContractEvent(object sender, EventArgs eventArgs)
 {
     if (Validate())
     {
         Employee     employee = _IEmployeeFacade.GetEmployeeByAccountID(_EmployeeId);
         ContractType type     = _IContractTypeFacade.GetContractTypeByPKID(Convert.ToInt32((_View.ContractTypeId)));
         Contract     contract = new Contract(_ContractId, type, _StartTime, _EndTime);
         contract.Attachment = _View.Attachment;
         contract.Remark     = _View.Remark;
         contract.EmployeeContractBookMark = _View.EmployeeContractBookMarkList;
         contract.ApplyAssessConditions    = _View.ConditionSource;
         try
         {
             _IEmployeeContractFacade.UpdateEmployeeContract(contract, employee);
             ToContractListPage(sender, null);
         }
         catch (Exception ex)
         {
             _View.ResultMessage = "<span class='fontred'>" + ex.Message + "</span>";
         }
     }
 }
        public void DataBind(Guid guid)
        {
            //获取登录员工公司id
            int     companyId = _IEmployeeFacade.GetEmployeeByAccountID(LoginUser.Id).EmployeeDetails.Work.Company.DepartmentID;
            Linkman linkman   = _contactService.LoadSomeContactByName(CompanyConfig.SYSTEMID, 0, companyId, string.Empty).GetLinkmanById(guid);

            _View.LinkManId   = linkman.Id;
            _View.LinkManName = linkman.Name;
            LinkmanDetail temp = linkman.GetLinkmanDetailByType(InfoType.Num_Mobile);

            _View.MobileNo = temp.Value;

            temp         = linkman.GetLinkmanDetailByType(InfoType.Addr_Home);
            _View.HomeNo = temp.Value;
            //ViewState["home"] = temp.Id;

            temp           = linkman.GetLinkmanDetailByType(InfoType.Addr_Work);
            _View.OfficeNo = temp.Value;
            //ViewState["work"] = temp.Id;

            temp            = linkman.GetLinkmanDetailByType(InfoType.Addr_Email);
            _View.EmailAddr = temp.Value;
            //ViewState["email"] = temp.Id;
        }