public async Task Put(DayBookDto dayBookDto) { var dayBook = this.mapper.Map <DayBook>(dayBookDto); dayBook.Change = DateTime.Now; await this.dayBooksService.UpdateAsync(dayBook); }
public async Task Post(DayBookDto DayBookDto) { var dayBook = this.mapper.Map <DayBook>(DayBookDto); var user = await this.usersService.GetUserByCurrentSessionToken(); dayBook.DayBookId = Guid.NewGuid(); dayBook.CreationDate = DateTime.Now; dayBook.Change = DateTime.Now; dayBook.UserId = user.UserId; await this.dayBooksService.AddAsync(dayBook); }
public async Task <IActionResult> getDaybook(string fromdate, string todate) { _DaybookDTO = new DayBookDto(); try { _DaybookDTO.plstdaybookdata = await _AccountingReportsDAL.getDaybook(Con, fromdate, todate); _DaybookDTO.plstdaybooktotals = await _AccountingReportsDAL.getDaybookTotals(Con, fromdate, todate); return(Ok(_DaybookDTO)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError)); throw new FinstaAppException(ex.ToString()); } }