public async Task <JsonResult> Feedback(int id, FeedbackRequestModel model) { try { FeedbackDTO feedbackDTO = Mapper.Map <FeedbackRequestModel, FeedbackDTO>(model); if (base.CurrentUser != null) { feedbackDTO.UserId = base.CurrentUser.UserId; } feedbackDTO.PlaceId = id; try { feedbackDTO.IpAddress = this.Request.HttpContext.Connection .RemoteIpAddress .ToString(); } catch (Exception ex) { LoggerExtensions.LogError(_logger, ex, "IP Address error", Array.Empty <object>()); } return(this.Json((object)(await _feedbackService.AddFeedbackAsync(feedbackDTO)))); } catch (Exception ex2) { return(this.Json((object)Result.Fail("İşleminiz gerçekleştirilemedi", ex2))); } }
public async Task <FeedbackLogModel> PersistFeedback(string uniqueId, int personTypeId, FeedbackRequestModel model) { var mails = ConfigurationManager.AppSettings["feedback.emails"].Split(';'); var savedModel = await _feedbackRepository.SaveFeedback(uniqueId, personTypeId, model.Name, model.Email, model); var template = GenerateFeedbackTemplate(savedModel); await _messagingProvider.SendMessageAsync(mails, null, null, new[] { model.Email }, $"Family Portal Feedback: {model.Subject}", template); return(savedModel); }
public async Task <FeedbackLogModel> SaveFeedback(string uniqueId, int personTypeId, string name, string email, FeedbackRequestModel model) { var newFeedback = new FeedbackLog { PersonUniqueId = uniqueId, Name = name, Email = email, PersonTypeId = ChatLogPersonTypeEnum.Parent.Value, Subject = model.Subject, Issue = model.Issue, Description = model.Description, CurrentUrl = model.CurrentUrl }; _edFiDb.FeedbackLogs.Add(newFeedback); await _edFiDb.SaveChangesAsync(); return(new FeedbackLogModel { PersonUniqueId = newFeedback.PersonUniqueId, Name = newFeedback.Name, Email = newFeedback.Email, PersonTypeId = newFeedback.PersonTypeId, Subject = newFeedback.Subject, Issue = newFeedback.Issue, Description = newFeedback.Description, CurrentUrl = newFeedback.CurrentUrl, CreatedDate = newFeedback.CreateDate }); }
public async Task <IHttpActionResult> PersistFeedbackLogged(FeedbackRequestModel model) { var person = SecurityPrincipal.Current; return(Ok(await _feedbackService.PersistFeedback(person.PersonUniqueId, person.PersonTypeId, person.FirstName, person.LastSurname, person.Email, model))); }
public async Task <IHttpActionResult> PersistFeedback(FeedbackRequestModel model) { return(Ok(await _feedbackService.PersistFeedback("0", 1, model))); }