コード例 #1
0
        public async Task <ActionResult <int> > CountCallLog([FromBody] Contact_CallLogFilterDTO Contact_CallLogFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            CallLogFilter CallLogFilter = ConvertFilterCallLog(Contact_CallLogFilterDTO);

            CallLogFilter = await CallLogService.ToFilter(CallLogFilter);

            int count = await CallLogService.Count(CallLogFilter);

            return(count);
        }
コード例 #2
0
        public async Task <ActionResult <List <Contact_CallLogDTO> > > ListCallLog([FromBody] Contact_CallLogFilterDTO Contact_CallLogFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            CallLogFilter CallLogFilter = ConvertFilterCallLog(Contact_CallLogFilterDTO);

            CallLogFilter = await CallLogService.ToFilter(CallLogFilter);

            List <CallLog> CallLogs = await CallLogService.List(CallLogFilter);

            List <Contact_CallLogDTO> Contact_CallLogDTOs = CallLogs
                                                            .Select(c => new Contact_CallLogDTO(c)).ToList();

            return(Contact_CallLogDTOs);
        }
コード例 #3
0
        private CallLogFilter ConvertFilterCallLog(Contact_CallLogFilterDTO Contact_CallLogFilterDTO)
        {
            CallLogFilter CallLogFilter = new CallLogFilter();

            CallLogFilter.Selects   = CallLogSelect.ALL;
            CallLogFilter.Skip      = Contact_CallLogFilterDTO.Skip;
            CallLogFilter.Take      = Contact_CallLogFilterDTO.Take;
            CallLogFilter.OrderBy   = Contact_CallLogFilterDTO.OrderBy;
            CallLogFilter.OrderType = Contact_CallLogFilterDTO.OrderType;

            CallLogFilter.Id                = Contact_CallLogFilterDTO.Id;
            CallLogFilter.Title             = Contact_CallLogFilterDTO.Title;
            CallLogFilter.Content           = Contact_CallLogFilterDTO.Content;
            CallLogFilter.Phone             = Contact_CallLogFilterDTO.Phone;
            CallLogFilter.CallTime          = Contact_CallLogFilterDTO.CallTime;
            CallLogFilter.EntityReferenceId = Contact_CallLogFilterDTO.EntityReferenceId;
            CallLogFilter.EntityId          = Contact_CallLogFilterDTO.EntityId;
            CallLogFilter.CallTypeId        = Contact_CallLogFilterDTO.CallTypeId;
            CallLogFilter.CallEmotionId     = Contact_CallLogFilterDTO.CallEmotionId;
            CallLogFilter.AppUserId         = Contact_CallLogFilterDTO.AppUserId;
            CallLogFilter.CreatorId         = Contact_CallLogFilterDTO.CreatorId;
            return(CallLogFilter);
        }