private void SubmitTimesheet(TimesheetWeek timesheet)
        {
            timesheet.SubmittedByAdmin = true;
            timesheetService.Submit(timesheet);
            timesheetService.Approve(timesheet);

            timesheet.Expenses.ForEach(expense =>
            {
                expensesService.Submit(expense);
                expensesService.Approve(expense);
            });
        }
Example #2
0
        public async Task <IHttpActionResult> PostApprove([FromBody] UserDateDto userDate)
        {
            try
            {
                var result = await _timesheetService.Approve(userDate);

                return(this.JsonDataResult(result));
            }
            catch (Exception e)
            {
                //Logger.Log(LogLevel.Error, e);
                return(new InternalServerErrorResult(this));
            }
        }