Exemple #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);
        }
Exemple #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);
        }