Пример #1
0
        public async Task <int> Add(NewUserReportDto reportDto)
        {
            var userReportEntity = new UserReport
            {
                Date        = reportDto.Date,
                Description = reportDto.Description,
                UserId      = reportDto.AuthorId
            };

            _userReports.Add(userReportEntity);
            await _context.SaveChangesAsync();

            return(userReportEntity.Id);
        }
Пример #2
0
        public async Task <IActionResult> ProblemForm(int ATMId, string Problem)
        {
            NewUserReportDto report = new NewUserReportDto()
            {
                Date        = DateTime.Now,
                Description = Problem,
                AuthorId    = HttpContext.Session.GetComplex <User>("User").Id
            };
            await repoReport.Add(report);

            await repoJob.CreateJob(new NewJobDto()
            {
                Description = Problem, State = Data.Models.JobState.Nepriskirtas
            });

            return(Redirect("~/Home/Index"));
        }