Example #1
0
        public bool ReportWrongAdvertisement(string userId, WrongAdvertisementIssueModel model)
        {
            var issue = new WrongAdvertisementIssue();

            issue.IssueAuthorId   = userId;
            issue.Reason          = model.Reason;
            issue.AdvertisementId = model.AdvertisementId;

            feedbackDbService.SaveWrongAdvertisementIssue(issue);
            this.emailService.ReportWrongAdvertisementIssue(model);
            return(true);
        }
Example #2
0
        public void SaveWrongAdvertisementIssue(WrongAdvertisementIssue issue)
        {
            if (issue.Id > 0)
            {
                context.Entry(issue).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            }
            else
            {
                context.WrongAdvertisementIssue.Add(issue);
            }

            context.SaveChanges();
        }