public PrePlumbingCheckView(WorkflowNavigationController workflow) : base("PrePlumbingCheckView", null)
        {
            this.Title = NSBundle.MainBundle.LocalizedString("Pre-plumbing check", "Pre-plumbing check");
            using (var image = UIImage.FromBundle("Images/117-todo")) this.TabBarItem.Image = image;
            this._navWorkflow = workflow;

            this.ToolbarItems = new UIBarButtonItem[] { new UIBarButtonItem("Done", UIBarButtonItemStyle.Done, null) };
        }
Exemplo n.º 2
0
        public JobDeliveryViewController(RootElement root, WorkflowNavigationController nav, UsedPartsNavigationController upnav, bool pushing) : base(root, pushing)
        {
            NavUsedParts = upnav;
            NavWorkflow  = nav;
            DBParts      = new List <Part>();
            DBAssemblies = new List <Assembly> ();
            DeactivateEditingMode();

            Section             WarrantySection = new Section("");
            StyledStringElement warrantyElement = new StyledStringElement("", "Guaranteed delivery :-)");

            WarrantySection.Add(warrantyElement);
            Root.Add(WarrantySection);

            Section StandardPartsSection = new Section("");

            StandardPartsSection.Add(new StyledStringElement("Use standard parts", "", UITableViewCellStyle.Value1));
            Root.Add(StandardPartsSection);
//			Root.Add (new Section("") );

            PartsSection PartsUsedSection = new PartsSection("Parts used", this);

            PartsUsedSection.Add(new StyledStringElement("Tap here to add a part"));

            Root.Add(PartsUsedSection);

            using (var image = UIImage.FromBundle("Images/19-gear")) this.TabBarItem.Image = image;
            this.Title = "Uninstallation";

            ToolbarItems = new UIBarButtonItem[] {
                new UIBarButtonItem(UIBarButtonSystemItem.Reply),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem("Clear parts list", UIBarButtonItemStyle.Plain, delegate { ClearPartsList(); }),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem(UIBarButtonSystemItem.Action)
            };
            ToolbarItems[0].Clicked += delegate {
                if (NavUsedParts.Tabs._jobRunTable.CurrentJob.HasParent())                      // for child jobs, we jump to payment screen
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                }
                else                 // for main jobs we jump to pre-plumbing check
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[0];
                }
            };

            ToolbarItems[4].Clicked += delegate {
                NavUsedParts.Tabs.LastSelectedTab        = NavUsedParts.Tabs.SelectedIndex;
                NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];                 // jump to payment
            };
        }
Exemplo n.º 3
0
        public JobReinstallViewController(RootElement root, WorkflowNavigationController nav, UsedPartsNavigationController upnav, bool pushing) : base(root, pushing)
        {
            NavUsedParts = upnav;
            NavWorkflow  = nav;
            DBParts      = new List <Part>();
            DBAssemblies = new List <Assembly> ();
            dvcSO        = new SaleOptionsDVC(null, false, true, this.NavUsedParts.Tabs._jobRunTable, this);
            DeactivateEditingMode();

            Section      OptionsSection  = new Section("");
            EntryElement pressureElement = new EntryElement("Pressure", "Value", "", false);

            pressureElement.KeyboardType = UIKeyboardType.NumbersAndPunctuation;
            OptionsSection.Add(pressureElement);
            OptionsSection.EntryAlignment = new CGSize(565, 20);

            Root.Add(OptionsSection);

            Section InstallationTypeSection = new Section("Installation information");

            var img = UIImage.FromBundle("Images/181-hammer");

            InstallationTypeSection.Add(new BadgeElement(img, "Enter info", delegate {
                GoChooseProduct();
            }));
            img.Dispose();

            Root.Add(InstallationTypeSection);

            PartsSection UsedPartsSection = new PartsSection("Parts used", this);

            UsedPartsSection.Add(new StyledStringElement("Tap here to add a part"));
            Root.Add(UsedPartsSection);

            this.Title = "Re-installation";
            using (var image = UIImage.FromBundle("Images/181-hammer")) this.TabBarItem.Image = image;

            ToolbarItems = new UIBarButtonItem[] {
                new UIBarButtonItem(UIBarButtonSystemItem.Reply),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem("Clear parts list", UIBarButtonItemStyle.Bordered, delegate { ClearPartsList(); }),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem(UIBarButtonSystemItem.Action)
            };

            ToolbarItems[0].Clicked += delegate {
                if (NavUsedParts.Tabs._jobRunTable.CurrentJob.HasParent())                      // for child jobs, we jump to payment screen
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                }
                else                 // for main jobs we jump to pre-plumbing check
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[0];
                }
            };

            ToolbarItems[4].Clicked += delegate {
                // pressure has to be entered and correct, check if parts list is empty
                if (PressureValueOK())
                {
                    SavePressureValueToDatabase();

                    if (PartsListNotEmpty())
                    {
                        // all good, jump to payment
                        NavUsedParts.Tabs.LastSelectedTab        = NavUsedParts.Tabs.SelectedIndex;
                        NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                    }
                    else
                    {
                        // alert the user that parts list is empty
                        var partsEmpty = new UIAlertView("", "Parts list is empty, are you sure?", null, "No", "Yes");
                        partsEmpty.Dismissed += delegate(object sender, UIButtonEventArgs e) {
                            if (e.ButtonIndex != partsEmpty.CancelButtonIndex)
                            {
                                // jump to payment
                                NavUsedParts.Tabs.LastSelectedTab        = NavUsedParts.Tabs.SelectedIndex;
                                NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                            }
                        };
                        partsEmpty.Show();
                    }
                }
                else
                {
                    // alert the user that pressure value must be entered
                    var pressureNotEntered = new UIAlertView("", "Cannot parse pressure value. Please enter a number.", null, "OK");
                    pressureNotEntered.Show();
                    this.Root[0].Elements[0].Selected(this, this.TableView, NSIndexPath.FromRowSection(0, 0));
                }
            };
        }
Exemplo n.º 4
0
        public JobUnitUpgrade(RootElement root, WorkflowNavigationController nav, UsedPartsNavigationController upnav, bool pushing) : base(root, pushing)
        {
            NavUsedParts = upnav;
            NavWorkflow  = nav;
            DBParts      = new List <Part>();
            DBAssemblies = new List <Assembly> ();
            DeactivateEditingMode();

            Section        WarrantySection = new Section(" ");
            BooleanElement warrantyElement = new BooleanElement("Warranty", false);

            warrantyElement.ValueChanged += delegate {
                // this.NavWorkflow._tabs._jobRunTable.CurrentJob.Warranty = warrantyElement.Value;
                ThisJob.Warranty = warrantyElement.Value;
                if (this.NavWorkflow._tabs._jobRunTable.CurrentJob.Warranty)
                {
                    this.AddJobReport(true);
                }
            };
            WarrantySection.Add(warrantyElement);
            Root.Add(WarrantySection);

            Section UnitUpgradeTypeSection = new Section("");

            UnitUpgradeTypeSection.Add(new StyledStringElement("Use standard parts", "", UITableViewCellStyle.Value1));
            Root.Add(UnitUpgradeTypeSection);

            PartsSection AdditionalPartsSection = new PartsSection("Parts used", this);

            AdditionalPartsSection.Add(new StyledStringElement("Tap here to add a part"));

            Root.Add(AdditionalPartsSection);
            using (var image = UIImage.FromBundle("Images/19-gear")) this.TabBarItem.Image = image;
            this.Title = "Unit upgrade";

            ToolbarItems = new UIBarButtonItem[] {
                new UIBarButtonItem(UIBarButtonSystemItem.Reply),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem("Clear parts list", UIBarButtonItemStyle.Bordered, delegate { ClearPartsList(); }),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem(UIBarButtonSystemItem.Action)
            };
            ToolbarItems[0].Clicked += delegate {
                if (NavUsedParts.Tabs._jobRunTable.CurrentJob.HasParent())                      // for child jobs, we jump to payment screen
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                }
                else                 // for main jobs we jump to pre-plumbing check
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[0];
                }
            };

            ToolbarItems[4].Clicked += delegate {
                if (ThisJob.JobReportAttached)
                {
                    if (JobReportDataValid())                           // check that pressure and comment fields have been filled
                    {
                        foreach (Section section in Root)
                        {
                            if (section is JobReportSection)
                            {
                                (section as JobReportSection).jrd.Pressure = Convert.ToInt32((section.Elements[1] as EntryElement).Value);
                                (section as JobReportSection).jrd.Comment  = (section.Elements[4] as MultilineEntryElement).Value;

                                SaveJobReport((section as JobReportSection).jrd);

                                // save the service report
                                nav._tabs._jobService.PdfListOfIssues = (UIView)this.TableView;
                                nav._tabs._jobService.GenerateServicePDFPreview();
                                nav._tabs._jobService.RedrawServiceCallPDF(false);
                            }
                        }

                        NavUsedParts.Tabs.LastSelectedTab        = NavUsedParts.Tabs.SelectedIndex;
                        NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                    }
                }
                else
                {
                    NavUsedParts.Tabs.LastSelectedTab        = NavUsedParts.Tabs.SelectedIndex;
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                }

                /*
                 * // save the job report (if there is one)
                 * if (ThisJob.JobReportAttached)
                 *      foreach(Section section in Root)
                 *              if (section is JobReportSection)
                 *                      SaveJobReport ( (section as JobReportSection).jrd );
                 *
                 * NavUsedParts.Tabs.LastSelectedTab = NavUsedParts.Tabs.SelectedIndex;
                 * NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3]; // jump to payment
                 */
            };
        }
Exemplo n.º 5
0
        public JobInstallationViewController(RootElement root, WorkflowNavigationController nav, UsedPartsNavigationController upnav, bool pushing) : base(root, pushing)
        {
            NavUsedParts = upnav;
            NavWorkflow  = nav;
            DBParts      = new List <Part>();
            DBAssemblies = new List <Assembly> ();
            dvcSO        = new SaleOptionsDVC(null, false, true, this.NavUsedParts.Tabs._jobRunTable, this);
            DeactivateEditingMode();

            Section      OptionsSection  = new Section("");
            EntryElement pressureElement = new EntryElement("Pressure", "Value", "", false);

            pressureElement.KeyboardType = UIKeyboardType.NumbersAndPunctuation;
            OptionsSection.Add(pressureElement);
            OptionsSection.EntryAlignment = new CGSize(565, 20);

            /*
             * CheckboxElement drillElement = new CheckboxElement("Drilling", false);
             * drillElement.Tapped += delegate {
             *      Job currentJob = NavWorkflow._tabs._jobRunTable.CurrentJob;
             *      if (drillElement.Value == true)
             *      {
             *              // increase the job price by 40
             *              currentJob.MoneyToCollect += 40;
             *              Console.WriteLine (String.Format ("CurrentJob.TotalToCollect = {0}", currentJob.TotalToCollect ()));
             *              NavWorkflow._tabs._customersView.UpdateCustomerInfo (CustomerDetailsUpdatableField.JobPriceTotal,
             *                                                                   (currentJob.MoneyToCollect-40).ToString (), currentJob.MoneyToCollect.ToString (), currentJob.CustomerNumber, currentJob.JobBookingNumber);
             *
             *              // if current fee value is 0, set it to standard fee for the job type
             *              if (currentJob.EmployeeFee < 1 ||
             *                  currentJob.EmployeeFee > currentJob.Type.EmployeeFee)
             *              {
             *                      currentJob.EmployeeFee = currentJob.Type.EmployeeFee;
             *              }
             *              // increase the fee by 49.5
             *              currentJob.EmployeeFee += 49.5;
             *
             *              Console.WriteLine (String.Format ("Job fee: {0}, job type (standard fee): {1}", NavWorkflow._tabs._jobRunTable.CurrentJob.EmployeeFee, NavWorkflow._tabs._jobRunTable.CurrentJob.Type.EmployeeFee));
             *      }
             *      else
             *      {
             *              // decrease the fee if it's exceeding the standard fee for the job by 49.5
             *
             *              if (currentJob.EmployeeFee - currentJob.Type.EmployeeFee > 49)
             *                      currentJob.EmployeeFee -= 49.5;
             *
             *              Console.WriteLine (String.Format ("Job fee: {0}, job type (standard fee): {1}", currentJob.EmployeeFee, currentJob.Type.EmployeeFee));
             *      }
             * }; */
            // OptionsSection.Add (drillElement);

            Root.Add(OptionsSection);

            Section InstallationTypeSection = new Section("Installation information");

            var img = UIImage.FromBundle("Images/181-hammer");

            InstallationTypeSection.Add(new BadgeElement(img, "Enter info", delegate {
                GoChooseProduct();
            }));
            img.Dispose();

            Root.Add(InstallationTypeSection);

            PartsSection UsedPartsSection = new PartsSection("Parts used", this);

            UsedPartsSection.Add(new StyledStringElement("Tap here to add a part"));
            Root.Add(UsedPartsSection);

            this.Title = "Installation";
            using (var image = UIImage.FromBundle("Images/181-hammer")) this.TabBarItem.Image = image;

            ToolbarItems = new UIBarButtonItem[] {
                new UIBarButtonItem(UIBarButtonSystemItem.Reply),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem("Clear parts list", UIBarButtonItemStyle.Bordered, delegate { ClearPartsList(); }),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem(UIBarButtonSystemItem.Action)
            };

            ToolbarItems[0].Clicked += delegate {
                if (NavUsedParts.Tabs._jobRunTable.CurrentJob.HasParent())                      // for child jobs, we jump to payment screen
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];
                }
                else                 // for main jobs we jump to pre-plumbing check
                {
                    NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[0];
                }
            };

            ToolbarItems[4].Clicked += delegate {
                // various checks here: pressure has to be entered and correct, parts list must not be empty
                if (PressureValueOK())
                {
                    SavePressureValueToDatabase();

                    if (PartsListNotEmpty())
                    {
                        // all good, jump to payment
                        NavUsedParts.Tabs.LastSelectedTab        = NavUsedParts.Tabs.SelectedIndex;
                        NavUsedParts.Tabs.SelectedViewController = NavUsedParts.Tabs.ViewControllers[3];                         // jump to payment
                    }
                    else
                    {
                        // alert the user that install data must be entered
                        var enterInstallData = new UIAlertView("", "Parts list is empty, how come?", null, "OK");
                        enterInstallData.Show();
                    }
                }
                else
                {
                    // alert the user that pressure value must be entered
                    var pressureNotEntered = new UIAlertView("", "Cannot parse pressure value. Please enter a number.", null, "OK");
                    pressureNotEntered.Show();
                    this.Root[0].Elements[0].Selected(this, this.TableView, NSIndexPath.FromRowSection(0, 0));
                }
            };
        }
Exemplo n.º 6
0
 public JobSummary(WorkflowNavigationController nav, DetailedTabs tabs, RootElement root, bool pushing) : base(root, pushing)
 {
     Nav   = nav;
     _tabs = tabs;
 }