private void EditVacation(long? vacationId) { var vac = vacations.FirstOrDefault(v => v.Id == vacationId); var newVac = new VacationViewModel(this, vac, true); SelectedVacationForEdit = newVac; }
private void InsertVacation(long? employeeId) { var levelPlan = Levels.FirstOrDefault(l => string.Compare(VACATIONLEVELPLAN, l.SystemName, true) == 0); var newVac = new VacationViewModel(this, new VacationService.Vacation() { EmployeeId = employeeId ?? Staffing.Current.Id, VacationLevelId = levelPlan.Id, Begin = DateTime.Now, DayCount = 1 }, true); SelectedVacationForEdit = newVac; }