Ejemplo n.º 1
0
        public List <TicketsDetailsResponse> GetTicketDetails(TicketsDetailsRequest req)
        {
            try
            {
                TicketsServicesSoap ticketSoap = new TicketsServicesSoapClient();

                var reqObj = new GetTicketsRequest()
                {
                    PlateInfo = new ADPTicketsServiceReference.PlateKey()
                    {
                        PlateNo         = req.PlateNo,
                        PlateOrgNo      = req.PlateOrgNo,
                        PlateColorCode  = req.PlateColorCode,
                        PlateKindCode   = req.PlateKindCode,
                        PlateTypeCode   = req.PlateTypeCode,
                        PlateSourceCode = req.PlateSourceCode
                    },
                    LicenseInfo = new ADPTicketsServiceReference.LicenseKey()
                    {
                        LicenseNo         = req.LicenseNumber,
                        LicenseSourceCode = req.LicenseSourceCode
                    },
                    TrafficProfile = new ADPTicketsServiceReference.TrafficNo()
                    {
                        TcfNo = req.TcfNo
                    },

                    DateFrom   = req.DateFrom,
                    DateTo     = req.DateTo,
                    SystemCode = systemCode,
                    UserID     = userId
                };

                var header = new ADPTicketsServiceReference.ADPSoapHeaderIn()
                {
                    UserName = username,
                    Password = password
                };

                var result = ticketSoap.GetTickets(new GetTicketsRequest1 {
                    request = reqObj, ADPSoapHeaderIn = header
                });

                if (result != null)
                {
                    return(result.GetTicketsResult.ConvertToTicketsDetails());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                Utility.WriteErrorLog(ex);

                return(null);
            }
        }
Ejemplo n.º 2
0
        public NewTicketResponse CreateNewTicket(NewTicketRequest req)
        {
            try
            {
                TicketsServicesSoap ticketSoap = new TicketsServicesSoapClient();

                var reqObj = new CreateNewTicketRequest()
                {
                    UserID         = userId,
                    SystemCode     = systemCode,
                    TicketDateTime = req.TicketDateTime,
                    TicketType     = req.TicketType,
                    LocationCode   = req.LocationCode,
                    PlateInfo      = req.PlateInfo.ConvertToPlateKeysService(),
                    MaterialsCodes = req.MaterialsCodes,

                    //Location = req.TicketLocation
                };

                var header = new ADPTicketsServiceReference.ADPSoapHeaderIn()
                {
                    UserName = username,
                    Password = password
                };
                var result = ticketSoap.CreateNewTicket(new CreateNewTicketRequest1 {
                    request = reqObj, ADPSoapHeaderIn = header
                });

                if (result != null)
                {
                    return(new NewTicketResponse {
                        TicketNo = result.CreateNewTicketResult.TicketNo, TicketSourceCode = result.CreateNewTicketResult.TicketSourceCode
                    });
                }
                else
                {
                    return(null);
                }
            }
            catch
            {
                return(null);
            }
        }