Exemplo n.º 1
0
        private ContactActivityFilter ConvertFilterDTOToFilterEntity(Contact_ContactActivityFilterDTO Contact_ContactActivityFilterDTO)
        {
            ContactActivityFilter ContactActivityFilter = new ContactActivityFilter();

            ContactActivityFilter.Selects   = ContactActivitySelect.ALL;
            ContactActivityFilter.Skip      = Contact_ContactActivityFilterDTO.Skip;
            ContactActivityFilter.Take      = Contact_ContactActivityFilterDTO.Take;
            ContactActivityFilter.OrderBy   = Contact_ContactActivityFilterDTO.OrderBy;
            ContactActivityFilter.OrderType = Contact_ContactActivityFilterDTO.OrderType;

            ContactActivityFilter.Id                 = Contact_ContactActivityFilterDTO.Id;
            ContactActivityFilter.Title              = Contact_ContactActivityFilterDTO.Title;
            ContactActivityFilter.FromDate           = Contact_ContactActivityFilterDTO.FromDate;
            ContactActivityFilter.ToDate             = Contact_ContactActivityFilterDTO.ToDate;
            ContactActivityFilter.ActivityTypeId     = Contact_ContactActivityFilterDTO.ActivityTypeId;
            ContactActivityFilter.ActivityPriorityId = Contact_ContactActivityFilterDTO.ActivityPriorityId;
            ContactActivityFilter.Description        = Contact_ContactActivityFilterDTO.Description;
            ContactActivityFilter.Address            = Contact_ContactActivityFilterDTO.Address;
            ContactActivityFilter.ContactId          = Contact_ContactActivityFilterDTO.ContactId;
            ContactActivityFilter.AppUserId          = Contact_ContactActivityFilterDTO.AppUserId;
            ContactActivityFilter.ActivityStatusId   = Contact_ContactActivityFilterDTO.ActivityStatusId;
            ContactActivityFilter.CreatedAt          = Contact_ContactActivityFilterDTO.CreatedAt;
            ContactActivityFilter.UpdatedAt          = Contact_ContactActivityFilterDTO.UpdatedAt;
            return(ContactActivityFilter);
        }
Exemplo n.º 2
0
        public async Task <ActionResult <int> > CountActivity([FromBody] Contact_ContactActivityFilterDTO Contact_ContactActivityFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            ContactActivityFilter ContactActivityFilter = ConvertFilterDTOToFilterEntity(Contact_ContactActivityFilterDTO);

            ContactActivityFilter = await ContactActivityService.ToFilter(ContactActivityFilter);

            int count = await ContactActivityService.Count(ContactActivityFilter);

            return(count);
        }
Exemplo n.º 3
0
        public async Task <ActionResult <List <Contact_ContactActivityDTO> > > ListActivity([FromBody] Contact_ContactActivityFilterDTO Contact_ContactActivityFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            ContactActivityFilter ContactActivityFilter = ConvertFilterDTOToFilterEntity(Contact_ContactActivityFilterDTO);

            ContactActivityFilter = await ContactActivityService.ToFilter(ContactActivityFilter);

            List <ContactActivity> ContactActivities = await ContactActivityService.List(ContactActivityFilter);

            List <Contact_ContactActivityDTO> Contact_ContactActivityDTOs = ContactActivities
                                                                            .Select(c => new Contact_ContactActivityDTO(c)).ToList();

            return(Contact_ContactActivityDTOs);
        }