public PersonalInAndOutDeletePresenter(IPersonalInAndOutView view, Account loginUser)
     : base(loginUser)
 {
     _View    = view;
     _Utility = new PersonalInAndOutUtilityPresenter(_View, loginUser);
     AttachViewEvent();
 }
        public void InitView(bool isPostBack)
        {
            _View.SetButtonVisible = false;
            _View.TimeErrorMessage = string.Empty;

            if (!isPostBack)
            {
                List <Department> departmentList = BllInstance.DepartmentBllInstance.GetAllDepartment();
                _View.departmentSource = Tools.RemoteUnAuthDeparetment(departmentList, AuthType.HRMIS, _LoginUser, HrmisPowers.A504);

                _View.IOStatusSource      = PersonalInAndOutUtilityPresenter.IoStatusSource();
                _View.OperateStatusSource = PersonalInAndOutUtilityPresenter.OperateStatusSource();

                _View.HoursSource   = DutyClassUtility.Hours();
                _View.MinutesSource = DutyClassUtility.Minutes();
                _View.TimeFrom      = "1900-1-1 0:00:00";
                _View.TimeTo        = "2999-12-31 23:59:00";
                DataBind();
            }
        }
示例#3
0
        public void Initialize(bool isPostBack)
        {
            _View.SetButtonVisible = true;
            _View.TimeErrorMessage = string.Empty;

            if (isPostBack)
            {
                return;
            }

            if (!ValidateEmployeeId())
            {
                _View.ErrorMessage = "初始错误";
                return;
            }
            try
            {
                //Employee employee = _GetEmployee.GetEmployeeByAccountID(_EmployeeId);
                Account account = BllInstance.AccountBllInstance.GetAccountById(_EmployeeId);
                _View.EmployeeName = account.Name;
                List <Department> departmentList = BllInstance.DepartmentBllInstance.GetAllDepartment();
                _View.departmentSource = Tools.RemoteUnAuthDeparetment(departmentList, AuthType.HRMIS, _LoginUser, HrmisPowers.A504);

                _View.Department = account.Dept.Id;
            }
            catch
            {
                _View.ErrorMessage = "初始错误";
            }
            _View.IOStatusSource      = PersonalInAndOutUtilityPresenter.IoStatusSource();
            _View.OperateStatusSource = PersonalInAndOutUtilityPresenter.OperateStatusSource();

            _View.HoursSource   = DutyClassUtility.Hours();
            _View.MinutesSource = DutyClassUtility.Minutes();


            _View.TimeFrom = string.IsNullOrEmpty(_View.TempTimeFrom) ? "1900-1-1 0:00:00" : _View.TempTimeFrom;
            _View.TimeTo   = string.IsNullOrEmpty(_View.TempTimeTo) ? "2999-12-31 23:59:00" : _View.TempTimeTo;

            DataBind();
        }