public FeeTargetProgressController(FeeTargetProgressReport report)
     : base(UITableViewStyle.Grouped, null)
 {
     Autorotate = false;
     this.report = report;
     buildFeeTargetReport ();
 }
 public FeeTargetBranchOwnerController(FeeTargetProgressReport report)
     : base(UITableViewStyle.Grouped, null)
 {
     Autorotate = true;
     this.report = report;
     buildReport ();
 }
        public void SetReportPages(FinancialStatusReport fsReport, FeeTargetProgressReport ftReport, MatterAnalysisByOwnerReport maReport)
        {
            this.fsReport = fsReport;
            this.ftReport = ftReport;
            this.maReport = maReport;

            controllers.Clear ();

            if (fsReport != null)
                foreach (var branch in fsReport.branches) {
                    controllers.Add (new FinancialStatusByBranchController (branch));
                }
            if (ftReport != null) {
                controllers.Add (new FeeTargetProgressController (ftReport));
                controllers.Add (new FeeTargetProgressBranchController (ftReport));
                controllers.Add (new FeeTargetBranchOwnerController (ftReport));
            }
            if (maReport != null) {
                controllers.Add (new MatterAnalysisController (maReport));
                controllers.Add (new MatterAnalysisBranchController (maReport));
                controllers.Add (new MatterAnalysisBranchOwnerController (maReport));
            }
            dataSource = new ViewDataSource (controllers);
            pageViewController.DataSource = dataSource;
            //ViewDataSource has an indexer that returns it's controllers
            pageViewController.SetViewControllers (new[] { controllers [0] }, UIPageViewControllerNavigationDirection.Forward, false, null);
            pageViewController.View.Frame = this.View.Bounds;
            View.AddSubview (pageViewController.View);
        }
 public FeeTargetProgressBranchController(FeeTargetProgressReport report)
     : base(UITableViewStyle.Grouped, null)
 {
     this.report = report;
     contentWidth = View.Frame.Width + 20;
     contentHeight = View.Frame.Height;
     buildReport ();
 }
 public FeeTargetBranchOwnerController(FeeTargetProgressReport report)
     : base(UITableViewStyle.Grouped, null)
 {
     Autorotate = false;
     this.report = report;
     contentWidth = View.Frame.Width + 5;
     buildReport ();
 }
        public PageConductor2(FinancialStatusReport financeReport, MatterAnalysisByOwnerReport matterAnalysisReport, 
		                       FeeTargetProgressReport feeTargetReport, int reportType)
        {
            this.reportType = reportType;
            this.financeReport = financeReport;
            this.feeTargetReport = feeTargetReport;
            this.matterAnalysisReport = matterAnalysisReport;
        }
        void DataDownloaded(IAsyncResult result)
        {
            UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
            isBusy = false;
            end = DateTime.Now;
            var request = result.AsyncState as HttpWebRequest;
            WebServiceResponseDTO dto;
            try {
                HttpWebResponse response = (HttpWebResponse)request.EndGetResponse (result);
                Stream receiveStream = response.GetResponseStream ();
                StreamReader readStream = new StreamReader (receiveStream, Encoding.UTF8);
                string resp = readStream.ReadToEnd ();
                Console.WriteLine ("## GetReport Response stream received.\n" + resp);
                response.Close ();
                readStream.Close ();
                dto = (WebServiceResponseDTO)JsonConvert.DeserializeObject (
                    resp,
                    typeof(WebServiceResponseDTO)
                );
                if (dto != null) {
                    Tools.SendElapsedTime (start, end, dto.activityID);
                }
                InvokeOnMainThread (delegate {
                    if (dto.responseCode > 0) {
                        new UIAlertView ("Report Request", dto.responseMessage, null, "OK").Show ();
                        return;
                    }

                    switch (reportType) {
                    case FINANCIAL_STATUS:
                        financeReport = dto.financialStatusReport;
                        financeTime = DateTime.Now;
                        break;
                    case FEE_TARGET:
                        feeTargetReport = dto.feeTargetProgressReport;
                        feeTargetTime = DateTime.Now;
                        break;
                    case MATTER_ANALYSIS:
                        matterAnalysisReport = dto.matterAnalysisByOwnerReport;
                        matterAnalysisTime = DateTime.Now;
                        break;

                    }
                    int xpage = 0;
                    switch (reportType) {
                    case FINANCIAL_STATUS:
                        xpage = 0;
                        break;
                    case FEE_TARGET:
                        xpage = 2;
                        break;
                    case MATTER_ANALYSIS:
                        switch (xpage) {
                        case 0:
                            xpage = 2;
                            break;
                        case 1:
                            xpage = 2;
                            break;
                        case 2:
                            xpage = 5;
                            break;
                        case 3:
                            xpage = 5;
                            break;
                        case 4:
                            xpage = 5;
                            break;
                        case 5:
                            xpage = 5;
                            break;
                        case 6:
                            xpage = 5;
                            break;
                        case 7:
                            xpage = 5;
                            break;
                        }

                        break;
                    }

                    PagesConductor cont = new PagesConductor (
                                              financeReport,
                                              matterAnalysisReport,
                                              feeTargetReport,
                                              reportType, xpage
                                          );
                    this.NavigationController.PushViewController (cont, true);

                    isBusy = false;
                }
                );

            } catch (Exception ex) {
                Console.WriteLine ("shit " + ex.ToString ());
                isBusy = false;
                InvokeOnMainThread (delegate {
                    isBusy = false;
                    new UIAlertView ("Network Error", "Problem communicating with server, \n\nCheck your network connections and try again later", null, "Close"
                    ).Show ();

                }
                );
            }
        }
 public void setFeeTargetReportData(FeeTargetProgressReport feeTargetReport)
 {
     this.feeTargetReport = feeTargetReport;
     createReports ();
 }
 public FeeTargetProgressBranchController(FeeTargetProgressReport report)
     : base(UITableViewStyle.Grouped, null)
 {
     this.report = report;
     buildReport ();
 }