void OnDateChanged()
        {
            if (!IsNew)
            {
                return;
            }

            Models.HenDepreciation initialValues = null;

            try
            {
                initialValues = service.GetInitialValues(Date);
            }
            catch (Exception ex)
            {
                //TODO find the best way to refactor error
                return;
            }

            var loadedDatails = Mapper.Map <List <Models.HenDepreciationDetail>, List <HenDepreciationDetailViewModel> >(initialValues.Details);

            Details = new ObservableCollection <HenDepreciationDetailViewModel>(loadedDatails);
        }
 public HenDepreciation GetInitialValues(DateTime date)
 {
     return(service.GetInitialValues(date));
 }