Exemple #1
0
        public List <Acres> GetAcresData(string claimantId)
        {
            int           count         = 1;
            List <string> sources       = new List <string>();
            List <string> acresFromGrid = new List <string>();
            List <Acres>  acres         = new List <Acres>();
            int           size          = elementUtils.CountTableRows(ReviewDetailsPLPage.AcresGridRow);

            for (int i = 1; i <= size; i++)
            {
                By xPathSource = ReviewDetailsPLPage.GetAcreSource(i);
                sources.Add(elementUtils.GetTextFromElement(xPathSource));
            }
            foreach (string source in sources)
            {
                if (source.Equals("Claim Form") || source.Equals("FSA") || source.Equals("RMA") || source.Equals("Lease"))
                {
                    By xPathRelevance = ReviewDetailsPLPage.GetAcreRelevance(count);
                    elementUtils.SetElementExistsWait(xPathRelevance);
                    if (elementUtils.GetTextFromElement(xPathRelevance).Equals("Claim Form"))
                    {
                        acresFromGrid = elementUtils.ReadTableRowData(acresFromGrid, ReviewDetailsPLPage.AcresGridCol, ReviewDetailsPLPage.GetTableXPathRowForAcresGrid(count), ReviewDetailsPLPage.AcresGridThirdPart);
                        acres.Add(new Acres()
                        {
                            Source = acresFromGrid[0], Relevance = acresFromGrid[1], FarmNumber = acresFromGrid[2], TractNumber = acresFromGrid[3], FieldNumber = acresFromGrid[4], MarketingYear = acresFromGrid[5], PlantingPrimCode = acresFromGrid[6], CornAcreage = acresFromGrid[7], SharePercentage = acresFromGrid[8], TotalSharePercentage = acresFromGrid[9], AdjSharePercentage = acresFromGrid[10], LinkedClaimantId = acresFromGrid[11]
                        });
                        acresFromGrid.Clear();
                    }
                    count++;
                }
            }
            acres.Sort(delegate(Acres x, Acres y)
            {
                if (x.MarketingYear == null && y.MarketingYear == null)
                {
                    return(0);
                }
                else if (x.MarketingYear == null)
                {
                    return(-1);
                }
                else if (y.MarketingYear == null)
                {
                    return(1);
                }
                else
                {
                    return(x.MarketingYear.CompareTo(y.MarketingYear));
                }
            });
            return(acres);
        }
Exemple #2
0
        public List <Acres> ReviewAcres()
        {
            string        sourceAD, relevanceAD, yearAD, farmNumberAD, tractNumberAD, fieldNumberAD, sharePercentageAD, stateAD, countyAD, siloAcreageAD, cornAcreageAD, failedAcreageAD;
            List <Acres>  acres = new List <Acres>();
            int           rowCount = 1, idCount = 0;
            List <string> sources = new List <string>();
            int           size    = elementUtils.CountTableRows(ReviewDetailsPLPage.AcresGridRow);

            for (int i = 1; i < size; i++)
            {
                By xPathSource = ReviewDetailsPLPage.GetAcreSource(i);
                sources.Add(elementUtils.GetTextFromElement(xPathSource));
            }
            foreach (string source in sources)
            {
                if (source.Equals("Claim Form") || source.Equals("FSA") || source.Equals("RMA") || source.Equals("Lease"))
                {
                    By xPathRelevance = ReviewDetailsPLPage.GetAcreRelevance(rowCount);
                    if (elementUtils.GetTextFromElement(xPathRelevance).Equals("Claim Form"))
                    {
                        //By xPathImg = ReviewDetailsPage.GetAcresReviewImage(count);
                        // if (elementUtils.GetAttributeTitle(xPathImg).Equals("Needs Review"))
                        elementUtils.ClickElement(ReviewDetailsPLPage.GetAcreAction(idCount));
                        sourceAD          = elementUtils.GetTextFromElement(ReviewDetailsPLPage.SourceAcreageDetail);
                        relevanceAD       = elementUtils.GetTextFromElement(ReviewDetailsPLPage.RelevanceAcreageDetail);
                        yearAD            = elementUtils.GetTextFromElement(ReviewDetailsPLPage.YearAcreageDetail);
                        farmNumberAD      = elementUtils.GetTextFromElement(ReviewDetailsPLPage.FarmNumberAcreageDetail);
                        tractNumberAD     = elementUtils.GetTextFromElement(ReviewDetailsPLPage.TractNumberAcreageDetail);
                        fieldNumberAD     = elementUtils.GetTextFromElement(ReviewDetailsPLPage.FieldNumberAcreageDetail);
                        sharePercentageAD = elementUtils.GetTextFromElement(ReviewDetailsPLPage.ShareAcreageDetail);
                        stateAD           = elementUtils.GetTextFromElement(ReviewDetailsPLPage.StateAcreageDetail);
                        countyAD          = elementUtils.GetTextFromElement(ReviewDetailsPLPage.CountyAcreageDetail);
                        siloAcreageAD     = elementUtils.GetTextFromElement(ReviewDetailsPLPage.SiloAcreageDetail);
                        cornAcreageAD     = elementUtils.GetTextFromElement(ReviewDetailsPLPage.CornAcreageDetail);
                        failedAcreageAD   = elementUtils.GetTextFromElement(ReviewDetailsPLPage.FailedAcreageDetail);
                        acres.Add(new Acres()
                        {
                            Source = sourceAD, Relevance = relevanceAD, MarketingYear = yearAD, FarmNumber = farmNumberAD, TractNumber = tractNumberAD, FieldNumber = fieldNumberAD, SharePercentage = sharePercentageAD, State = stateAD, County = countyAD, SiloAcreage = siloAcreageAD, CornAcreage = cornAcreageAD, FailedAcreage = failedAcreageAD
                        });
                        elementUtils.ClickElement(ReviewDetailsPLPage.CloseAcreageDetail);
                    }
                    rowCount++;
                    idCount++;
                }
            }
            return(acres);
        }