private void RemoveComponent(Label countLabel, Supplemental component) { int count = Starship.SupplementalComponents.Count(x => x.Name.Equals(component.Name) && x.Origin == component.Origin); Starship.SupplementalComponents.Remove(component); countLabel.Content = Starship.SupplementalComponents.Count(x => x.QualityName.Equals(component.QualityName) && x.Origin == component.Origin).ToString(); }
private void AddComponent(Label countLabel, Supplemental component) { int count = Starship.SupplementalComponents.Count(x => x.Name.Equals(component.Name) && x.Origin == component.Origin); if (component.Max == 0 || count < component.Max) { Starship.SupplementalComponents.Add(component); countLabel.Content = Starship.SupplementalComponents.Count(x => x.QualityName.Equals(component.QualityName) && x.Origin == component.Origin).ToString(); } }
public void AddNewSupplemental(Supplemental component, int count = 1, int min = 0, bool update = true) { SupplementalTemplate template = new SupplementalTemplate(this, component, count, min); Grid.SetRow(template, SupplementalRowCount++); Grid.SetColumn(template, 0); Supplementals.Children.Add(template); if (component.AuxiliaryWeapon != null) { UpdateWeaponSlots(false); } if (update) { UpdateSupplementals(); } }
public SupplementalTemplate(StarshipCreator parent, Supplemental component, int count = 1, int min = 0) { if (component == null) { throw new ArgumentException("Cannot create a Template of a null Component"); } this.Parent = parent; InitializeComponent(); this.Component = component; Min = min; Max = Component.Max; Count = count; CountDisplay.Content = Count.ToString(); ComponentName.Text = Component.QualityName + (Count > 1 && !Component.Name.EndsWith("s") ? "s" : ""); Special.Text = Component.Special; CheckAdd(); CheckRemove(); }
public string FTP_CASanDiego(string address, string assessment_id, string parcelNumber, string searchType, string orderNumber, string directParcel, string ownername) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; using (driver = new PhantomJSDriver()) { try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { titleaddress = address; gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, titleaddress, "CA", "San Diego"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_CASanDiego"] = "Zero"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "parcel") { ParcelSearch(orderNumber, parcelNumber); try { IWebElement Securedtable = driver.FindElement(By.XPath("//*[@id='PaymentApplicationContent_gvSecured']/tbody")); IList <IWebElement> SecuredRow = Securedtable.FindElements(By.TagName("tr")); IList <IWebElement> SecuredTD; int Securedcount = SecuredRow.Count; List <string> strSecured = new List <string>(); foreach (IWebElement Secured in SecuredRow) { SecuredTD = Secured.FindElements(By.TagName("td")); if (SecuredTD.Count != 0 && SecuredTD.Count == 13 && Secured.Text.Contains("View Bill")) { strSecured.Add("https://iwr.sdtreastax.com/SanDiegoTTCPaymentApplication/SecuredDetails.aspx?parcelNumber=" + SecuredTD[1].Text.Trim().Replace("-", "")); } } foreach (string SecuredURL in strSecured) { driver.Navigate().GoToUrl(SecuredURL); securedDetais(orderNumber, parcelNumber); try { IWebElement AssessmentTB = driver.FindElement(By.XPath("//*[@id='bp7']/div[2]/table/tbody")); IList <IWebElement> AssessmentTR = AssessmentTB.FindElements(By.TagName("tr")); IList <IWebElement> AssessmentTD; foreach (IWebElement Assessment in AssessmentTR) { AssessmentTD = Assessment.FindElements(By.TagName("td")); if (AssessmentTD.Count != 0) { Land_Desrip = AssessmentTD[0].Text; Value_Exemp = AssessmentTD[2].Text; Assessment_details = Land_Desrip + "~" + Value_Exemp; gc.insert_date(orderNumber, Parcel_No, 958, Assessment_details, 1, DateTime.Now); } } } catch { } try { Tax_authority = driver.FindElement(By.XPath("//*[@id='PaymentApplicationContent_footer']/div[2]")).Text; Tax_authority = WebDriverTest.After(Tax_authority, "payment to:"); TaxAuthotity_details = Tax_authority; gc.insert_date(orderNumber, Parcel_No, 955, TaxAuthotity_details, 1, DateTime.Now); } catch { } driver.FindElement(By.Id("PaymentApplicationContent_btnSearchResults")).SendKeys(Keys.Enter); Thread.Sleep(2000); } } catch { } AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); try { IWebElement Supplementaltable = driver.FindElement(By.XPath("//*[@id='PaymentApplicationContent_gvSupplemental']/tbody")); IList <IWebElement> SupplementalRow = Supplementaltable.FindElements(By.TagName("tr")); IList <IWebElement> SupplementalTD; int rowcount = SupplementalRow.Count; List <string> strSupplemental = new List <string>(); foreach (IWebElement Supplemental in SupplementalRow) { SupplementalTD = Supplemental.FindElements(By.TagName("td")); if (SupplementalTD.Count != 0 && SupplementalTD.Count == 13 && Supplemental.Text.Contains("View Bill")) { strSupplemental.Add("https://iwr.sdtreastax.com/SanDiegoTTCPaymentApplication/SupplementalDetails.aspx?parcelNumber=" + SupplementalTD[1].Text.Trim().Replace("-", "")); } } foreach (string SupplementalURL in strSupplemental) { driver.Navigate().GoToUrl(SupplementalURL); securedDetais(orderNumber, parcelNumber); ExcemptionDetais(orderNumber, parcelNumber); } } catch { } } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "CA", "San Diego", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "CA", "San Diego"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw; } } }