/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture) { objWriter.WriteStartElement("mod"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("limit", _strLimit); objWriter.WriteElementString("slots", _intSlots.ToString()); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("source", _character.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("included", _blnIncludeInVehicle.ToString()); objWriter.WriteStartElement("weapons"); foreach (Weapon w in _weapons) { w.Print(objWriter, objCulture); } objWriter.WriteEndElement(); if (_character.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("mod"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("limit", _strLimit); objWriter.WriteElementString("slots", _strSlots); objWriter.WriteElementString("rating", _intRating.ToString()); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("included", _blnIncludeInVehicle.ToString()); objWriter.WriteStartElement("weapons"); foreach (Weapon objWeapon in _lstVehicleWeapons) { objWeapon.Print(objWriter); } objWriter.WriteEndElement(); objWriter.WriteStartElement("cyberwares"); foreach (Cyberware objCyberware in _lstCyberware) { objCyberware.Print(objWriter); } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
public override string ToString() {//Override the default tostring method for use in dispalying confirmation message and for the member information search page string strResults = "Type: " + Type + Environment.NewLine; strResults += "First Name: " + FirstName + Environment.NewLine; strResults += "Last Name: " + LastName + Environment.NewLine; strResults += "Start Date: " + StartDate + Environment.NewLine; strResults += "End Date: " + EndDate + Environment.NewLine; strResults += "Sub Total: " + SubTotal.ToString("C2") + Environment.NewLine; strResults += "Training: " + Additional_Features_Training + Environment.NewLine; strResults += "Locker Rental: " + Additional_Features_LockerRental + Environment.NewLine; strResults += "Total Cost: " + TotalCost.ToString("C2") + Environment.NewLine; strResults += "Phone Number: (" + PhoneNumber.Substring(0, 3) + ")" + "-" + PhoneNumber.Substring(3, 3) + "-" + PhoneNumber.Substring(6, 4) + Environment.NewLine; strResults += "Email: " + Email + Environment.NewLine; strResults += "Gender: " + Gender + Environment.NewLine; strResults += "Age: " + Age.ToString() + " Years old" + Environment.NewLine; strResults += "Weight: " + Weight.ToString() + "lbs" + Environment.NewLine; strResults += "Credit Card Type: " + Credit_Card_Type + Environment.NewLine; strResults += "Credit Card Number: " + Credit_Card_Number + Environment.NewLine; strResults += "Athletic Performance: " + PFG_AthleticPerformance + Environment.NewLine; strResults += "Overall Health: " + PFG_OverallHealth + Environment.NewLine; strResults += "Strength Training: " + PFG_StrengthTraining + Environment.NewLine; strResults += "Weight Loss: " + PFG_WeightManagment + Environment.NewLine; strResults += Environment.NewLine; return(strResults); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> /// <param name="objCulture">Culture in which to print.</param> /// <param name="strLanguageToPrint">Language in which to print</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint) { objWriter.WriteStartElement("mod"); objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint)); objWriter.WriteElementString("category", DisplayCategory(strLanguageToPrint)); objWriter.WriteElementString("limit", Limit); objWriter.WriteElementString("slots", Slots.ToString()); objWriter.WriteElementString("avail", TotalAvail(objCulture, strLanguageToPrint)); objWriter.WriteElementString("cost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("owncost", OwnCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint)); objWriter.WriteElementString("page", Page(strLanguageToPrint)); objWriter.WriteElementString("included", IncludedInVehicle.ToString()); objWriter.WriteStartElement("weapons"); foreach (Weapon objWeapon in Weapons) { objWeapon.Print(objWriter, objCulture, strLanguageToPrint); } foreach (VehicleMod objVehicleMod in Mods) { objVehicleMod.Print(objWriter, objCulture, strLanguageToPrint); } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", Notes); } objWriter.WriteEndElement(); }
protected void BtnFinish_Click(object sender, EventArgs e) { PnlCollectProducts.Visible = false; PnlGeneratedProductInfo.Visible = true; BindSelectedProducts(); txtboxPurchasePrice.Text = TotalCost.ToString(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture) { objWriter.WriteStartElement("accessory"); objWriter.WriteElementString("name", DisplayName); objWriter.WriteElementString("mount", _strMount); objWriter.WriteElementString("extramount", _strExtraMount); objWriter.WriteElementString("rc", _strRC); objWriter.WriteElementString("conceal", _strConceal); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("owncost", OwnCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("included", _blnIncludedInWeapon.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("accuracy", _intAccuracy.ToString(objCulture)); if (_lstGear.Count > 0) { objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { objGear.Print(objWriter, objCulture); } objWriter.WriteEndElement(); } if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("armormod"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("armor", _intA.ToString()); objWriter.WriteElementString("maxrating", _intMaxRating.ToString()); objWriter.WriteElementString("rating", _intRating.ToString()); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("included", _blnIncludedInArmor.ToString()); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteElementString("wirelesson", _blnWirelessOn.ToString()); objWriter.WriteElementString("extra", LanguageManager.Instance.TranslateExtra(_strExtra)); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
public void ExportToDocument(Document wordDocument) { if (wordDocument == null) { return; } wordDocument.Bookmarks["StartDate"].Range.Text = StartDate.ToString("dd MMMM yyyy г."); wordDocument.Bookmarks["EndDate"].Range.Text = EndDate.ToString("dd MMMM yyyy г."); var salesTable = wordDocument.Bookmarks["ArticlesSales"]?.Range?.Tables[1]; if (salesTable == null) { throw new ApplicationException("Не найдена таблица для выгрузки продаж в шаблоне отчета"); } int acticleSaleNumber = 1; foreach (var articleSale in ArticlesSales) { var articleSaleRow = salesTable.Rows.Add(salesTable.Rows[acticleSaleNumber + 1]); articleSaleRow.Cells[1].Range.Text = acticleSaleNumber++.ToString(); articleSaleRow.Cells[2].Range.Text = articleSale.ArticleName; articleSaleRow.Cells[3].Range.Text = articleSale.ArticleCode; articleSaleRow.Cells[4].Range.Text = articleSale.ArticleQuantity.ToString("0.00"); articleSaleRow.Cells[5].Range.Text = articleSale.ArticlePrice.ToString("0.00"); articleSaleRow.Cells[6].Range.Text = articleSale.ArticleCost.ToString("0.00"); } salesTable.Rows[acticleSaleNumber + 1].Delete(); wordDocument.Bookmarks["TotalCost"].Range.Text = TotalCost.ToString("0.00"); wordDocument.Bookmarks["NdsValue"].Range.Text = NdsValue.ToString("0.00"); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> /// <param name="objCulture">Culture in which to print.</param> /// <param name="strLanguageToPrint">Language in which to print</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint) { objWriter.WriteStartElement("armormod"); objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint)); objWriter.WriteElementString("fullname", DisplayName(strLanguageToPrint)); objWriter.WriteElementString("name_english", Name); objWriter.WriteElementString("category", DisplayCategory(strLanguageToPrint)); objWriter.WriteElementString("category_english", Category); objWriter.WriteElementString("armor", Armor.ToString(objCulture)); objWriter.WriteElementString("maxrating", MaximumRating.ToString(objCulture)); objWriter.WriteElementString("rating", Rating.ToString(objCulture)); objWriter.WriteElementString("avail", TotalAvail(objCulture, strLanguageToPrint)); objWriter.WriteElementString("cost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("owncost", OwnCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint)); objWriter.WriteElementString("page", DisplayPage(strLanguageToPrint)); objWriter.WriteElementString("included", IncludedInArmor.ToString()); objWriter.WriteElementString("equipped", Equipped.ToString()); objWriter.WriteElementString("wirelesson", WirelessOn.ToString()); objWriter.WriteStartElement("gears"); foreach (Gear objGear in Gear) { objGear.Print(objWriter, objCulture, strLanguageToPrint); } objWriter.WriteEndElement(); objWriter.WriteElementString("extra", LanguageManager.TranslateExtra(_strExtra, strLanguageToPrint)); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", Notes); } objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> /// <param name="objCulture">Culture in which to print.</param> /// <param name="strLanguageToPrint">Language in which to print</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint) { objWriter.WriteStartElement("accessory"); objWriter.WriteElementString("name", DisplayName(strLanguageToPrint)); objWriter.WriteElementString("mount", Mount); objWriter.WriteElementString("extramount", ExtraMount); objWriter.WriteElementString("rc", RC); objWriter.WriteElementString("conceal", TotalConcealability.ToString()); objWriter.WriteElementString("avail", TotalAvail(objCulture, strLanguageToPrint)); objWriter.WriteElementString("cost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("owncost", OwnCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("included", IncludedInWeapon.ToString()); objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint)); objWriter.WriteElementString("page", Page(strLanguageToPrint)); objWriter.WriteElementString("accuracy", Accuracy.ToString(objCulture)); if (Gear.Count > 0) { objWriter.WriteStartElement("gears"); foreach (Gear objGear in Gear) { objGear.Print(objWriter, objCulture, strLanguageToPrint); } objWriter.WriteEndElement(); } if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", Notes); } objWriter.WriteEndElement(); }
private void viewBill(object sender, EventArgs e) { ConferenceTotalsForm TotalsScreen = new ConferenceTotalsForm(); ConferenceSeeBillForm SeeBillScreen = new ConferenceSeeBillForm(); SeeBillScreen.Show(); SeeBillScreen.displayAttendeeNameLabel.Text = attendeeNameTextBox.Text; SeeBillScreen.displaySchoolNameLabel.Text = schoolNameListBox.Text; MealOrder += MAX_DINING_COST; SeeBillScreen.displayDiningCostLabel.Text = MealOrder.ToString(); SeeBillScreen.displayAttendanceCostLabel.Text = MAX_ATTENDANCE_COST.ToString(); TotalCost = MealOrder + MAX_ATTENDANCE_COST; SeeBillScreen.displayTotalCostLabel.Text = TotalCost.ToString(); switchSchoolCases(); if (schoolNameListBox.GetSelected(0) == true) { TotalsScreen.displayOakridgeBillLabel.Text += TotalCost.ToString(); } else if (schoolNameListBox.GetSelected(1) == true) { TotalsScreen.displayRGSBillLabel.Text += TotalCost.ToString(); } else if (schoolNameListBox.GetSelected(2) == true) { TotalsScreen.displayHenleyCollegeBillLabel.Text += TotalCost.ToString(); } else if (schoolNameListBox.GetSelected(3) == true) { TotalsScreen.displayBNUBillLabel.Text += TotalCost.ToString(); } if (schoolNameListBox.GetSelected(0) == true) { displayOakBill += 65; } else if (schoolNameListBox.GetSelected(1) == true) { displayRGSBill += 65; } else if (schoolNameListBox.GetSelected(2) == true) { displayHenleyBill += 65; } else if (schoolNameListBox.GetSelected(3) == true) { displayBNUBill += 65; } MealOrder = 0; TotalCost = 0; }
public string ToConsoleString() { return(string.Join("\t", new string[] { EventDate.ToShortDateString().PadRight(10), EventType.ToString().PadRight(15), Attendance.ToString().PadLeft(5), TotalCost.ToString("C").PadLeft(17), PerPersonCost.ToString("C").PadLeft(10) })); }
private OrderRequest GetOrder() { OrderRequest orderRequest = new OrderRequest() { CheckoutPaymentIntent = Intent.ToUpper(), ApplicationContext = new ApplicationContext { BrandName = "EXAMPLE INC", LandingPage = "BILLING", CancelUrl = "https://www.example.com", ReturnUrl = "https://www.example.com", UserAction = "CONTINUE", ShippingPreference = "SET_PROVIDED_ADDRESS" }, PurchaseUnits = new List <PurchaseUnitRequest> { new PurchaseUnitRequest { ReferenceId = "PUHF", Description = "Sporting Goods", CustomId = "CUST-HighFashions", SoftDescriptor = "HighFashions", AmountWithBreakdown = new AmountWithBreakdown { CurrencyCode = "USD", Value = TotalCost.ToString(), AmountBreakdown = Breakdown }, Items = TotalItems, ShippingDetail = new ShippingDetail { Name = new Name { FullName = "John Doe" }, AddressPortable = new AddressPortable { AddressLine1 = "123 Townsend St", AddressLine2 = "Floor 6", AdminArea2 = "San Francisco", AdminArea1 = "CA", PostalCode = "94107", CountryCode = "US" } } } } }; return(orderRequest); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> /// <param name="objCulture">Culture in which to print.</param> /// <param name="strLanguageToPrint">Language in which to print</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint) { objWriter.WriteStartElement("lifestyle"); objWriter.WriteElementString("name", CustomName); objWriter.WriteElementString("cost", Cost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("totalmonthlycost", TotalMonthlyCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("totalcost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("dice", Dice.ToString(objCulture)); objWriter.WriteElementString("multiplier", Multiplier.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("months", Increments.ToString(objCulture)); objWriter.WriteElementString("purchased", Purchased.ToString()); objWriter.WriteElementString("type", StyleType.ToString()); objWriter.WriteElementString("increment", IncrementType.ToString()); objWriter.WriteElementString("sourceid", SourceID.ToString("D")); objWriter.WriteElementString("bonuslp", BonusLP.ToString(objCulture)); string strBaseLifestyle = string.Empty; // Retrieve the Advanced Lifestyle information if applicable. if (!string.IsNullOrEmpty(BaseLifestyle)) { XmlNode objXmlAspect = GetNode(); if (objXmlAspect != null) { strBaseLifestyle = objXmlAspect["translate"]?.InnerText ?? objXmlAspect["name"]?.InnerText ?? strBaseLifestyle; } } objWriter.WriteElementString("baselifestyle", strBaseLifestyle); objWriter.WriteElementString("trustfund", TrustFund.ToString()); objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint)); objWriter.WriteElementString("page", DisplayPage(strLanguageToPrint)); objWriter.WriteStartElement("qualities"); // Retrieve the Qualities for the Advanced Lifestyle if applicable. foreach (LifestyleQuality objQuality in LifestyleQualities) { objQuality.Print(objWriter, objCulture, strLanguageToPrint); } // Retrieve the free Grids for the Advanced Lifestyle if applicable. foreach (LifestyleQuality objQuality in FreeGrids) { objQuality.Print(objWriter, objCulture, strLanguageToPrint); } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", Notes); } objWriter.WriteEndElement(); }
public string ToOffFileLine() { var lineComponents = new[] { $"CustID = {CustomerNumber}", $"Day = {DayValue}", $"Night = {NightValue}", "", $"ReasonID = {ReasonId}", $"Total = {TotalCost.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)}", $"id = {Id}", $"date = {CreateDate.ToString("dd.MM.yyyy")}" }; return(string.Join("; ", lineComponents)); }
private void DinnerList_SelectedIndexChanged(object sender, EventArgs e) { switch (DinnerList.Text) { case "Chicken Curry": DinnerCost = 15.00; break; case "Beef Lasagna": DinnerCost = 15.00; break; case "Shawarma": DinnerCost = 15.00; break; case "Steak and Fries": DinnerCost = 15.00; break; } TotalCost = LunchCost + DinnerCost + EntryCharge; TotalBill.Text = TotalCost.ToString(); }
private void LunchList_SelectedIndexChanged(object sender, EventArgs e) { switch (LunchList.Text) { case "Caesar Salad": LunchCost = 10.00; break; case "Chilli Fish Cakes": LunchCost = 10.00; break; case "Chicken Soup": LunchCost = 10.00; break; case "Prawn Club Sandwich": LunchCost = 10.00; break; } TotalCost = LunchCost + DinnerCost + EntryCharge; TotalBill.Text = TotalCost.ToString(); }
public void Refresh() { // calculate total cost and set data StringBuilder sb = new StringBuilder(); TotalCost = 0.0; foreach (CommerceLibOrderDetailInfo item in OrderDetails) { sb.AppendLine(item.ItemAsString); TotalCost += item.Subtotal; } // Add shipping cost if (Shipping.ShippingID != -1) { sb.AppendLine("Shipping: " + Shipping.ShippingType); TotalCost += Shipping.ShippingCost; } // Add tax if (Tax.TaxID != -1 && Tax.TaxPercentage != 0.0) { double taxAmount = Math.Round(TotalCost * Tax.TaxPercentage, MidpointRounding.AwayFromZero) / 100.0; sb.AppendLine("Tax: " + Tax.TaxType + ", $" + taxAmount.ToString()); TotalCost += taxAmount; } sb.AppendLine(); sb.Append("Total order cost: $"); sb.Append(TotalCost.ToString()); OrderAsString = sb.ToString(); // get customer address string sb = new StringBuilder(); sb.AppendLine(Customer.UserName); sb.AppendLine(CustomerProfile.Address1); if (CustomerProfile.Address2 != "") { sb.AppendLine(CustomerProfile.Address2); } sb.AppendLine(CustomerProfile.City); sb.AppendLine(CustomerProfile.Region); sb.AppendLine(CustomerProfile.PostalCode); sb.AppendLine(CustomerProfile.Country); CustomerAddressAsString = sb.ToString(); }
private void Btn_calculate_Click(object sender, EventArgs e) { double localCall = 0.15; int connfee = 33; int No_Of_Calls; double TotalCost; int billingperiod; No_Of_Calls = int.Parse(Txtbox_calls.Text); billingperiod = int.Parse(Txtbox_month.Text); TotalCost = (No_Of_Calls * localCall) + (billingperiod * connfee); Txtbox_tolCharge.Text = TotalCost.ToString("C"); Txtbox_month.Focus(); Txtbox_month.Text = String.Empty; Txtbox_calls.Text = String.Empty; }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("accessory"); objWriter.WriteElementString("name", DisplayName); objWriter.WriteElementString("mount", _strMount); objWriter.WriteElementString("extramount", _strExtraMount); objWriter.WriteElementString("rc", _strRC); objWriter.WriteElementString("conceal", _strConceal); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("included", _blnIncludedInWeapon.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("accuracy", _intAccuracy.ToString()); if (_lstGear.Count > 0) { objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } objWriter.WriteEndElement(); } if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture) { objWriter.WriteStartElement("armormod"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("armor", _intA.ToString(objCulture)); objWriter.WriteElementString("maxrating", _intMaxRating.ToString(objCulture)); objWriter.WriteElementString("rating", _intRating.ToString(objCulture)); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("owncost", OwnCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("included", _blnIncludedInArmor.ToString()); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteElementString("wirelesson", _blnWirelessOn.ToString()); objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { // Use the Gear's SubClass if applicable. Commlink objCommlink = objGear as Commlink; if (objCommlink != null) { objCommlink.Print(objWriter, objCulture); } else { objGear.Print(objWriter, objCulture); } } objWriter.WriteEndElement(); objWriter.WriteElementString("extra", LanguageManager.TranslateExtra(_strExtra)); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
private void SetTotalCost() { txtProductCostTotal.Text = TotalCost.ToString(".00"); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture) { objWriter.WriteStartElement("lifestyle"); objWriter.WriteElementString("name", Name); objWriter.WriteElementString("cost", _decCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("totalmonthlycost", TotalMonthlyCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("totalcost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("dice", _intDice.ToString(objCulture)); objWriter.WriteElementString("multiplier", _decMultiplier.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("months", _intMonths.ToString(objCulture)); objWriter.WriteElementString("purchased", _blnPurchased.ToString()); objWriter.WriteElementString("type", _objType.ToString()); objWriter.WriteElementString("sourceid", SourceID.ToString()); string strBaseLifestyle = string.Empty; // Retrieve the Advanced Lifestyle information if applicable. if (!string.IsNullOrEmpty(_strBaseLifestyle)) { XmlNode objXmlAspect = MyXmlNode; if (objXmlAspect != null) { if (objXmlAspect["translate"] != null) { strBaseLifestyle = objXmlAspect["translate"].InnerText; } else if (objXmlAspect["name"] != null) { strBaseLifestyle = objXmlAspect["name"].InnerText; } } } objWriter.WriteElementString("baselifestyle", strBaseLifestyle); objWriter.WriteElementString("trustfund", _blnTrustFund.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteStartElement("qualities"); // Retrieve the Qualities for the Advanced Lifestyle if applicable. if (_lstLifestyleQualities.Count > 0) { foreach (LifestyleQuality objQuality in _lstLifestyleQualities) { objQuality.Print(objWriter, objCulture); } } // Retrieve the free Grids for the Advanced Lifestyle if applicable. if (FreeGrids.Count > 0) { foreach (LifestyleQuality objQuality in FreeGrids) { string strThisQuality = objQuality.DisplayName; objWriter.WriteElementString("quality", strThisQuality); } } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("lifestyle"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("cost", _intCost.ToString()); objWriter.WriteElementString("totalmonthlycost", TotalMonthlyCost.ToString()); objWriter.WriteElementString("totalcost", TotalCost.ToString()); objWriter.WriteElementString("dice", _intDice.ToString()); objWriter.WriteElementString("multiplier", _intMultiplier.ToString()); objWriter.WriteElementString("months", _intMonths.ToString()); objWriter.WriteElementString("purchased", _blnPurchased.ToString()); objWriter.WriteElementString("lifestylename", _strLifestyleName); objWriter.WriteElementString("type", _objType.ToString()); objWriter.WriteElementString("sourceid", SourceID.ToString()); string strBaseLifestyle = string.Empty; // Retrieve the Advanced Lifestyle information if applicable. if (!string.IsNullOrEmpty(_strBaseLifestyle)) { XmlDocument objXmlDocument = XmlManager.Instance.Load("lifestyles.xml"); XmlNode objXmlAspect = objXmlDocument.SelectSingleNode("/chummer/lifestyles/lifestyle[id = \"" + SourceID + "\"]"); if (objXmlAspect != null) { if (objXmlAspect["translate"] != null) { strBaseLifestyle = objXmlAspect["translate"].InnerText; } else if (objXmlAspect["name"] != null) { strBaseLifestyle = objXmlAspect["name"].InnerText; } } } objWriter.WriteElementString("baselifestyle", strBaseLifestyle); objWriter.WriteElementString("trustfund", _blnTrustFund.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteStartElement("qualities"); // Retrieve the Qualities for the Advanced Lifestyle if applicable. if (_lstLifestyleQualities.Count > 0) { foreach (LifestyleQuality objQuality in _lstLifestyleQualities) { objQuality.Print(objWriter); } } // Retrieve the free Grids for the Advanced Lifestyle if applicable. if (FreeGrids.Count > 0) { foreach (LifestyleQuality objQuality in FreeGrids) { string strThisQuality = objQuality.DisplayName; objWriter.WriteElementString("quality", strThisQuality); } } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// returns the basic droid information when called from any child class. /// </summary> /// <returns></returns> public override string ToString() { return(TotalCost.ToString("C") + " " + Color + " " + Material + " " + Name + " "); }
/// <summary> /// Save the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public new void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("gear"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); if (DisplayCategory.EndsWith("s")) { objWriter.WriteElementString("category", DisplayCategory.Substring(0, DisplayCategory.Length - 1)); } else { objWriter.WriteElementString("category", DisplayCategory); } objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("iscommlink", true.ToString()); objWriter.WriteElementString("ispersona", IsLivingPersona.ToString()); //objWriter.WriteElementString("isnexus", (_strCategory == "Nexus").ToString()); objWriter.WriteElementString("isammo", (_strCategory == "Ammunition").ToString()); objWriter.WriteElementString("isprogram", IsProgram.ToString()); objWriter.WriteElementString("isos", false.ToString()); objWriter.WriteElementString("issin", false.ToString()); objWriter.WriteElementString("maxrating", _intMaxRating.ToString()); objWriter.WriteElementString("rating", _intRating.ToString()); objWriter.WriteElementString("attack", _intAttack.ToString()); objWriter.WriteElementString("sleaze", _intSleaze.ToString()); objWriter.WriteElementString("dataprocessing", _intDataProcessing.ToString()); objWriter.WriteElementString("firewall", _intFirewall.ToString()); objWriter.WriteElementString("qty", _intQty.ToString()); objWriter.WriteElementString("avail", TotalAvail(true)); objWriter.WriteElementString("avail_english", TotalAvail(true, true)); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("extra", LanguageManager.Instance.TranslateExtra(_strExtra)); objWriter.WriteElementString("bonded", _blnBonded.ToString()); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteElementString("homenode", _blnHomeNode.ToString()); objWriter.WriteElementString("gearname", _strGearName); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("devicerating", TotalDeviceRating.ToString()); objWriter.WriteElementString("processorlimit", ProcessorLimit.ToString()); objWriter.WriteElementString("conditionmonitor", ConditionMonitor.ToString()); objWriter.WriteElementString("active", _blnActiveCommlink.ToString()); objWriter.WriteStartElement("children"); foreach (Gear objGear in _objChildren) { if (objGear.Category != "Commlink Upgrade" && objGear.Category != "Commlink Operating System Upgrade") { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
//Used for object public string OrderCost(string[] keys) { TotalCost += (Price * keys.ToList().Where(PriceMultiplier.ContainsKey).Sum(k => PriceMultiplier[k])) * Quantity; IndividualPrice = TotalCost / Quantity; return(TotalCost.ToString("c")); }
private void AddToCartClicked(object obj) { ObservableCollection <Account> AccountList; AnimalCollection = PostgreSQL.getAllPets(); AccountList = PostgreSQL.getAllAccounts(); lb = obj as ListBox; Animal selectedAnimal = lb.SelectedItem as Animal; isCartEmpty = (Cart.Count == 0) ? true : false; if (Quantity == null) { MessageBox.Show("Please enter a valid quantity to add to your cart", "Invalid Quantity"); } else { int purchAmt = int.Parse(Quantity); if (selectedAnimal == null) { MessageBox.Show("Please select an animal before adding it to your cart", "Invalid Selection"); } else if (selectedAnimal.Price == "Pricele$$") { MessageBox.Show("This item cannot be purchased", "The Rock Says:"); } else { if (isCartEmpty) { if ((int.Parse(selectedAnimal.Quantity) - purchAmt) < 0) { MessageBox.Show($"Requested Quantity Exceeds the number of {selectedAnimal.Type}s in stock", "Invalid Quantity"); } else { selectedAnimal.Quantity = (int.Parse(selectedAnimal.Quantity) - purchAmt).ToString(); selectedAnimal.PurchasedAmount = purchAmt.ToString(); Cart.Add(selectedAnimal as object); TotalCost += double.Parse(selectedAnimal.Price.Replace("$", "")) * purchAmt; TotalItem += double.Parse(selectedAnimal.PurchasedAmount); CollectionViewSource.GetDefaultView(lb.ItemsSource).Refresh(); foreach (Account a in AccountList) { if (a.id == LoggedInUser.id) // CHANGE THIS TO ACCOUNT ID { if (LoggedInUser.CartContent == null) { LoggedInUser.CartContent = new ObservableCollection <Animal>(); } LoggedInUser.CartContent.Add(selectedAnimal); LoggedInUser.CartTotal = TotalCost.ToString(); LoggedInUser.CartItems = TotalItem.ToString(); } } CollectionViewSource.GetDefaultView(selectedAnimal.Quantity).Refresh(); PostgreSQL.addShopper(LoggedInUser, selectedAnimal); } } else { foreach (object o in Cart.ToList()) { Animal amal = o as Animal; if (amal.Type == selectedAnimal.Type) { MessageBox.Show("You already have that animal in your shopping cart. Click Review Order to change the quantity", "Oopsies"); } else { selectedAnimal.Quantity = (int.Parse(selectedAnimal.Quantity) - purchAmt).ToString(); selectedAnimal.PurchasedAmount = purchAmt.ToString(); Cart.Add(selectedAnimal as object); TotalCost += double.Parse(selectedAnimal.Price.Replace("$", "")) * purchAmt; TotalItem += double.Parse(selectedAnimal.PurchasedAmount); CollectionViewSource.GetDefaultView(lb.ItemsSource).Refresh(); foreach (Account a in AccountList) { if (a.id == LoggedInUser.id) { LoggedInUser.CartContent.Add(selectedAnimal); LoggedInUser.CartTotal = TotalCost.ToString(); LoggedInUser.CartItems = TotalItem.ToString(); } } CollectionViewSource.GetDefaultView(selectedAnimal.Quantity).Refresh(); PostgreSQL.addShopper(LoggedInUser, selectedAnimal); } } } } } }
//************** //Methods //************** public override string ToString() { return("Droid -" + Material + Environment.NewLine + Color + Environment.NewLine + TotalCost.ToString("C") + Environment.NewLine); }
//************** //Methods //************** public override string ToString() { return("***********************" + Environment.NewLine + "Protocol Droid" + Environment.NewLine + Material + Environment.NewLine + Color + Environment.NewLine + "Number of languages: " + NumberOfLanguages.ToString() + Environment.NewLine + TotalCost.ToString("C") + Environment.NewLine + "***********************" + Environment.NewLine); }