protected void ddlYear_SelectedIndexChanged(object sender, EventArgs e) { ddlMake.Items.Clear(); ddlModel.Items.Clear(); ddlTrim.Items.Clear(); string json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?cmd=getMakes&year=" + Util.SSC(ddlYear.SelectedValue) + "&sold_in_us=1"); Makes makes = Newtonsoft.Json.JsonConvert.DeserializeObject <Makes>(json); foreach (Make make in makes.makes) { ddlMake.Items.Add(new ListItem(make.make_display, make.make_id)); } json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?cmd=getModels&make=" + Util.SSC(ddlMake.SelectedValue) + "&year=" + Util.SSC(ddlYear.SelectedValue) + "&sold_in_us=1"); Models models = Newtonsoft.Json.JsonConvert.DeserializeObject <Models>(json); foreach (Model model in models.models) { ddlModel.Items.Add(new ListItem(model.model_name, model.model_name)); } json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?cmd=getTrims&make=" + Util.SSC(ddlMake.SelectedValue) + "&year=" + Util.SSC(ddlYear.SelectedValue) + "&model=" + Util.SSC(ddlModel.SelectedValue)); Trims trims = Newtonsoft.Json.JsonConvert.DeserializeObject <Trims>(json); foreach (Trim trim in trims.trims) { ddlTrim.Items.Add(new ListItem(trim.model_trim, trim.model_id)); } }
internal void OnDeserialized(StreamingContext context) { Edges.ForEach(e => e.Brep = this); Loops.ForEach(l => l.Brep = this); Trims.ForEach(t => t.Brep = this); Faces.ForEach(f => f.Brep = this); //TODO: all the data props to the real props }
public void VerifyTrimsPageHeaderElementsRzr() { CPQNavigate.NavigateToTrimsPage(Brand.GEN, ModelPageUrl.GENERAL_1000_EPS_TRIM_COLOR_PAGE); Trims.WaitForTrimsPageToLoad(); Assert.IsTrue(Trims.HeaderModule.IsHeaderSignInIconDisplayed(), "Header Sign In is not displayed"); Assert.IsTrue(Trims.HeaderModule.IsHeaderBrandNameDisplayed("General"), "Header brand name not displayed"); Trims.HeaderModule.ClickHeaderCloseIcon(); Assert.AreEqual(CPQNavigate.GetCurrentUrl(), UrlBuilder.getGeneralLandingPageURL()); }
public void VerifyTrimsPageHeaderElementsRan() { CPQNavigate.NavigateToTrimsPage(Brand.RAN, ModelPageUrl.RANGER_500_MODEL); Trims.WaitForTrimsPageToLoad(); Assert.IsTrue(Trims.HeaderModule.IsHeaderSignInIconDisplayed(), "Header Sign In is not displayed"); Assert.IsTrue(Trims.HeaderModule.IsHeaderBrandNameDisplayed("Ranger"), "Header brand name not displayed"); Trims.HeaderModule.ClickHeaderCloseIcon(); Assert.AreEqual(CPQNavigate.GetCurrentUrl(), UrlBuilder.GetRangerBrandHomePage()); }
public void VerifyTrimsNotDuplicateAtv() { CPQNavigate.NavigateToModelsPage(Brand.ATV); Models.ClickOneSeatModel(); Trims.ClickEachModelAndVerifyTrimsAreNotDuplicate(); Trims.NavigationBarModule.ClickModelsNavigation(); Models.ClickTwoSeatModel(); Trims.ClickEachModelAndVerifyTrimsAreNotDuplicate(); }
public void VerifyTrimsPageHeaderElementsRzr() { CPQNavigate.NavigateToTrimsPage(Brand.RZR, ModelPageUrl.RZR_XP_1000_MODEL); Trims.WaitForTrimsPageToLoad(); Assert.IsTrue(Trims.HeaderModule.IsHeaderSignInIconDisplayed(), "Header Sign In is not displayed"); Assert.IsTrue(Trims.HeaderModule.IsHeaderBrandNameDisplayed("RZR"), "Header brand name not displayed"); Trims.HeaderModule.ClickHeaderCloseIcon(); Assert.AreEqual(CPQNavigate.GetCurrentUrl(), UrlBuilder.getRzrLandingPageURL()); }
public void VerifyTrimsPageHeaderElementsAtv() { CPQNavigate.NavigateToTrimsPage(Brand.ATV, ModelPageUrl.ATV_450_TRIM_COLOR_PAGE); Trims.WaitForTrimsPageToLoad(); Assert.IsTrue(Trims.HeaderModule.IsHeaderSignInIconDisplayed(), "Header Sign In is not displayed"); Assert.IsTrue(Trims.HeaderModule.IsHeaderBrandNameDisplayed("Sportsman"), "Header brand name not displayed"); Trims.HeaderModule.ClickHeaderCloseIcon(); Assert.AreEqual(CPQNavigate.GetCurrentUrl(), UrlBuilder.getSportsmanLandingPageURL()); }
public void VerifyTrimsPageFooterElementsAtv() { CPQNavigate.NavigateToTrimsPage(Brand.ATV, ModelPageUrl.ATV_450_TRIM_COLOR_PAGE); Trims.WaitForTrimsPageToLoad(); Assert.IsTrue(Models.FooterModule.IsStartingPriceDisplayed(), "Starting price is not displayed"); Assert.IsTrue(Models.FooterModule.IsPaymentCalculatorDisplayed(), "Payment calculator icon is not displayed"); Assert.IsFalse(Models.FooterModule.IsNextButtonDisplayed(), "Next button was not expected to be displayed"); Trims.FooterModule.ClickFooterPaymentCalculator(); Assert.IsTrue(Trims.CalculatorModule.IsPaymentCalculatorDisplayed(), "Payment Calculator is not displayed"); }
public void VerifyTrackPageFooterElementsSno() { CPQNavigate.NavigateToTrackPage(Brand.SNO, ModelPageUrl.SNO_TRACK_ENGINE_PAGE_MODEL); Trims.WaitForTrimsPageToLoad(); Assert.IsTrue(Track.FooterModule.IsStartingPriceDisplayed()); Assert.IsTrue(Track.FooterModule.IsPaymentCalculatorDisplayed()); Assert.IsFalse(Track.FooterModule.IsNextButtonDisplayed()); Track.FooterModule.ClickFooterPaymentCalculator(); Assert.IsTrue(Track.CalculatorModule.IsPaymentCalculatorDisplayed()); }
protected void ddlModel_SelectedIndexChanged(object sender, EventArgs e) { ddlTrim.Items.Clear(); string json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?cmd=getTrims&make=" + Util.SSC(ddlMake.SelectedValue) + "&year=" + Util.SSC(ddlYear.SelectedValue) + "&model=" + Util.SSC(ddlModel.SelectedValue)); Trims trims = Newtonsoft.Json.JsonConvert.DeserializeObject <Trims>(json); foreach (Trim trim in trims.trims) { ddlTrim.Items.Add(new ListItem(trim.model_trim, trim.model_id)); } }
public void VerifyTrimsNotDuplicateRan() { CPQNavigate.NavigateToModelsPage(Brand.RAN); Models.ClickTwoSeatModel(); Trims.ClickEachModelAndVerifyTrimsAreNotDuplicate(); Trims.NavigationBarModule.ClickModelsNavigation(); Models.ClickThreeSeatModel(); Trims.ClickEachModelAndVerifyTrimsAreNotDuplicate(); Trims.NavigationBarModule.ClickModelsNavigation(); Models.ClickFourSeatModel(); Trims.ClickEachModelAndVerifyTrimsAreNotDuplicate(); Trims.NavigationBarModule.ClickModelsNavigation(); Models.ClickSixSeatModel(); Trims.ClickEachModelAndVerifyTrimsAreNotDuplicate(); }
protected void LoadDropdowns() { string json = ""; if (ddlYear.Items.Count < 1) { json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?callback=?&cmd=getYears"); int min = Convert.ToInt32(json.Substring(26, 4)); int max = Convert.ToInt32(json.Substring(45, 4)); while (min < max) { ddlYear.Items.Add(new ListItem(Util.SSC(min), Util.SSC(min))); min++; } } string selectedYear = "2001"; string selectedMake = "honda"; string selectedModel = "civic"; json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?cmd=getMakes&year=" + selectedYear + "&sold_in_us=1"); Makes makes = Newtonsoft.Json.JsonConvert.DeserializeObject <Makes>(json); foreach (Make make in makes.makes) { ddlMake.Items.Add(new ListItem(make.make_display, make.make_id)); } json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?cmd=getModels&make=" + selectedMake + "&year=" + selectedYear + "&sold_in_us=1"); Models models = Newtonsoft.Json.JsonConvert.DeserializeObject <Models>(json); foreach (Model model in models.models) { ddlModel.Items.Add(new ListItem(model.model_name, model.model_name)); } json = Util.GetJson("https://www.carqueryapi.com/api/0.3/?cmd=getTrims&make=" + selectedMake + "&year=" + selectedYear + "&model=" + selectedModel); Trims trims = Newtonsoft.Json.JsonConvert.DeserializeObject <Trims>(json); foreach (Trim trim in trims.trims) { ddlTrim.Items.Add(new ListItem(trim.model_trim, trim.model_id)); } ddlYear.SelectedValue = "2001"; ddlMake.SelectedValue = "honda"; ddlModel.SelectedIndex = 1; }
private void GetTrims() { using (var unitOfWork = new UnitOfWork()) { if (!Trims.Any()) { Trims.Clear(); Trims.Add(new Trim() { trim_name = "" }); Trims.AddRange(unitOfWork.TrimRepository.GetAll()); } trimEquipmentBindingSource.DataSource = Trims; } }
public void VerifySteppedProcessGen() { CPQNavigate.NavigateToModelsPage(Brand.GEN); Models.SelectModelBySeatNumber("four"); Models.SelectRandomModelVersion(); Trims.WaitForTrimsPageToLoad(); Trims.ClickRandomTrim(); Accessories.WaitForAccessoriesPageToLoad(); Accessories.ClickCategoryByName("Wheel & Tire Sets"); Accessories.ClickSubcategoryByName("Trail"); Accessories.ClickAccessoryAddByProductName("Wheel & Tire Set"); Accessories.FooterModule.OpenBuildSummary(); Accessories.WaitUntilBuildSummaryIsDisplayed(); Accessories.ClikIamFinishedButton(); Quote.WaitForBuildQuotePageToLoad(); Quote.FillQuoteFormDefaultData(); Quote.ClickGetInternetPriceButton(); Confirmation.WaitUntilConfirmationPageLoads(); Confirmation.ConfirmationPageElementsAreAsExpected(); }
public bool AddTrim(string IDTrim, string Descripcion, string Departamento, string Segmento, string Secuencia) { using (PLMContext db = new PLMContext()) { var Trim = new Trims(); Trim.IdTrim = IDTrim; Trim.Descripción = Descripcion; Trim.Departamento = Departamento; Trim.Segmento = Segmento; Trim.Secuencia = int.Parse(Secuencia); try { db.Trims.Add(Trim); db.SaveChanges(); return(true); } catch (Exception ex) { Dialogs.Show(ex.Message, DialogsType.Error); return(false); } } }
public void VerifySteppedProcessAtv() { CPQNavigate.NavigateToModelsPage(Brand.ATV); Models.SelectModelBySeatNumber("two"); Models.SelectRandomModelVersion(); Trims.WaitForTrimsPageToLoad(); Trims.ClickRandomTrim(); Colors.WaitForColorsPageToLoad(); Colors.ClickRandomWholegoodColor(); Colors.FooterModule.ClickFooterNextButton(); Accessories.WaitForAccessoriesPageToLoad(); Accessories.ClickCategoryByName("Protection"); Accessories.ClickSubcategoryByName("Handguards"); Accessories.ClickAccessoryAddByProductName("Handguards"); Accessories.FooterModule.OpenBuildSummary(); Accessories.WaitUntilBuildSummaryIsDisplayed(); Accessories.ClikIamFinishedButton(); Quote.WaitForBuildQuotePageToLoad(); Quote.FillQuoteFormDefaultData(); Quote.ClickGetInternetPriceButton(); Confirmation.WaitUntilConfirmationPageLoads(); Confirmation.ConfirmationPageElementsAreAsExpected(); }
/// <summary> /// Reads from the stream until a non-escaped segment terminator was reached. /// Breaks if no segment terminator was encountered after 5000 symbols were read. /// This is to avoid loading large and corrupt files. /// </summary> /// <returns> /// An EDI segment. /// </returns> protected override string ReadSegment() { var line = ""; while (!StreamReader.EndOfStream || InternalBuffer.Any()) { line = line + Read(1); if (line.Length > 2) { var last3 = line.Substring(line.Length - 3); Separators separators; string probed; if (TryReadHeader(last3, out probed, out separators)) { Separators = separators; Trims = Trims.Except(new[] { Separators.Segment }).ToArray(); line = probed; } else { if (!string.IsNullOrEmpty(probed)) { Buffer(probed.Skip(3)); } } } // Segment terminator may never be reached if (line.Length > MaxSegmentLength) { // Reset and continue or break if (ContinueOnError) { line = ""; } else { throw new ReaderException( string.Format("No segment was found before the buffer reached the allowed maximum of {0}.", MaxSegmentLength), ReaderErrorCode.InvalidInterchangeContent); } } if (Separators == null) { continue; } if (!line.EndsWith(Separators.Segment.ToString(), StringComparison.Ordinal)) { continue; } if (Separators.Escape.HasValue && line.EndsWith(string.Concat(Separators.Escape.Value, Separators.Segment), StringComparison.Ordinal)) { continue; } var index = line.LastIndexOf(Separators.Segment.ToString(), StringComparison.Ordinal); if (index > 0) { line = line.Remove(index); } if (!string.IsNullOrEmpty(line)) { break; } } return(line.Trim(Trims)); }