Exemplo n.º 1
0
        public async Task <ActionResult <List <CallLog_CallEmotionDTO> > > SingleListCallEmotion([FromBody] CallLog_CallEmotionFilterDTO CallLog_CallEmotionFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            CallEmotionFilter CallEmotionFilter = new CallEmotionFilter();

            CallEmotionFilter.Skip      = 0;
            CallEmotionFilter.Take      = 20;
            CallEmotionFilter.OrderBy   = CallEmotionOrder.Id;
            CallEmotionFilter.OrderType = OrderType.ASC;
            CallEmotionFilter.Selects   = CallEmotionSelect.ALL;
            CallEmotionFilter.Id        = CallLog_CallEmotionFilterDTO.Id;
            CallEmotionFilter.Name      = CallLog_CallEmotionFilterDTO.Name;
            CallEmotionFilter.Code      = CallLog_CallEmotionFilterDTO.Code;
            CallEmotionFilter.StatusId  = new IdFilter {
                Equal = StatusEnum.ACTIVE.Id
            };
            CallEmotionFilter.Description = CallLog_CallEmotionFilterDTO.Description;

            List <CallEmotion> CallEmotions = await CallEmotionService.List(CallEmotionFilter);

            List <CallLog_CallEmotionDTO> CallLog_CallEmotionDTOs = CallEmotions
                                                                    .Select(x => new CallLog_CallEmotionDTO(x)).ToList();

            return(CallLog_CallEmotionDTOs);
        }
Exemplo n.º 2
0
 public async Task<List<CallEmotion>> List(CallEmotionFilter filter)
 {
     if (filter == null) return new List<CallEmotion>();
     IQueryable<CallEmotionDAO> CallEmotionDAOs = DataContext.CallEmotion.AsNoTracking();
     CallEmotionDAOs = DynamicFilter(CallEmotionDAOs, filter);
     CallEmotionDAOs = DynamicOrder(CallEmotionDAOs, filter);
     List<CallEmotion> CallEmotions = await DynamicSelect(CallEmotionDAOs, filter);
     return CallEmotions;
 }
Exemplo n.º 3
0
        public async Task <List <CallEmotion> > List(CallEmotionFilter CallEmotionFilter)
        {
            try
            {
                List <CallEmotion> CallEmotions = await UOW.CallEmotionRepository.List(CallEmotionFilter);

                return(CallEmotions);
            }
            catch (Exception ex)
            {
                await Logging.CreateSystemLog(ex, nameof(CallEmotionService));
            }
            return(null);
        }
Exemplo n.º 4
0
        public async Task <int> Count(CallEmotionFilter CallEmotionFilter)
        {
            try
            {
                int result = await UOW.CallEmotionRepository.Count(CallEmotionFilter);

                return(result);
            }
            catch (Exception ex)
            {
                await Logging.CreateSystemLog(ex, nameof(CallEmotionService));
            }
            return(0);
        }
Exemplo n.º 5
0
 public async Task <CallEmotionFilter> ToFilter(CallEmotionFilter filter)
 {
     if (filter.OrFilter == null)
     {
         filter.OrFilter = new List <CallEmotionFilter>();
     }
     if (CurrentContext.Filters == null || CurrentContext.Filters.Count == 0)
     {
         return(filter);
     }
     foreach (var currentFilter in CurrentContext.Filters)
     {
         CallEmotionFilter subFilter = new CallEmotionFilter();
         filter.OrFilter.Add(subFilter);
         List <FilterPermissionDefinition> FilterPermissionDefinitions = currentFilter.Value;
         foreach (FilterPermissionDefinition FilterPermissionDefinition in FilterPermissionDefinitions)
         {
             if (FilterPermissionDefinition.Name == nameof(subFilter.Id))
             {
                 subFilter.Id = FilterBuilder.Merge(subFilter.Id, FilterPermissionDefinition.IdFilter);
             }
             if (FilterPermissionDefinition.Name == nameof(subFilter.Code))
             {
                 subFilter.Code = FilterBuilder.Merge(subFilter.Code, FilterPermissionDefinition.StringFilter);
             }
             if (FilterPermissionDefinition.Name == nameof(subFilter.Name))
             {
                 subFilter.Name = FilterBuilder.Merge(subFilter.Name, FilterPermissionDefinition.StringFilter);
             }
             if (FilterPermissionDefinition.Name == nameof(subFilter.StatusId))
             {
                 subFilter.StatusId = FilterBuilder.Merge(subFilter.StatusId, FilterPermissionDefinition.IdFilter);
             }
             if (FilterPermissionDefinition.Name == nameof(subFilter.Description))
             {
                 subFilter.Description = FilterBuilder.Merge(subFilter.Description, FilterPermissionDefinition.StringFilter);
             }
             if (FilterPermissionDefinition.Name == nameof(CurrentContext.UserId) && FilterPermissionDefinition.IdFilter != null)
             {
                 if (FilterPermissionDefinition.IdFilter.Equal.HasValue && FilterPermissionDefinition.IdFilter.Equal.Value == CurrentUserEnum.IS.Id)
                 {
                 }
                 if (FilterPermissionDefinition.IdFilter.Equal.HasValue && FilterPermissionDefinition.IdFilter.Equal.Value == CurrentUserEnum.ISNT.Id)
                 {
                 }
             }
         }
     }
     return(filter);
 }
Exemplo n.º 6
0
        public async Task <bool> ValidateId(CallEmotion CallEmotion)
        {
            CallEmotionFilter CallEmotionFilter = new CallEmotionFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = CallEmotion.Id
                },
                Selects = CallEmotionSelect.Id
            };

            int count = await UOW.CallEmotionRepository.Count(CallEmotionFilter);

            if (count == 0)
            {
                CallEmotion.AddError(nameof(CallEmotionValidator), nameof(CallEmotion.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
Exemplo n.º 7
0
 private IQueryable<CallEmotionDAO> DynamicOrder(IQueryable<CallEmotionDAO> query, CallEmotionFilter filter)
 {
     switch (filter.OrderType)
     {
         case OrderType.ASC:
             switch (filter.OrderBy)
             {
                 case CallEmotionOrder.Id:
                     query = query.OrderBy(q => q.Id);
                     break;
                 case CallEmotionOrder.Code:
                     query = query.OrderBy(q => q.Code);
                     break;
                 case CallEmotionOrder.Name:
                     query = query.OrderBy(q => q.Name);
                     break;
                 case CallEmotionOrder.Status:
                     query = query.OrderBy(q => q.StatusId);
                     break;
                 case CallEmotionOrder.Description:
                     query = query.OrderBy(q => q.Description);
                     break;
                 case CallEmotionOrder.Used:
                     query = query.OrderBy(q => q.Used);
                     break;
                 case CallEmotionOrder.Row:
                     query = query.OrderBy(q => q.RowId);
                     break;
             }
             break;
         case OrderType.DESC:
             switch (filter.OrderBy)
             {
                 case CallEmotionOrder.Id:
                     query = query.OrderByDescending(q => q.Id);
                     break;
                 case CallEmotionOrder.Code:
                     query = query.OrderByDescending(q => q.Code);
                     break;
                 case CallEmotionOrder.Name:
                     query = query.OrderByDescending(q => q.Name);
                     break;
                 case CallEmotionOrder.Status:
                     query = query.OrderByDescending(q => q.StatusId);
                     break;
                 case CallEmotionOrder.Description:
                     query = query.OrderByDescending(q => q.Description);
                     break;
                 case CallEmotionOrder.Used:
                     query = query.OrderByDescending(q => q.Used);
                     break;
                 case CallEmotionOrder.Row:
                     query = query.OrderByDescending(q => q.RowId);
                     break;
             }
             break;
     }
     query = query.Skip(filter.Skip).Take(filter.Take);
     return query;
 }
Exemplo n.º 8
0
 private IQueryable<CallEmotionDAO> OrFilter(IQueryable<CallEmotionDAO> query, CallEmotionFilter filter)
 {
     if (filter.OrFilter == null || filter.OrFilter.Count == 0)
         return query;
     IQueryable<CallEmotionDAO> initQuery = query.Where(q => false);
     foreach (CallEmotionFilter CallEmotionFilter in filter.OrFilter)
     {
         IQueryable<CallEmotionDAO> queryable = query;
         if (CallEmotionFilter.Id != null && CallEmotionFilter.Id.HasValue)
             queryable = queryable.Where(q => q.Id, CallEmotionFilter.Id);
         if (CallEmotionFilter.Code != null && CallEmotionFilter.Code.HasValue)
             queryable = queryable.Where(q => q.Code, CallEmotionFilter.Code);
         if (CallEmotionFilter.Name != null && CallEmotionFilter.Name.HasValue)
             queryable = queryable.Where(q => q.Name, CallEmotionFilter.Name);
         if (CallEmotionFilter.StatusId != null && CallEmotionFilter.StatusId.HasValue)
             queryable = queryable.Where(q => q.StatusId, CallEmotionFilter.StatusId);
         if (CallEmotionFilter.Description != null && CallEmotionFilter.Description.HasValue)
             queryable = queryable.Where(q => q.Description, CallEmotionFilter.Description);
         if (CallEmotionFilter.RowId != null && CallEmotionFilter.RowId.HasValue)
             queryable = queryable.Where(q => q.RowId, CallEmotionFilter.RowId);
         initQuery = initQuery.Union(queryable);
     }
     return initQuery;
 }    
Exemplo n.º 9
0
 private IQueryable<CallEmotionDAO> DynamicFilter(IQueryable<CallEmotionDAO> query, CallEmotionFilter filter)
 {
     if (filter == null)
         return query.Where(q => false);
     query = query.Where(q => !q.DeletedAt.HasValue);
     if (filter.CreatedAt != null && filter.CreatedAt.HasValue)
         query = query.Where(q => q.CreatedAt, filter.CreatedAt);
     if (filter.UpdatedAt != null && filter.UpdatedAt.HasValue)
         query = query.Where(q => q.UpdatedAt, filter.UpdatedAt);
     if (filter.Id != null && filter.Id.HasValue)
         query = query.Where(q => q.Id, filter.Id);
     if (filter.Code != null && filter.Code.HasValue)
         query = query.Where(q => q.Code, filter.Code);
     if (filter.Name != null && filter.Name.HasValue)
         query = query.Where(q => q.Name, filter.Name);
     if (filter.StatusId != null && filter.StatusId.HasValue)
         query = query.Where(q => q.StatusId, filter.StatusId);
     if (filter.Description != null && filter.Description.HasValue)
         query = query.Where(q => q.Description, filter.Description);
     if (filter.RowId != null && filter.RowId.HasValue)
         query = query.Where(q => q.RowId, filter.RowId);
     query = OrFilter(query, filter);
     return query;
 }
Exemplo n.º 10
0
 public async Task<int> Count(CallEmotionFilter filter)
 {
     IQueryable<CallEmotionDAO> CallEmotions = DataContext.CallEmotion.AsNoTracking();
     CallEmotions = DynamicFilter(CallEmotions, filter);
     return await CallEmotions.CountAsync();
 }
Exemplo n.º 11
0
 private async Task<List<CallEmotion>> DynamicSelect(IQueryable<CallEmotionDAO> query, CallEmotionFilter filter)
 {
     List<CallEmotion> CallEmotions = await query.Select(q => new CallEmotion()
     {
         Id = filter.Selects.Contains(CallEmotionSelect.Id) ? q.Id : default(long),
         Code = filter.Selects.Contains(CallEmotionSelect.Code) ? q.Code : default(string),
         Name = filter.Selects.Contains(CallEmotionSelect.Name) ? q.Name : default(string),
         StatusId = filter.Selects.Contains(CallEmotionSelect.Status) ? q.StatusId : default(long),
         Description = filter.Selects.Contains(CallEmotionSelect.Description) ? q.Description : default(string),
         Used = filter.Selects.Contains(CallEmotionSelect.Used) ? q.Used : default(bool),
         RowId = filter.Selects.Contains(CallEmotionSelect.Row) ? q.RowId : default(Guid),
         Status = filter.Selects.Contains(CallEmotionSelect.Status) && q.Status != null ? new Status
         {
             Id = q.Status.Id,
             Code = q.Status.Code,
             Name = q.Status.Name,
         } : null,
     }).ToListAsync();
     return CallEmotions;
 }
Exemplo n.º 12
0
        public async Task <ActionResult> ExportTemplate([FromBody] CallLog_CallLogFilterDTO CallLog_CallLogFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            MemoryStream memoryStream = new MemoryStream();

            using (ExcelPackage excel = new ExcelPackage(memoryStream))
            {
                #region CallLog
                var CallLogHeaders = new List <string[]>()
                {
                    new string[] {
                        "Id",
                        "EntityReferenceId",
                        "CallTypeId",
                        "CallEmotionId",
                        "AppUserId",
                        "Title",
                        "Content",
                        "Phone",
                        "CallTime",
                        "Used",
                    }
                };
                List <object[]> CallLogData = new List <object[]>();
                excel.GenerateWorksheet("CallLog", CallLogHeaders, CallLogData);
                #endregion

                #region AppUser
                var AppUserFilter = new AppUserFilter();
                AppUserFilter.Selects   = AppUserSelect.ALL;
                AppUserFilter.OrderBy   = AppUserOrder.Id;
                AppUserFilter.OrderType = OrderType.ASC;
                AppUserFilter.Skip      = 0;
                AppUserFilter.Take      = int.MaxValue;
                List <AppUser> AppUsers = await AppUserService.List(AppUserFilter);

                var AppUserHeaders = new List <string[]>()
                {
                    new string[] {
                        "Id",
                        "Username",
                        "DisplayName",
                        "Address",
                        "Email",
                        "Phone",
                        "SexId",
                        "Birthday",
                        "Avatar",
                        "PositionId",
                        "Department",
                        "OrganizationId",
                        "ProvinceId",
                        "Longitude",
                        "Latitude",
                        "StatusId",
                    }
                };
                List <object[]> AppUserData = new List <object[]>();
                for (int i = 0; i < AppUsers.Count; i++)
                {
                    var AppUser = AppUsers[i];
                    AppUserData.Add(new Object[]
                    {
                        AppUser.Id,
                        AppUser.Username,
                        AppUser.DisplayName,
                        AppUser.Address,
                        AppUser.Email,
                        AppUser.Phone,
                        AppUser.SexId,
                        AppUser.Birthday,
                        AppUser.Avatar,
                        AppUser.PositionId,
                        AppUser.Department,
                        AppUser.OrganizationId,
                        AppUser.ProvinceId,
                        AppUser.Longitude,
                        AppUser.Latitude,
                        AppUser.StatusId,
                    });
                }
                excel.GenerateWorksheet("AppUser", AppUserHeaders, AppUserData);
                #endregion
                #region EntityReference
                var EntityReferenceFilter = new EntityReferenceFilter();
                EntityReferenceFilter.Selects   = EntityReferenceSelect.ALL;
                EntityReferenceFilter.OrderBy   = EntityReferenceOrder.Id;
                EntityReferenceFilter.OrderType = OrderType.ASC;
                EntityReferenceFilter.Skip      = 0;
                EntityReferenceFilter.Take      = int.MaxValue;
                List <EntityReference> EntityReferences = await EntityReferenceService.List(EntityReferenceFilter);

                var EntityReferenceHeaders = new List <string[]>()
                {
                    new string[] {
                        "Id",
                        "Code",
                        "Name",
                    }
                };
                List <object[]> EntityReferenceData = new List <object[]>();
                for (int i = 0; i < EntityReferences.Count; i++)
                {
                    var EntityReference = EntityReferences[i];
                    EntityReferenceData.Add(new Object[]
                    {
                        EntityReference.Id,
                        EntityReference.Code,
                        EntityReference.Name,
                    });
                }
                excel.GenerateWorksheet("EntityReference", EntityReferenceHeaders, EntityReferenceData);
                #endregion
                #region CallType
                var CallTypeFilter = new CallTypeFilter();
                CallTypeFilter.Selects   = CallTypeSelect.ALL;
                CallTypeFilter.OrderBy   = CallTypeOrder.Id;
                CallTypeFilter.OrderType = OrderType.ASC;
                CallTypeFilter.Skip      = 0;
                CallTypeFilter.Take      = int.MaxValue;
                List <CallType> CallTypes = await CallTypeService.List(CallTypeFilter);

                var CallTypeHeaders = new List <string[]>()
                {
                    new string[] {
                        "Id",
                        "Code",
                        "Name",
                        "ColorCode",
                        "StatusId",
                        "Used",
                    }
                };
                List <object[]> CallTypeData = new List <object[]>();
                for (int i = 0; i < CallTypes.Count; i++)
                {
                    var CallType = CallTypes[i];
                    CallTypeData.Add(new Object[]
                    {
                        CallType.Id,
                        CallType.Code,
                        CallType.Name,
                        CallType.ColorCode,
                        CallType.StatusId,
                        CallType.Used,
                    });
                }
                excel.GenerateWorksheet("CallType", CallTypeHeaders, CallTypeData);
                #endregion
                #region CallEmotion
                var CallEmotionFilter = new CallEmotionFilter();
                CallEmotionFilter.Selects   = CallEmotionSelect.ALL;
                CallEmotionFilter.OrderBy   = CallEmotionOrder.Id;
                CallEmotionFilter.OrderType = OrderType.ASC;
                CallEmotionFilter.Skip      = 0;
                CallEmotionFilter.Take      = int.MaxValue;
                List <CallEmotion> CallEmotions = await CallEmotionService.List(CallEmotionFilter);

                var CallEmotionHeaders = new List <string[]>()
                {
                    new string[] {
                        "Id",
                        "Name",
                        "Code",
                        "StatusId",
                        "DisplayOrder",
                        "Description",
                    }
                };
                List <object[]> CallEmotionData = new List <object[]>();
                for (int i = 0; i < CallEmotions.Count; i++)
                {
                    var CallEmotion = CallEmotions[i];
                    CallEmotionData.Add(new Object[]
                    {
                        CallEmotion.Id,
                        CallEmotion.Name,
                        CallEmotion.Code,
                        CallEmotion.StatusId,
                        CallEmotion.Description,
                    });
                }
                excel.GenerateWorksheet("CallEmotion", CallEmotionHeaders, CallEmotionData);
                #endregion
                excel.Save();
            }
            return(File(memoryStream.ToArray(), "application/octet-stream", "CallLog.xlsx"));
        }
Exemplo n.º 13
0
        public async Task <ActionResult> Import(IFormFile file)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }
            AppUserFilter AppUserFilter = new AppUserFilter
            {
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = AppUserSelect.ALL
            };
            List <AppUser> AppUsers = await AppUserService.List(AppUserFilter);

            EntityReferenceFilter EntityReferenceFilter = new EntityReferenceFilter
            {
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = EntityReferenceSelect.ALL
            };
            List <EntityReference> EntityReferences = await EntityReferenceService.List(EntityReferenceFilter);

            CallTypeFilter CallTypeFilter = new CallTypeFilter
            {
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = CallTypeSelect.ALL
            };
            List <CallType> CallTypes = await CallTypeService.List(CallTypeFilter);

            CallEmotionFilter CallEmotionFilter = new CallEmotionFilter
            {
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = CallEmotionSelect.ALL
            };
            List <CallEmotion> CallEmotions = await CallEmotionService.List(CallEmotionFilter);

            List <CallLog> CallLogs = new List <CallLog>();

            using (ExcelPackage excelPackage = new ExcelPackage(file.OpenReadStream()))
            {
                ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.FirstOrDefault();
                if (worksheet == null)
                {
                    return(Ok(CallLogs));
                }
                int StartColumn             = 1;
                int StartRow                = 1;
                int IdColumn                = 0 + StartColumn;
                int EntityReferenceIdColumn = 1 + StartColumn;
                int CallTypeIdColumn        = 2 + StartColumn;
                int CallEmotionIdColumn     = 3 + StartColumn;
                int AppUserIdColumn         = 4 + StartColumn;
                int TitleColumn             = 5 + StartColumn;
                int ContentColumn           = 6 + StartColumn;
                int PhoneColumn             = 7 + StartColumn;
                int CallTimeColumn          = 8 + StartColumn;
                int UsedColumn              = 12 + StartColumn;

                for (int i = StartRow; i <= worksheet.Dimension.End.Row; i++)
                {
                    if (string.IsNullOrEmpty(worksheet.Cells[i + StartRow, StartColumn].Value?.ToString()))
                    {
                        break;
                    }
                    string IdValue = worksheet.Cells[i + StartRow, IdColumn].Value?.ToString();
                    string EntityReferenceIdValue = worksheet.Cells[i + StartRow, EntityReferenceIdColumn].Value?.ToString();
                    string CallTypeIdValue        = worksheet.Cells[i + StartRow, CallTypeIdColumn].Value?.ToString();
                    string CallEmotionIdValue     = worksheet.Cells[i + StartRow, CallEmotionIdColumn].Value?.ToString();
                    string AppUserIdValue         = worksheet.Cells[i + StartRow, AppUserIdColumn].Value?.ToString();
                    string TitleValue             = worksheet.Cells[i + StartRow, TitleColumn].Value?.ToString();
                    string ContentValue           = worksheet.Cells[i + StartRow, ContentColumn].Value?.ToString();
                    string PhoneValue             = worksheet.Cells[i + StartRow, PhoneColumn].Value?.ToString();
                    string CallTimeValue          = worksheet.Cells[i + StartRow, CallTimeColumn].Value?.ToString();
                    string UsedValue = worksheet.Cells[i + StartRow, UsedColumn].Value?.ToString();

                    CallLog CallLog = new CallLog();
                    CallLog.Title    = TitleValue;
                    CallLog.Content  = ContentValue;
                    CallLog.Phone    = PhoneValue;
                    CallLog.CallTime = DateTime.TryParse(CallTimeValue, out DateTime CallTime) ? CallTime : DateTime.Now;
                    AppUser AppUser = AppUsers.Where(x => x.Id.ToString() == AppUserIdValue).FirstOrDefault();
                    CallLog.AppUserId = AppUser == null ? 0 : AppUser.Id;
                    CallLog.AppUser   = AppUser;
                    EntityReference EntityReference = EntityReferences.Where(x => x.Id.ToString() == EntityReferenceIdValue).FirstOrDefault();
                    CallLog.EntityReferenceId = EntityReference == null ? 0 : EntityReference.Id;
                    CallLog.EntityReference   = EntityReference;
                    CallType CallType = CallTypes.Where(x => x.Id.ToString() == CallTypeIdValue).FirstOrDefault();
                    CallLog.CallTypeId = CallType == null ? 0 : CallType.Id;
                    CallLog.CallType   = CallType;
                    CallEmotion CallEmotion = CallEmotions.Where(x => x.Id.ToString() == CallEmotionIdValue).FirstOrDefault();
                    CallLog.CallEmotionId = CallEmotion == null ? 0 : CallEmotion.Id;
                    CallLog.CallEmotion   = CallEmotion;

                    CallLogs.Add(CallLog);
                }
            }
            CallLogs = await CallLogService.Import(CallLogs);

            if (CallLogs.All(x => x.IsValidated))
            {
                return(Ok(true));
            }
            else
            {
                List <string> Errors = new List <string>();
                for (int i = 0; i < CallLogs.Count; i++)
                {
                    CallLog CallLog = CallLogs[i];
                    if (!CallLog.IsValidated)
                    {
                        string Error = $"Dòng {i + 2} có lỗi:";
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.Id)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.Id)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.EntityReferenceId)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.EntityReferenceId)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.CallTypeId)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.CallTypeId)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.CallEmotionId)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.CallEmotionId)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.AppUserId)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.AppUserId)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.Title)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.Title)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.Content)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.Content)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.Phone)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.Phone)];
                        }
                        if (CallLog.Errors.ContainsKey(nameof(CallLog.CallTime)))
                        {
                            Error += CallLog.Errors[nameof(CallLog.CallTime)];
                        }
                        Errors.Add(Error);
                    }
                }
                return(BadRequest(Errors));
            }
        }