...
This commit is contained in:
@@ -61,7 +61,8 @@ namespace Hushian.Application.Services
|
||||
GroupID = dto.GroupID,
|
||||
ConversationResponses = new List<ConversationResponse>() { new() { Text = dto.Question, Type = type } }
|
||||
};
|
||||
Response.Value = (await _ConversationRepository.ADD(conversation)).ID;
|
||||
var mi = await _ConversationRepository.ADD(conversation);
|
||||
Response.Value = mi.ID;
|
||||
Response.Success = Response.Value > 0;
|
||||
}
|
||||
else Response.Errors.Add("شناسه گروه صحیح نمی باشد");
|
||||
@@ -139,7 +140,7 @@ namespace Hushian.Application.Services
|
||||
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
|
||||
status = s.Status,
|
||||
UserID = s.UserID,
|
||||
UserFullName = s.User.FullName
|
||||
UserFullName = string.IsNullOrEmpty(s.User.FullName) ? s.User.Mobile : s.User.FullName
|
||||
|
||||
}).ToListAsync();
|
||||
public async Task<List<Read_ConversationResponseDto>> GetConversationItems(int ConversationID)
|
||||
@@ -170,6 +171,7 @@ namespace Hushian.Application.Services
|
||||
.Where(w => w.ConversationResponses.Any(a => a.ExperID == ExperID) && w.Status == status)
|
||||
.Select(s => new Read_ConversationDto()
|
||||
{
|
||||
ID=s.ID,
|
||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
||||
GroupID = s.GroupID,
|
||||
@@ -181,7 +183,7 @@ namespace Hushian.Application.Services
|
||||
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
|
||||
status = s.Status,
|
||||
UserID = s.UserID,
|
||||
UserFullName = s.User.FullName
|
||||
UserFullName = string.IsNullOrEmpty(s.User.FullName) ? s.User.Mobile : s.User.FullName
|
||||
|
||||
}).ToListAsync();
|
||||
public async Task<List<Read_ConversationDto>> GetConversationByCompanyID(int CompanyID, ConversationStatus status)
|
||||
@@ -191,6 +193,7 @@ namespace Hushian.Application.Services
|
||||
.Where(w => w.CompanyID==CompanyID && w.Status ==status)
|
||||
.Select(s => new Read_ConversationDto()
|
||||
{
|
||||
ID = s.ID,
|
||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
||||
GroupID = s.GroupID,
|
||||
@@ -202,7 +205,7 @@ namespace Hushian.Application.Services
|
||||
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
|
||||
status = s.Status,
|
||||
UserID = s.UserID,
|
||||
UserFullName = s.User.FullName
|
||||
UserFullName = string.IsNullOrEmpty(s.User.FullName) ? s.User.Mobile : s.User.FullName
|
||||
|
||||
}).ToListAsync();
|
||||
public async Task<List<Read_ConversationDto>> ConversationAwaitingOurResponse(int CompanyID)
|
||||
@@ -212,6 +215,7 @@ namespace Hushian.Application.Services
|
||||
.Where(w => w.Status== ConversationStatus.Recorded && w.CompanyID == CompanyID)
|
||||
.Select(s => new Read_ConversationDto()
|
||||
{
|
||||
ID = s.ID,
|
||||
ExperID = s.ConversationResponses.OrderBy(o=>o.ID).Last().ExperID,
|
||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
||||
GroupID = s.GroupID,
|
||||
@@ -223,7 +227,7 @@ namespace Hushian.Application.Services
|
||||
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
|
||||
status = s.Status,
|
||||
UserID = s.UserID,
|
||||
UserFullName = s.User.FullName
|
||||
UserFullName = string.IsNullOrEmpty(s.User.FullName) ? s.User.Mobile : s.User.FullName
|
||||
|
||||
}).ToListAsync();
|
||||
public async Task<bool> FinishConversation(int ConversationID)
|
||||
|
Reference in New Issue
Block a user