Exemplo n.º 1
0
        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
            });
        }
Exemplo n.º 2
0
 public async Task AddLogEntryAsync(string message, string logType)
 {
     _edFiDb.Logs.Add(new Log()
     {
         LogMessage = message, LogType = logType
     });
     await _edFiDb.SaveChangesAsync();
 }
        public async Task SaveNotificationIdentifier(NotificationsIdentifierModel model)
        {
            var fieldExist = _edFiDb.NotificationsTokens.FirstOrDefault(n => n.PersonUniqueId.Equals(model.PersonUniqueId) && n.DeviceUuid.Equals(model.DeviceUUID));

            if (fieldExist != null && fieldExist.Token != model.Token)
            {
                fieldExist.Token            = model.Token;
                fieldExist.LastModifiedDate = DateTime.Now;
            }
            else
            {
                _edFiDb.NotificationsTokens.Add(new NotificationsToken()
                {
                    PersonUniqueId = model.PersonUniqueId,
                    Token          = model.Token,
                    PersonType     = model.PersonType,
                    DeviceUuid     = model.DeviceUUID
                });
            }
            await _edFiDb.SaveChangesAsync();
        }