private void CalculateAnnualLeave()
        {
            decimal costTime = 0;
            //读取年假信息
            Vacation vacation = _IVacationFacade.GetLastVacationByAccountID(Convert.ToInt32(_ItsView.EmployeeID));

            if (vacation != null)
            {
                costTime = vacation.SurplusDayNum * 8;
            }
            if (_ItsView.AnnualLeave == null)
            {
                _ItsView.AnnualLeave = costTime;
            }
            else
            {
                _ItsView.AnnualLeave = costTime - _ItsView.AnnualLeave;
            }
        }
 public void InitVacation(Employee employee, bool isPostBack)
 {
     if (!isPostBack)
     {
         Vacation vacation = _IVacationFacade.GetLastVacationByAccountID(employee.Account.Id);
         if (vacation != null)
         {
             _IVacationBaseView.EmployeeID        = vacation.Employee.Account.Id.ToString();
             _IVacationBaseView.EmployeeName      = vacation.Employee.Account.Name;
             _IVacationBaseView.VacationID        = vacation.VacationID.ToString();
             _IVacationBaseView.SurplusDayNum     = vacation.SurplusDayNum.ToString();
             _IVacationBaseView.UsedDayNum        = vacation.UsedDayNum.ToString();
             _IVacationBaseView.Remark            = vacation.Remark;
             _IVacationBaseView.VacationDayNum    = vacation.VacationDayNum.ToString();
             _IVacationBaseView.VacationEndDate   = vacation.VacationEndDate.ToShortDateString();
             _IVacationBaseView.VacationStartDate = vacation.VacationStartDate.ToShortDateString();
         }
     }
 }
Esempio n. 3
0
        private List <Vacation> SearchVacation()
        {
            List <Vacation> vacations = new List <Vacation>();

            foreach (Employee emplyee in _EmployeeList)
            {
                vacations.Add(_IVacationFacade.GetLastVacationByAccountID(emplyee.Account.Id));
                if (emplyee.EmployeeDetails != null)
                {
                    if (emplyee.EmployeeDetails.CountryNationality != null &&
                        emplyee.EmployeeDetails.CountryNationality.ParameterID != 0)
                    {
                        emplyee.EmployeeDetails.CountryNationality =
                            _ItsNationalityFacade.GetNationalityByPkid(
                                emplyee.EmployeeDetails.CountryNationality.ParameterID);
                    }
                }
            }
            return(vacations);
        }