public void DeleteTask(int id)
        {
            Task task = _repository.Get(id);

            if (task == null)
            {
                return;
            }

            _repository.RemoveTask(task);
        }
        // GET: Report
        public ActionResult Display(int id)
        {
            var timesheets = _timesheetRepository.Get(id);

            var viewModel = new List <TimesheetModel>();

            foreach (var timesheet in timesheets)
            {
                var timesheetModel = new TimesheetModel
                {
                    Hours = timesheet.HoursWorked,
                    Date  = timesheet.Date
                };
                viewModel.Add(timesheetModel);
            }
            return(View(viewModel));
        }
Exemple #3
0
 public Timesheet Get(string id)
 {
     return(_mapper.Map <Timesheet>(_timesheetRepository.Get(id)));
 }
 public Timesheet Get(int id)
 {
     return(_timesheetRepository.Get(id));
 }