コード例 #1
0
        public ActionResult CheckTicket(string Mobile)
        {
            HomeController ctlObj    = new HomeController();
            int            ContactID = ctlObj.GetContactsId(Mobile);

            string                  conditions        = "ContactId= " + ContactID;
            ServiceTicketApi        _ServiceTicketApi = new ServiceTicketApi("https://control.mysupport247.net", "Mysupport247", "SwitchvoxAPI", "mH5219b2vri0KUa", "NovaramCred1");
            List <TicketFindResult> ServiceTicketlist = _ServiceTicketApi.FindServiceTickets(conditions, "", null, null, true, new List <string>  {
                "Id",
                "CompanyName",
                "CompanyId",
                "ContactName",
                "AddressLine1",
                "City"
            });

            return(Json(ServiceTicketlist));
        }
コード例 #2
0
        public List <ServiceTicket> CollectServiceTickets(string filter)
        {
            List <string> fields = new List <string>();

            fields.Add("Id");
            ServiceTicketApi        serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);
            List <TicketFindResult> results          = serviceTicketApi.FindServiceTickets(filter, "Id", null, null, null, fields);

            logger.Info("Found " + results.Count + " Service tickets. Getting detailed ticket info...");
            List <ServiceTicket> fullTickets = new List <ServiceTicket>();
            int i = 0;

            foreach (TicketFindResult ticket in results)
            {
                i++;
                if ((i % 100) == 0)
                {
                    logger.Info(i);
                }

                try
                {
                    ServiceTicket ticketDetail = serviceTicketApi.GetServiceTicket(ticket.Id);

                    if (ticketDetail != null)
                    {
                        fullTickets.Add(ticketDetail);
                    }
                    else
                    {
                        logger.Info("Ticket details not found for: " + ticket.Id);
                    }
                }
                catch (Exception e)
                {
                    logger.Error("Error getting ticket: " + ticket.Id + " - " + e.Message);
                }
            }
            return(fullTickets);
        }
コード例 #3
0
        public List<ServiceTicket> CollectServiceTickets(string filter)
        {
            List<string> fields = new List<string>();
            fields.Add("Id");
            ServiceTicketApi serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);
            List<TicketFindResult> results = serviceTicketApi.FindServiceTickets(filter, "Id", null, null, null, fields);
            logger.Info("Found " + results.Count + " Service tickets. Getting detailed ticket info...");
            List<ServiceTicket> fullTickets = new List<ServiceTicket>();
            int i = 0;
            foreach (TicketFindResult ticket in results)
            {
                i++;
                if ((i % 100) == 0)
                    logger.Info(i);

                try
                {
                    ServiceTicket ticketDetail = serviceTicketApi.GetServiceTicket(ticket.Id);

                    if (ticketDetail != null)
                        fullTickets.Add(ticketDetail);
                    else
                        logger.Info("Ticket details not found for: " + ticket.Id);
                }
                catch (Exception e)
                {
                    logger.Error("Error getting ticket: " + ticket.Id + " - " + e.Message);
                }
            }
            return fullTickets;
        }