forked from ddrilling/AsbCloudServer
Merge pull request 'Правки по faq-контроллеру' (#49) from feature/faq into dev
Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/49
This commit is contained in:
commit
7aadcbe69b
@ -52,5 +52,15 @@ namespace AsbCloudApp.Data
|
|||||||
/// Частый вопрос
|
/// Частый вопрос
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFrequently { get; set; } = false;
|
public bool IsFrequently { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Автор вопроса
|
||||||
|
/// </summary>
|
||||||
|
public string AurhorQuestionName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Автор ответа
|
||||||
|
/// </summary>
|
||||||
|
public string? AurhorAnswerName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,11 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
IsFrequently = o.IsFrequently,
|
IsFrequently = o.IsFrequently,
|
||||||
State = o.State,
|
State = o.State,
|
||||||
DateCreatedQuestion = o.DateCreatedQuestion,
|
DateCreatedQuestion = o.DateCreatedQuestion,
|
||||||
|
IdAuthorQuestion = o.IdAuthorQuestion,
|
||||||
|
AurhorQuestionName = o.AuthorQuestion.MakeDisplayName(),
|
||||||
|
AurhorAnswerName = (o.AuthorAnswer != null)
|
||||||
|
? o.AuthorAnswer.MakeDisplayName()
|
||||||
|
: string.Empty,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -74,6 +79,9 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
entity.DateCreatedQuestion = entity.DateLastEditedQuestion = DateTimeOffset.UtcNow;
|
entity.DateCreatedQuestion = entity.DateLastEditedQuestion = DateTimeOffset.UtcNow;
|
||||||
entity.CounterQuestion = 1;
|
entity.CounterQuestion = 1;
|
||||||
entity.State = Faq.StateOpened;
|
entity.State = Faq.StateOpened;
|
||||||
|
if (!string.IsNullOrEmpty(entity.Answer))
|
||||||
|
entity.IdAuthorAnswer = entity.IdAuthorQuestion;
|
||||||
|
|
||||||
|
|
||||||
db.Faqs.Add(entity);
|
db.Faqs.Add(entity);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user