Ejemplo n.º 1
0
        public ActivityReport[] GetActRep(Login login, int minutes)
        {
            IWS.ServiceSoapClient IWSService = InitWS(login);

            IWS.ActivityReportSelection_V3 ActRepSel = new IWS.ActivityReportSelection_V3();

            IWS.DateTimeSelection      dtSel = new IWS.DateTimeSelection();
            IWS.DateTimeAndIdSelection idSel = new IWS.DateTimeAndIdSelection();

            idSel.DateTimeType = IWS.enumSelectionDateTimeAndIdType.MINUTES;
            idSel.Value        = minutes;

            dtSel.DateTimeType = IWS.enumSelectionDateTimeType.MINUTES;
            dtSel.Value        = minutes;

            ActRepSel.DateTimeSelection = idSel;

            IWS.GetActivityReportResult_V9 ActRepRes = IWSService.Get_ActivityReport_V9(iwsLogin(login), ActRepSel);

            int i = 0;

            ActivityReport[] actRepList = new ActivityReport[ActRepRes.ActivityReportItems.Count()];

            foreach (IWS.ActivityReportItem_V9 act in ActRepRes.ActivityReportItems)
            {
                i = MoveActToActRep(act, ref actRepList, i);
            }
            return(actRepList);
        }
Ejemplo n.º 2
0
        public Message[] GetMessagesInbox(Login login, string LastID, ref string NewLastID)
        {
            IWS.ServiceSoapClient IWSService = InitWS(login);

            IWS.TextMessageInboxSelection_V2 InboxSelection = new IWS.TextMessageInboxSelection_V2();

            IWS.DateTimeAndIdSelection Selection = new IWS.DateTimeAndIdSelection();
            if (LastID == "")
            {
                Selection.DateTimeType = IWS.enumSelectionDateTimeAndIdType.GET_MODIFIED_SINCE_LAST_REQUEST;
            }
            else
            {
                Selection.DateTimeType = IWS.enumSelectionDateTimeAndIdType.GET_MODIFIED_SINCE_LAST_ID;
                Selection.Value        = Convert.ToInt64(LastID);
            }
            InboxSelection.SelectionFromToday = Selection;

            IWS.GetTextMessagesInbox_V6 InboxTextMessageResult = IWSService.Get_TextMessages_Inbox_V6(iwsLogin(login), InboxSelection);

            if (InboxTextMessageResult.MaximumModificationID == null)
            {
                NewLastID = LastID;
            }
            else
            {
                NewLastID = InboxTextMessageResult.MaximumModificationID.Value.ToString();
            }

            int i = 0;

            Message[] messageList = new Message[InboxTextMessageResult.Inbox.Count()];

            foreach (IWS.TextMessageInbox_V6 message in InboxTextMessageResult.Inbox)
            {
                Message msg = new Message();

                if (message.Vehicle != null)
                {
                    msg.VehicleID = message.Vehicle.ID;
                }
                if (message.Driver != null)
                {
                    msg.DriverID = message.Driver.ID;
                }

                msg.Text          = message.Message;
                msg.ID            = message.TextMessageID;
                msg.CreationDate  = message.CreationDate;
                msg.DeliveredDate = message.DeliveredDate;
                messageList[i]    = msg;
                i += 1;
            }
            return(messageList);
        }
Ejemplo n.º 3
0
        public List <Document> GetDocs(Login login, ref DocParameters docParameters)
        {
            IWS.ServiceSoapClient IWSService = InitWS(login);

            IWS.ScannedDocumentsSelection_V2 docsSel = new IWS.ScannedDocumentsSelection_V2();

            IWS.DateTimeAndIdSelection Selection = new IWS.DateTimeAndIdSelection();
            if (docParameters.LastID == "")
            {
                Selection.DateTimeType = IWS.enumSelectionDateTimeAndIdType.GET_MODIFIED_SINCE_LAST_REQUEST;
            }
            else
            {
                Selection.DateTimeType = IWS.enumSelectionDateTimeAndIdType.GET_MODIFIED_SINCE_LAST_ID;
                Selection.Value        = Convert.ToInt64(docParameters.LastID);
            }
            docsSel.SelectionFromToday = Selection;

            List <Document> documents = new List <Document>();

            IWS.ScannedDocumentSelection docSel = new IWS.ScannedDocumentSelection();

            IWS.GetScannedDocuments_V3 getScannedDocumentsResult = IWSService.Get_Scanned_Documents_V3(iwsLogin(login), docsSel);

            if (getScannedDocumentsResult.MaximumModificationID == null)
            {
                docParameters.NewLastID = docParameters.LastID;
            }
            else
            {
                docParameters.NewLastID = getScannedDocumentsResult.MaximumModificationID.Value.ToString();
            }

            if (getScannedDocumentsResult.Documents != null)
            {
                foreach (IWS.DocumentsResult_V3 doc in getScannedDocumentsResult.Documents)
                {
                    docSel.ScanID       = Convert.ToInt32(doc.ScanID.Value);
                    docSel.ConvertToPdf = true;
                    Int64 ModificationCounter = doc.ModificationID;
                    IWS.GetScannedDocument getScannedDocumentResult = IWSService.Get_Scanned_Document(iwsLogin(login), docSel);
                    int i = 0;
                    foreach (IWS.DocumentResult document in getScannedDocumentResult.Documents)
                    {
                        i++;
                        string placeid = "";
                        string doctype = "";

                        if (doc.Place != null)
                        {
                            placeid = doc.Place.PlaceID.ToString();
                        }
                        if (doc.TypeDoc != null)
                        {
                            doctype = doc.TypeDoc.ToString();
                        }

                        MemoryStream stream = new MemoryStream(Convert.FromBase64String(document.Document1));

                        Document thisdoc = new Document();

                        thisdoc.ScanID     = doc.ScanID.ToString();
                        thisdoc.SequenceID = i.ToString();
                        thisdoc.VehicleID  = doc.Vehicle.ID.ToString();
                        if (doc.Driver != null)
                        {
                            thisdoc.DriverID = doc.Driver.ID.ToString();
                        }
                        thisdoc.PlaceID      = placeid;
                        thisdoc.Comment      = doc.Comment;
                        thisdoc.DocumentType = doctype;
                        thisdoc.Doc          = stream;
                        thisdoc.DocumentID   = ModificationCounter;
                        documents.Add(thisdoc);
                    }
                }
            }

            string strError = handleError(getScannedDocumentsResult);

            if (strError != null)
            {
                docParameters.ErrorMessage = strError;
            }
            return(documents);
        }