Ejemplo n.º 1
0
        private RepairTicketFilter ConvertFilterRepairTicket(Customer_RepairTicketFilterDTO Customer_RepairTicketFilterDTO)
        {
            RepairTicketFilter RepairTicketFilter = new RepairTicketFilter();

            RepairTicketFilter.Selects   = RepairTicketSelect.ALL;
            RepairTicketFilter.Skip      = Customer_RepairTicketFilterDTO.Skip;
            RepairTicketFilter.Take      = Customer_RepairTicketFilterDTO.Take;
            RepairTicketFilter.OrderBy   = Customer_RepairTicketFilterDTO.OrderBy;
            RepairTicketFilter.OrderType = Customer_RepairTicketFilterDTO.OrderType;

            RepairTicketFilter.Id              = Customer_RepairTicketFilterDTO.Id;
            RepairTicketFilter.Code            = Customer_RepairTicketFilterDTO.Code;
            RepairTicketFilter.DeviceSerial    = Customer_RepairTicketFilterDTO.DeviceSerial;
            RepairTicketFilter.OrderId         = Customer_RepairTicketFilterDTO.OrderId;
            RepairTicketFilter.OrderCategoryId = Customer_RepairTicketFilterDTO.OrderCategoryId;
            RepairTicketFilter.RepairDueDate   = Customer_RepairTicketFilterDTO.RepairDueDate;
            RepairTicketFilter.ItemId          = Customer_RepairTicketFilterDTO.ItemId;
            RepairTicketFilter.RejectReason    = Customer_RepairTicketFilterDTO.RejectReason;
            RepairTicketFilter.DeviceState     = Customer_RepairTicketFilterDTO.DeviceState;
            RepairTicketFilter.RepairStatusId  = Customer_RepairTicketFilterDTO.RepairStatusId;
            RepairTicketFilter.RepairAddess    = Customer_RepairTicketFilterDTO.RepairAddess;
            RepairTicketFilter.ReceiveUser     = Customer_RepairTicketFilterDTO.ReceiveUser;
            RepairTicketFilter.ReceiveDate     = Customer_RepairTicketFilterDTO.ReceiveDate;
            RepairTicketFilter.RepairDate      = Customer_RepairTicketFilterDTO.RepairDate;
            RepairTicketFilter.ReturnDate      = Customer_RepairTicketFilterDTO.ReturnDate;
            RepairTicketFilter.RepairSolution  = Customer_RepairTicketFilterDTO.RepairSolution;
            RepairTicketFilter.Note            = Customer_RepairTicketFilterDTO.Note;
            RepairTicketFilter.RepairCost      = Customer_RepairTicketFilterDTO.RepairCost;
            RepairTicketFilter.PaymentStatusId = Customer_RepairTicketFilterDTO.PaymentStatusId;
            RepairTicketFilter.CustomerId      = Customer_RepairTicketFilterDTO.CustomerId;
            RepairTicketFilter.CreatorId       = Customer_RepairTicketFilterDTO.CreatorId;
            RepairTicketFilter.CreatedAt       = Customer_RepairTicketFilterDTO.CreatedAt;
            RepairTicketFilter.UpdatedAt       = Customer_RepairTicketFilterDTO.UpdatedAt;
            return(RepairTicketFilter);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <int> > CountRepairTicket([FromBody] Customer_RepairTicketFilterDTO Customer_RepairTicketFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            RepairTicketFilter RepairTicketFilter = ConvertFilterRepairTicket(Customer_RepairTicketFilterDTO);

            RepairTicketFilter = await RepairTicketService.ToFilter(RepairTicketFilter);

            int count = await RepairTicketService.Count(RepairTicketFilter);

            return(count);
        }
Ejemplo n.º 3
0
        public async Task <ActionResult <List <Customer_RepairTicketDTO> > > ListRepairTicket([FromBody] Customer_RepairTicketFilterDTO Customer_RepairTicketFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            RepairTicketFilter RepairTicketFilter = ConvertFilterRepairTicket(Customer_RepairTicketFilterDTO);

            RepairTicketFilter = await RepairTicketService.ToFilter(RepairTicketFilter);

            List <RepairTicket> RepairTickets = await RepairTicketService.List(RepairTicketFilter);

            List <Customer_RepairTicketDTO> Customer_RepairTicketDTOs = RepairTickets
                                                                        .Select(c => new Customer_RepairTicketDTO(c)).ToList();

            return(Customer_RepairTicketDTOs);
        }