public EditOrderLinePage FillOrderLine_Sales(OrderLineModel OrderLineData)
        {
            Wait.UntilDisply(PositionDD);
            Select.ByText(ProductGroupDD, OrderLineData.ProductGroup);
            Wait.MLSeconds(200);
            Select.ByText(AddTypeDD, OrderLineData.AddType);
            Wait.MLSeconds(1000);
            if (OrderLineData.Position != null && OrderLineData.Position != 0)
            {
                Select.ByText(PositionDD, OrderLineData.Position.ToString());
                Wait.MLSeconds(200);
            }
            if (OrderLineData.SearchTerm != null && OrderLineData.SearchTerm != "")
            {
                SelectSearchTerms(OrderLineData.SearchTerm);
            }
            if (OrderLineData.EndDate != null)
            {
                EndDate.SendKeys(OrderLineData.EndDate.Value.ToString("M/d/yyyy"));
            }
            ProductInfoField.Click();
            Wait.MLSeconds(200);
            Select.ByText(DeliveryPrefDD, OrderLineData.DeliveryPreferences);
            Wait.MLSeconds(100);
            ProductInfoField.Clear();
            ProductInfoField.SendKeys(OrderLineData.ProductInformation);
            Wait.MLSeconds(100);
            if (OrderLineData.Impressions != null)
            {
                ImpressionsField.Clear();
                ImpressionsField.SendKeys(OrderLineData.Impressions.ToString());
                Wait.MLSeconds(100);
            }
            if (OrderLineData.Cost != null && OrderLineData.Cost != 0.0)
            {
                CostField.Clear();
                CostField.SendKeys(OrderLineData.Cost.ToString());
                Wait.MLSeconds(100);
            }
            else
            {
                Wait.MLSeconds(300);
                ProductInfoField.Click();
                Wait.MLSeconds(200);
            }
            //if (OrderLineData.RateEnable)
            //{
            //    RateCheckBox.Click();
            //    Wait.MLSeconds(200);
            //    RateField.Clear();
            //    RateField.SendKeys(OrderLineData.Rate.ToString());
            //}
            //if (OrderLineData.GeoTargetEnable)
            //{
            //    GeoTaggingEnable.Click();
            //    Wait.MLSeconds(200);
            //    GeoCountryParent.FindElement(By.LinkText("input")).SendKeys(OrderLineData.Countries);
            //    GeoTargetStatesParent.FindElement(By.TagName("input")).SendKeys(OrderLineData.States);
            //}
            //if (!OrderLineData.KeyWordsEnable)
            //{
            //    KeyWordCheckBox.Click();
            //    Wait.MLSeconds(100);
            //}
            //if (!OrderLineData.CatogoriesEnable)
            //{
            //    IsCatagoryTargetCheckBox.Click();
            //    Wait.MLSeconds(100);
            //}
            //if (!OrderLineData.SubsitutionsAllow)
            //{
            //    Element.GetByValueFromList(AllowSubstitutionsRadios, "0").Click();
            //}
            //if (!OrderLineData.DisplayMultipleAddsAllow)
            //{
            //    Element.GetByValueFromList(DisplayMultipleAdsRadios, "0").Click();
            //}
            //if (!OrderLineData.SearchLeadingTextAllow)
            //{
            //    Element.GetByValueFromList(AllowSearchLeadingTextRadios, "0").Click();
            //}
            //if (OrderLineData.Priority != null)
            //{
            //    Select.ByText(PerorityDD, OrderLineData.Priority.ToString());
            //}
            //if (OrderLineData.ImpressionsPerDay != null)
            //{
            //    ImpressionsField.SendKeys(OrderLineData.ImpressionsPerDay.ToString());
            //}
            //if (!string.IsNullOrEmpty(OrderLineData.AddGroupName))
            //{
            //    Select.ByText(groupNameDD, OrderLineData.AddGroupName);
            //}
            //if (OrderLineData.ProductSelectionManual == false && OrderLineData.ProductSelectionManual != null)
            //{
            //    Element.GetByValueFromList(AutoProductSelectionRadio, "1").Click();
            //}
            //else if (OrderLineData.ProductId_ManualSelection != null && OrderLineData.ProductId_ManualSelection.Count > 0)
            //{
            //    foreach (var item in OrderLineData.ProductId_ManualSelection)
            //    {
            //        AddProductToOrderLineByID(item);
            //    }
            //}

            //if (OrderLineData.Status != null)
            //{
            //    Element.ScrolTo(StatusDD);
            //    Select.ByText(StatusDD, OrderLineData.Status);
            //    Wait.MLSeconds(100);
            //}
            return(this);
        }
        public EditOrderLinePage  FillOrderLine_Admin(OrderLineModel OrderLineData)
        {
            Wait.UntilDisply(PositionDD);
            if (!string.IsNullOrEmpty(OrderLineData.AddGroupName))
            {
                Select.ByText(ProductGroupDD, "ESP Mobile");
                Wait.MLSeconds(200);
                Select.ByText(AddTypeDD, "PFP");
                Wait.MLSeconds(1000);
            }
            Select.ByText(ProductGroupDD, OrderLineData.ProductGroup);
            Wait.MLSeconds(200);
            Select.ByText(AddTypeDD, OrderLineData.AddType);
            Wait.MLSeconds(1000);

            if (OrderLineData.Position != null && OrderLineData.Position != 0)
            {
                Select.ByText(PositionDD, OrderLineData.Position.ToString());
                Wait.MLSeconds(200);
            }
            if (OrderLineData.SearchTerm != null && OrderLineData.SearchTerm != "")
            {
                SelectSearchTerms(OrderLineData.SearchTerm);
            }
            if (OrderLineData.EndDate != null)
            {
                EndDate.SendKeys(OrderLineData.EndDate.Value.ToString("M/d/yyyy"));
            }
            ProductInfoField.Click();
            Wait.MLSeconds(200);
            Select.ByText(DeliveryPrefDD, OrderLineData.DeliveryPreferences);
            Wait.MLSeconds(100);
            ProductInfoField.Clear();
            ProductInfoField.SendKeys(OrderLineData.ProductInformation);
            Wait.MLSeconds(100);
            if (OrderLineData.Impressions != null)
            {
                ImpressionsField.Clear();
                ImpressionsField.SendKeys(OrderLineData.Impressions.ToString());
                Wait.MLSeconds(100);
            }
            if (OrderLineData.Cost != null && OrderLineData.Cost != 0.0)
            {
                CostField.Clear();
                CostField.SendKeys(OrderLineData.Cost.ToString());
                Wait.MLSeconds(100);
            }
            else
            {
                Wait.MLSeconds(500);
                try
                {
                    ProductInfoField.Click();
                }
                catch (Exception)
                {
                }
                Wait.MLSeconds(200);
            }
            if (OrderLineData.RateEnable)
            {
                RateCheckBox.Click();
                Wait.MLSeconds(200);
                RateField.Clear();
                RateField.SendKeys(OrderLineData.Rate.ToString());
            }
            if (OrderLineData.GeoTargetEnable)
            {
                GeoTaggingEnable.Click();
                Wait.MLSeconds(200);
                GeoCountryParent.FindElement(By.LinkText("input")).SendKeys(OrderLineData.Countries);
                GeoTargetStatesParent.FindElement(By.TagName("input")).SendKeys(OrderLineData.States);
            }
            if (!OrderLineData.KeyWordsEnable)
            {
                KeyWordCheckBox.Click();
                Wait.MLSeconds(100);
            }
            if (!OrderLineData.CatogoriesEnable)
            {
                IsCatagoryTargetCheckBox.Click();
                Wait.MLSeconds(100);
            }
            if (!OrderLineData.SubsitutionsAllow)
            {
                Element.GetByValueFromList(AllowSubstitutionsRadios, "0").Click();
            }
            if (!OrderLineData.DisplayMultipleAddsAllow)
            {
                Element.GetByValueFromList(DisplayMultipleAdsRadios, "0").Click();
            }
            if (!OrderLineData.SearchLeadingTextAllow)
            {
                Element.GetByValueFromList(AllowSearchLeadingTextRadios, "0").Click();
            }
            if (OrderLineData.Priority != null)
            {
                Select.ByText(PerorityDD, OrderLineData.Priority.ToString());
            }
            if (OrderLineData.ImpressionsPerDay != null)
            {
                ImpressionsField.SendKeys(OrderLineData.ImpressionsPerDay.ToString());
            }
            if (!string.IsNullOrEmpty(OrderLineData.AddGroupName))
            {
                try
                {
                    Select.ByText(groupNameDD, OrderLineData.AddGroupName);
                }
                catch (Exception ex)
                {
                    Logger.Log(LogingType.TextCaseFail, ex.ToString());
                    this.CloseBtn.Click();
                    Wait.MLSeconds(500);
                    Modal.DirtyclickYes();
                    Wait.MLSeconds(100);
                    throw new Exception(ex.Message);
                }
            }
            if (OrderLineData.ProductSelectionManual == false && OrderLineData.ProductSelectionManual != null)
            {
                Element.ScrolTo(StatusDD);
                Element.GetByValueFromList(AutoProductSelectionRadio, "1").Click();
                Wait.AM_Loaging_ShowAndHide();
            }
            else if (OrderLineData.ProductId_ManualSelection != null && OrderLineData.ProductId_ManualSelection.Count > 0)
            {
                foreach (var item in OrderLineData.ProductId_ManualSelection)
                {
                    AddProductToOrderLineByID(item);
                }
            }

            if (OrderLineData.Status != null)
            {
                Element.ScrolTo(StatusDD);
                Select.ByText(StatusDD, OrderLineData.Status);
                Wait.MLSeconds(100);
            }
            return(this);
        }