Esempio n. 1
0
 public void AddEvent(object sender, EventArgs e)
 {
     if (VacationBasePresenter.Validation(_VacationBaseView))
     {
         Vacation vacation =
             new Vacation(0, _ItsView.Employee,
                          Convert.ToDecimal(_VacationBaseView.VacationDayNum),
                          Convert.ToDateTime(_VacationBaseView.VacationStartDate),
                          Convert.ToDateTime(_VacationBaseView.VacationEndDate),
                          Convert.ToDecimal(_VacationBaseView.UsedDayNum),
                          Convert.ToDecimal(_VacationBaseView.SurplusDayNum),
                          _VacationBaseView.Remark);
         _IVacationFacade.AddVacation(vacation);
         _ItsView.VacationList = _IVacationFacade.GetVacationByAccountID(_ItsView.Employee.Account.Id);
     }
 }
Esempio n. 2
0
 public void ExecuteAddEvent(object sender, EventArgs e)
 {
     if (VacationBasePresenter.Validation(_IVacationBaseView))
     {
         Employee employee = new Employee(Convert.ToInt32(_IVacationBaseView.EmployeeID), EmployeeTypeEnum.All);
         employee.Account.Name = _IVacationBaseView.EmployeeName;
         Vacation vacation =
             new Vacation(0, employee,
                          Convert.ToDecimal(_IVacationBaseView.VacationDayNum),
                          Convert.ToDateTime(_IVacationBaseView.VacationStartDate),
                          Convert.ToDateTime(_IVacationBaseView.VacationEndDate),
                          Convert.ToDecimal(_IVacationBaseView.UsedDayNum),
                          Convert.ToDecimal(_IVacationBaseView.SurplusDayNum),
                          _IVacationBaseView.Remark);
         try
         {
             _IVacationFacade.AddVacation(vacation);
         }
         catch (ApplicationException ex)
         {
             _IVacationBaseListView.Message = ex.Message;
         }
     }
 }