示例#1
0
        public MainPage()
        {
            InitializeComponent();

            menuList = new List <MasterPageItem>();

            var page1Instance = new PageOne();
            var page2Instance = new PageTwo();
            var page1         = new MasterPageItem()
            {
                Title = "Item 1", Icon = "itemIcon1.png", TargetType = page1Instance, ViewModel = new OneVIewModel(page1Instance)
            };
            var page2 = new MasterPageItem()
            {
                Title = "Item 2", Icon = "itemIcon2.png", TargetType = page2Instance, ViewModel = new TwoViewModel(page2Instance)
            };


            menuList.Add(page1);
            menuList.Add(page2);


            navigationDrawerList.ItemsSource = menuList;

            Detail = new NavigationPage((Page)page1.TargetType);
            Detail.BindingContext = page1.ViewModel;
        }
示例#2
0
        public async Task <ActionResult> Edit(
            [Bind(
                 Include =
                     "Id,ClientOneTitle,ClientOneForename,ClientOneSurnames,ClientOneAddressLineOne,ClientOneAddressLineTwo,ClientOneAddressLineThree,ClientOneCounty,ClientOnePostCode,ClientOneEmailAddress,ClientOneHomeTelephone,ClientOneMobileTelephone,ClientOneDateOfBirth,ClientOneSex,ClientOneMartialStatus,ClientOneGoodHealth,ClientOneSmoked,ClientOneNationalInsuranceNumber,ClientOneNationality,ClientOneCountryOfBirth,ClientOneCountryOfResidence,ClientOneDomicile,ClientOneTaxationResidency,Notes,ClientTwoTitle,ClientTwoForename,ClientTwoSurnames,ClientTwoAddressLineOne,ClientTwoAddressLineTwo,ClientTwoAddressLineThree,ClientTwoCounty,ClientTwoPostCode,ClientTwoEmailAddress,ClientTwoHomeTelephone,ClientTwoMobileTelephone,ClientTwoDateOfBirth,ClientTwoSex,ClientTwoMartialStatus,ClientTwoGoodHealth,ClientTwoSmoked,ClientTwoNationalInsuranceNumber,ClientTwoNationality,ClientTwoCountryOfBirth,ClientTwoCountryOfResidence,ClientTwoDomicile,ClientTwoTaxationResidency,ClientTwoExtraInformation,CreatedDateTime"
                 )] PageOne pageOne)
        {
            if (!ModelState.IsValid)
            {
                return(View(pageOne));
            }
            _db.Entry(pageOne).State = EntityState.Modified;
            await _db.SaveChangesAsync();

            var factFindRepositorty = new FactFindRepositorty(_db);
            var factFind            = await factFindRepositorty.Get(pageOne.Id);

            factFind.ClientOneName    = string.Format("{0} {1}", pageOne.ClientOneForename, pageOne.ClientOneSurnames);
            factFind.ClientTwoName    = string.Format("{0} {1}", pageOne.ClientTwoForename, pageOne.ClientTwoSurnames);
            _db.Entry(factFind).State = EntityState.Modified;
            await _db.SaveChangesAsync();

            return(RedirectToAction("Edit", "PageTwo"));
        }
示例#3
0
        /// <summary>
        /// Populates UI with page and its sections from db
        /// </summary>
        /// <param name="eformName"></param>
        private void BuildPageFromEForm(string eformName)
        {
            IEnumerable <XElement> metadataList = EformMetadata.GetMetadata(eformName, BuildPage, BuildSection, BuildSectionStatic);
            Action <BOL.BusinessObject, string, IDictionary <string, string> > addControl = AddControl;
            Action <Func <IEnumerable <IBusinessObject> >, Action <IBusinessObject>, IEnumerable <string>, XElement> addGrid =
                (f, a, c, x) => AddGrid(f, a, x);
            Action <string> doTransition = null;

            // add controls via bizo convert
            int?patientId;

            if (!string.IsNullOrEmpty(EPID))
            {
                string dpid = Security.CustomCryptoHelper.Decrypt(EPID);
                if (!string.IsNullOrEmpty(dpid))
                {
                    patientId = int.Parse(dpid);
                }
            }
            var bizos = BOL.BusinessObject.Convert(metadataList, addControl, addGrid, doTransition, null, null);

            _eform.Pages[0].Sections = pageSections.ToArray();
            PageOne.BuildPage(_eform.Pages[0]);
        }
示例#4
0
 /// <summary>
 /// Builds a blank page with a single section
 /// </summary>
 private void BuildBlankPage()
 {
     // build page
     PageOne.BuildPage(_eform.Pages.First());
 }
示例#5
0
        }     //  end LoadFieldLengths

        public StringBuilder buildPrintLine(int[] fieldLengths, PageOne oneLine)
        {
            StringBuilder printLine = new StringBuilder();

            for (int j = 0; j < fieldLengths.Count(); j++)
            {
                switch (j)
                {
                case 0:
                    printLine.Append(oneLine.value1.ToString().PadLeft(fieldLengths[j], ' '));
                    break;

                case 1:         //  since this is the first column it only needs to be padded by six spaces
                    if (oneLine.value2 != null)
                    {
                        printLine.Append(oneLine.value2.PadLeft(fieldLengths[j], ' '));
                    }
                    else
                    {
                        printLine.Append("      ");
                    }
                    break;

                case 2:
                    if (oneLine.value3 != null)
                    {
                        printLine.Append(oneLine.value3.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 3:
                    if (oneLine.value4 != null)
                    {
                        printLine.Append(oneLine.value4.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 4:
                    if (oneLine.value5 != null)
                    {
                        printLine.Append(oneLine.value5.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 5:
                    if (oneLine.value6 != null)
                    {
                        printLine.Append(oneLine.value6.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 6:
                    if (oneLine.value7 != null)
                    {
                        printLine.Append(oneLine.value7.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 7:
                    if (oneLine.value8 != null)
                    {
                        printLine.Append(oneLine.value8.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 8:
                    if (oneLine.value9 != null)
                    {
                        printLine.Append(oneLine.value9.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 9:
                    if (oneLine.value10 != null)
                    {
                        printLine.Append(oneLine.value10.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 10:
                    if (oneLine.value11 != null)
                    {
                        printLine.Append(oneLine.value11.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 11:
                    if (oneLine.value12 != null)
                    {
                        printLine.Append(oneLine.value12.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 12:
                    if (oneLine.value13 != null)
                    {
                        printLine.Append(oneLine.value13.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 13:
                    if (oneLine.value14 != null)
                    {
                        printLine.Append(oneLine.value14.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 14:
                    if (oneLine.value15 != null)
                    {
                        printLine.Append(oneLine.value15.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 15:
                    if (oneLine.value16 != null)
                    {
                        printLine.Append(oneLine.value16.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 16:
                    if (oneLine.value17 != null)
                    {
                        printLine.Append(oneLine.value17.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 17:
                    if (oneLine.value18 != null)
                    {
                        printLine.Append(oneLine.value18.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 18:
                    if (oneLine.value19 != null)
                    {
                        printLine.Append(oneLine.value19.PadLeft(fieldLengths[j], ' '));
                    }
                    break;

                case 19:
                    if (oneLine.value20 != null)
                    {
                        printLine.Append(oneLine.value20.PadLeft(fieldLengths[j], ' '));
                    }
                    break;
                } //  end switch
            }     //  end for j loop
            return(printLine);
        }         //  end buildPrintLine
示例#6
0
        }   // end writePageOne

        private List <PageOne> LoadPageOne(List <RegressionDO> justPrimary, List <RegressionDO> justSecondary)
        {
            //  overloaded for topwood
            //  need to loop through DBH class to get the predicted volume or dashes on the line
            List <PageOne> LoadedTable = new List <PageOne>();

            //  load DBHclass first
            for (int k = 0; k < DBHclass.Count; k++)
            {
                PageOne po = new PageOne();
                po.value1 = Convert.ToDouble(DBHclass[k].ToString());
                LoadedTable.Add(po);
            }   //  end for k loop

            double calcTW    = 0;
            double calcMS    = 0;
            double calcValue = 0;

            foreach (PageOne pot in LoadedTable)
            {
                PageOne po = new PageOne();
                for (int jg = 0; jg < justSecondary.Count; jg++)
                {
                    if ((int)Math.Floor(justSecondary[jg].rMinDbh) <= (int)pot.value1 && (float)Math.Ceiling(justSecondary[jg].rMaxDbh) >= pot.value1)
                    {
                        // find current class in primary list
                        int nthRow = justPrimary.FindIndex(
                            delegate(RegressionDO jp)
                        {
                            return(jp.rSpeices == justSecondary[jg].rSpeices && jp.rProduct == justSecondary[jg].rProduct &&
                                   jp.rLiveDead == justSecondary[jg].rLiveDead && (int)Math.Floor(jp.rMinDbh) <= (int)pot.value1 &&
                                   (float)Math.Ceiling(jp.rMaxDbh) >= pot.value1);
                        });
                        if (nthRow >= 0)
                        {
                            calcMS = CalculatePredictedVolume(pot.value1, justPrimary[nthRow].CoefficientA, justPrimary[nthRow].CoefficientB,
                                                              justPrimary[nthRow].CoefficientC, justPrimary[nthRow].RegressModel);
                            calcTW = CalculatePredictedVolume(pot.value1, justSecondary[jg].CoefficientA, justSecondary[jg].CoefficientB,
                                                              justSecondary[jg].CoefficientC, justSecondary[jg].RegressModel);
                            calcValue = calcTW - calcMS;
                        }
                        else
                        {
                            calcValue = 0.0;
                        }
                        //  convert to string
                        switch (jg)
                        {
                        case 0:
                            pot.value2 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 1:
                            pot.value3 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 2:
                            pot.value4 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 3:
                            pot.value5 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 4:
                            pot.value6 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 5:
                            pot.value7 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 6:
                            pot.value8 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 7:
                            pot.value9 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 8:
                            pot.value10 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 9:
                            pot.value11 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 10:
                            pot.value12 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 11:
                            pot.value13 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 12:
                            pot.value14 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 13:
                            pot.value15 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 14:
                            pot.value16 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 15:
                            pot.value17 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 16:
                            pot.value18 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 17:
                            pot.value19 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;

                        case 18:
                            pot.value20 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                            break;
                        }   // end switch
                    }
                    else
                    {
                        switch (jg)
                        {
                        case 0:
                            pot.value2 = dashes;
                            break;

                        case 1:
                            pot.value3 = dashes;
                            break;

                        case 2:
                            pot.value4 = dashes;
                            break;

                        case 3:
                            pot.value5 = dashes;
                            break;

                        case 4:
                            pot.value6 = dashes;
                            break;

                        case 5:
                            pot.value7 = dashes;
                            break;

                        case 6:
                            pot.value8 = dashes;
                            break;

                        case 7:
                            pot.value9 = dashes;
                            break;

                        case 8:
                            pot.value10 = dashes;
                            break;

                        case 9:
                            pot.value11 = dashes;
                            break;

                        case 10:
                            pot.value12 = dashes;
                            break;

                        case 11:
                            pot.value13 = dashes;
                            break;

                        case 12:
                            pot.value14 = dashes;
                            break;

                        case 13:
                            pot.value15 = dashes;
                            break;

                        case 14:
                            pot.value16 = dashes;
                            break;

                        case 15:
                            pot.value17 = dashes;
                            break;

                        case 16:
                            pot.value18 = dashes;
                            break;

                        case 17:
                            pot.value19 = dashes;
                            break;

                        case 18:
                            pot.value20 = dashes;
                            break;
                        } // end switch
                    }     //  endif
                }         //  end foreach loop
            }             //  end for k loop

            return(LoadedTable);
        }   //  end LoadPageOne
示例#7
0
        }         // end writePageOne

        private List <PageOne> LoadPageOne(List <RegressionDO> justGroups, int firstGOP, int lastGOP)
        {
            //  need to loop through DBH class to get the predicted volume or dashes on the line
            List <PageOne> LoadedTable = new List <PageOne>();

            LoadedTable.Clear();
            //  load DBHclass first
            for (int k = 0; k < DBHclass.Count; k++)
            {
                PageOne po = new PageOne();
                po.value1 = Convert.ToDouble(DBHclass[k].ToString());
                LoadedTable.Add(po);
            }   //  end for k loop
            double calcValue = 0;

            foreach (PageOne pot in LoadedTable)
            {
                PageOne po = new PageOne();
                for (int jg = firstGOP; jg <= lastGOP; jg++)
                {
                    int   minTest = (int)Math.Floor(justGroups[jg].rMinDbh);
                    float maxTest = (float)Math.Ceiling(justGroups[jg].rMaxDbh);
                    if ((int)Math.Floor(justGroups[jg].rMinDbh) <= (int)pot.value1 && (float)Math.Ceiling(justGroups[jg].rMaxDbh) >= pot.value1)
                    {
                        calcValue = CalculatePredictedVolume(pot.value1, justGroups[jg].CoefficientA, justGroups[jg].CoefficientB, justGroups[jg].CoefficientC, justGroups[jg].RegressModel);
                        if (calcValue > 0)
                        {
                            //  convert to string
                            switch (jg)
                            {
                            case 0:
                                pot.value2 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 1:
                                pot.value3 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 2:
                                pot.value4 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 3:
                                pot.value5 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 4:
                                pot.value6 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 5:
                                pot.value7 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 6:
                                pot.value8 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 7:
                                pot.value9 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 8:
                                pot.value10 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 9:
                                pot.value11 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 10:
                                pot.value12 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 11:
                                pot.value13 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 12:
                                pot.value14 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 13:
                                pot.value15 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 14:
                                pot.value16 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 15:
                                pot.value17 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 16:
                                pot.value18 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 17:
                                pot.value19 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;

                            case 18:
                                pot.value20 = String.Format("{0,6:F2}", calcValue).PadLeft(6, ' ');
                                break;
                            } // end switch
                        }     //  endif calcValue greater than zero
                    }
                    else
                    {
                        switch (jg)
                        {
                        case 0:
                            pot.value2 = dashes;
                            break;

                        case 1:
                            pot.value3 = dashes;
                            break;

                        case 2:
                            pot.value4 = dashes;
                            break;

                        case 3:
                            pot.value5 = dashes;
                            break;

                        case 4:
                            pot.value6 = dashes;
                            break;

                        case 5:
                            pot.value7 = dashes;
                            break;

                        case 6:
                            pot.value8 = dashes;
                            break;

                        case 7:
                            pot.value9 = dashes;
                            break;

                        case 8:
                            pot.value10 = dashes;
                            break;

                        case 9:
                            pot.value11 = dashes;
                            break;

                        case 10:
                            pot.value12 = dashes;
                            break;

                        case 11:
                            pot.value13 = dashes;
                            break;

                        case 12:
                            pot.value14 = dashes;
                            break;

                        case 13:
                            pot.value15 = dashes;
                            break;

                        case 14:
                            pot.value16 = dashes;
                            break;

                        case 15:
                            pot.value17 = dashes;
                            break;

                        case 16:
                            pot.value18 = dashes;
                            break;

                        case 17:
                            pot.value19 = dashes;
                            break;

                        case 18:
                            pot.value20 = dashes;
                            break;
                        } // end switch
                    }     //  endif
                }         //  end foreach loop
            }             //  end for k loop

            return(LoadedTable);
        }   //  end LoadPageOne
 private void ButtonNextOne_Click(object sender, EventArgs e)
 {
     PageTwo.Show();
     PageOne.Hide();
 }
 private void BackOne_Click(object sender, EventArgs e)
 {
     PageTwo.Hide();
     PageOne.Show();
 }