Beispiel #1
0
        public void PostUpdate(ComputeAndroidSDK.Communication.WorkOrderTrimmed wt, Boolean TaskIsComplete, int uncomplete, int totalWOs)
        {
            Java.Lang.Object[] lst = new Java.Lang.Object[1];
            lst[0]      = JsonConvert.SerializeObject(wt);
            _noComplete = totalWOs - uncomplete;
            _totalWOs   = totalWOs;
            PublishProgress(lst);

            _complete = TaskIsComplete;
        }
Beispiel #2
0
        public static void SubmitWorkOrderResult(WorkOrderTrimmed wo)
        {
            try {
                CommPackage cp = (from x in CommunicationPackages
                                  where wo.DeviceUIRef == x.DeviceUIRef
                                  select x).Single();

                CommunicationPackages.Remove(cp);
                WorkOrders.Add(wo);

                //TODO: Send result to the UI result handler..

            } catch {

            }
        }
        public void ReceiveWorkOrderResult(int workOrderId)
        {
            WorkOrderWS.WorkOrderTrimmed wo = new WorkOrderWS.WorkOrderSvc().GetWorkOrder(App.GetAuthToken(this), App.GetDeviceId(this), true, workOrderId, true);

            ComputeAndroidSDK.Communication.WorkOrderTrimmed testWo = new WorkOrderTrimmed();
            testWo.ApplicationId = wo.ApplicationIdk__BackingField;
            testWo.ApplicationUIResultIntent = wo.ApplicationUIResultIntentk__BackingField;
            testWo.CommPackageJson = wo.CommPackageJsonk__BackingField;
            testWo.ComputeAppIntent = wo.ComputeAppIntentk__BackingField;
            testWo.DeviceId = wo.DeviceIdk__BackingField;
            testWo.DeviceLocalRequestId = wo.DeviceLocalRequestIdk__BackingField;
            testWo.DeviceUIRef = wo.DeviceUIRefk__BackingField;
            testWo.ReceiveTime = wo.ReceiveTimek__BackingField;
            testWo.SlaveWorkerId = wo.SlaveWorkerIdk__BackingField;
            testWo.SlaveWorkerSubmit = wo.SlaveWorkerSubmitk__BackingField;
            testWo.SlaveWorkOrderLastCommunication = wo.SlaveWorkOrderLastCommunicationk__BackingField;
            testWo.WorkOrderId = wo.WorkOrderIdk__BackingField;
            testWo.WorkOrderResultJson = wo.WorkOrderResultJsonk__BackingField;
            testWo.WorkOrderStatus = wo.WorkOrderStatusk__BackingField;

            // Send to listener (intent attached to application)
            Intent newIntent = new Intent(wo.ApplicationUIResultIntentk__BackingField);

            string fileName = Android.OS.Environment.ExternalStorageDirectory +
            Java.IO.File.Separator + testWo.WorkOrderId + "-ResultRet.txt";
            StreamWriter fs = new StreamWriter(fileName, false);
            fs.Write(JsonConvert.SerializeObject(testWo));
            fs.Close();

            newIntent.PutExtra("FileLocation", fileName);

            //newIntent.PutExtra("WorkOrderTrimmed", JsonConvert.SerializeObject(testWo));

            this.ApplicationContext.SendBroadcast(newIntent);
        }