Ejemplo n.º 1
0
        public List <DocumentInfo> CollectTicketDocuments(int ticketId)
        {
            ServiceTicketApi api = new ServiceTicketApi(site, company, username, password, cookie);

            List <DocumentInfo> results = api.GetTicketDocuments(ticketId);

            if (results == null)
            {
                results = new List <DocumentInfo>();
            }
            logger.Info("Found " + results.Count + " Ticket documents");
            return(results);
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
        public ActionResult AddNewServiceTicket(ServiceTicketModel model)
        {
            List <TicketNote> note = new List <TicketNote>();

            if (model.Notes.Trim() != "" && model.Notes != null)
            {
                TicketNote noteModel = new TicketNote();
                noteModel.ContactId   = Convert.ToInt32(model.ContactId);
                noteModel.DateCreated = System.DateTime.Now;
                noteModel.NoteText    = model.Notes;
                noteModel.Id          = 0;

                note.Add(noteModel);
            }
            HomeController ctlObj    = new HomeController();
            int            ContactID = ctlObj.GetContactsId(model.contactno);

            var companydetail = ctlObj.GetCompanyDetailsViaId((int)model.CompanyId);

            ServiceTicket serviceTicket = new ServiceTicket();

            serviceTicket.CompanyId = model.CompanyId;
            //  serviceTicket.CompanyIdentifier = companydetail.CompanyIdentifier;
            serviceTicket.Summary           = model.tktSummary;
            serviceTicket.DetailDescription = model.probDesc;
            serviceTicket.StatusName        = "";
            serviceTicket.ServiceType       = "";
            serviceTicket.ServiceSubType    = "";
            serviceTicket.Priority          = model.PriorityTxt;
            serviceTicket.ContactId         = ContactID;
            // serviceTicket.Id = 0;
            //serviceTicket.boar
            serviceTicket.DetailNotes = note;
            _serviceTicketApi         = new ServiceTicketApi("https://control.mysupport247.net", "Mysupport247", "SwitchvoxAPI", "mH5219b2vri0KUa", "NovaramCred1");
            var result = _serviceTicketApi.AddOrUpdateServiceTicketViaCompanyIdentifier(companydetail.CompanyIdentifier, serviceTicket);



            return(RedirectToAction("Index", "Home", new { callerID = model.contactno }));
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public ServiceTicket getTicket(int ticketId)
        {
            ServiceTicketApi serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);

            return(serviceTicketApi.GetServiceTicket(ticketId));
        }
Ejemplo n.º 6
0
 public ServiceTicket getTicket(int ticketId)
 {
     ServiceTicketApi serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);
     return serviceTicketApi.GetServiceTicket(ticketId);
 }
Ejemplo n.º 7
0
        public List<TicketProduct> CollectTicketProductList(int ticketId)
        {
            ServiceTicketApi api = new ServiceTicketApi(site, company, username, password, cookie);

            List<TicketProduct> results = api.GetTicketProductList(ticketId);
            if (results == null)
                results = new List<TicketProduct>();
            logger.Info("Found " + results.Count + " Ticket Products");
            return results;
        }
Ejemplo n.º 8
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;
        }