/// <summary> /// Reports the photo segment value changed. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> void ReportPhotoSegment_ValueChanged(object sender, EventArgs e) { var selectedSegmentId = (sender as UISegmentedControl).SelectedSegment; switch (reportPhotoSegment.SelectedSegment) { case 0: if (File.Exists(reportPath)) { WVReport.ScrollView.UserInteractionEnabled = true; WVReport.LoadRequest(new Foundation.NSUrlRequest(new Foundation.NSUrl(reportPath, false))); } break; case 1: if (File.Exists(TempPhotoLogReportPath)) { WVReport.ScrollView.UserInteractionEnabled = false; WVReport.LoadRequest(new Foundation.NSUrlRequest(new Foundation.NSUrl(TempPhotoLogReportPath, false))); } break; } }
/// <summary> /// Views the did load. /// </summary> public async override void ViewDidLoad() { //OptionTransaction obt = new OptionTransaction (); //ssssobt. base.ViewDidLoad(); lblSyncNumber.Layer.CornerRadius = lblSyncNumber.Frame.Height / 2; lblSyncNumber.ClipsToBounds = true; LblNotifyNbr.Layer.CornerRadius = LblNotifyNbr.Frame.Height / 2; LblNotifyNbr.ClipsToBounds = true; WVReport.Delegate = new ReportWebviewDelegate(this); // WVReport.UserInteractionEnabled = false; btnHome.TouchUpInside -= BtnHome_TouchUpInside; btnHome.TouchUpInside += BtnHome_TouchUpInside; btnEdit.TouchUpInside -= BtnEdit_TouchUpInside; btnEdit.TouchUpInside += BtnEdit_TouchUpInside; btnNotify.TouchUpInside += BtnNotify_TouchUpInside; //btnSync.TouchUpInside += btnSync_TouchUpInside; btnSync.Enabled = false; btnLogOut.TouchUpInside += BtnLogout_TouchUpInside; //reportPhotoSegment.SelectedSegment = 1; // nint selectedsegmentid=reportPhotoSegment.SelectedSegment; reportPhotoSegment.ValueChanged += ReportPhotoSegment_ValueChanged; syncInit(); //NotifyCount (); lblCalDate.Text = DateTime.Today.Date.ToString("MMM dd"); lblCalDay.Text = "Today"; btnFinalizeSave.TouchUpInside -= BtnFinalizeSave_TouchUpInside; btnFinalizeSave.TouchUpInside += BtnFinalizeSave_TouchUpInside; OptionTransactionService optionTransactionService = new OptionTransactionService(AppDelegate.DatabaseContext); if (InspectionResult != null) { this.InvokeOnMainThread(delegate { LoadOverLayPopup(); }); ///Modification needed int checkListResult = 0; var optData = optionTransactionService.GetOptionTransactions().Where(o => o.inspectionTransID == InspectionResult.ID); foreach (var opt in optData) { opt.checkListTransaction = CheckListTransactionDO.GetCheckListTransaction(AppDelegate.DatabaseContext, opt.ID); checkListResult = checkListResult + opt.checkListTransaction.Where(i => i.result == (int)ResultType.FAIL).Count(); } if (checkListResult > 0) { InspectionResult.pass = "******"; } else { InspectionResult.pass = "******"; } UpdateView(); reportPath = await GenerateReport(); await generatePhotoReport(InspectionResult); this.InvokeOnMainThread(delegate { HideOverLay(); }); } if (File.Exists(reportPath)) { WVReport.LoadRequest(new Foundation.NSUrlRequest(new Foundation.NSUrl(reportPath, false))); } // Perform any additional setup after loading the view, typically from a nib. }