/// <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> /// <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(); }
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> 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(); }
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) { 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(); }
/// <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(); }
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"); }
public override int GetHashCode() { int hash = 1; if (entityId_ != null) { hash ^= EntityId.GetHashCode(); } if (reservation_ != null) { hash ^= Reservation.GetHashCode(); } if (dateRange_ != null) { hash ^= DateRange.GetHashCode(); } if (reservedItem_ != null) { hash ^= ReservedItem.GetHashCode(); } if (AmountReserved != 0) { hash ^= AmountReserved.GetHashCode(); } if (totalCost_ != null) { hash ^= TotalCost.GetHashCode(); } if (IncidentalItemName.Length != 0) { hash ^= IncidentalItemName.GetHashCode(); } return(hash); }
/// <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> 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(); }
private void RecalculateNutrients() { TotalCostSum = 0; foreach (var dri in DietaryReferenceIntakes) { TotalNutrients.SetNutrientValue(dri.NutrientName, FoodIntakes.Sum(f => f.Food.GetNutrientValue(dri.NutrientName) * f.Intake)); var nutValue = TotalNutrients.GetNutrientValue(dri.NutrientName); if (nutValue == 0) { nutValue = 0.000001; } double diff = 0; diff = Math.Abs(dri.Min.Value / nutValue - 1); if (nutValue > dri.Max) { diff += nutValue / dri.Max.Value; } TotalCost.SetNutrientValue(dri.NutrientName, diff); TotalCostSum += diff; } }
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 void MergeFrom(IncidentalItemReservation other) { if (other == null) { return; } if (other.entityId_ != null) { if (entityId_ == null) { entityId_ = new global::HOLMS.Types.Booking.Indicators.IncidentalItemReservationIndicator(); } EntityId.MergeFrom(other.EntityId); } if (other.reservation_ != null) { if (reservation_ == null) { reservation_ = new global::HOLMS.Types.Booking.Indicators.ReservationIndicator(); } Reservation.MergeFrom(other.Reservation); } if (other.dateRange_ != null) { if (dateRange_ == null) { dateRange_ = new global::HOLMS.Types.Primitive.PbInclusiveOpsdateRange(); } DateRange.MergeFrom(other.DateRange); } if (other.reservedItem_ != null) { if (reservedItem_ == null) { reservedItem_ = new global::HOLMS.Types.Supply.IncidentalItems.IncidentalItemIndicator(); } ReservedItem.MergeFrom(other.ReservedItem); } if (other.AmountReserved != 0) { AmountReserved = other.AmountReserved; } if (other.totalCost_ != null) { if (totalCost_ == null) { totalCost_ = new global::HOLMS.Types.Primitive.MonetaryAmount(); } TotalCost.MergeFrom(other.TotalCost); } if (other.IncidentalItemName.Length != 0) { IncidentalItemName = other.IncidentalItemName; } }
public int CompareTo(Node nodeToCompare) { //return HeapIndex.CompareTo(nodeToCompare.HeapIndex); int compare = TotalCost.CompareTo(nodeToCompare.TotalCost); if (compare == 0) { compare = heuristic.CompareTo(nodeToCompare.heuristic); } return(-compare); }
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) })); }
/// <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(); }
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); }
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(); }
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(); }
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 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; }
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(); }
public int CompareTo(CardData other) { int elementCompareResult = elementalIdentity.CompareTo(other.elementalIdentity); if (elementCompareResult != 0) { return(elementCompareResult); } int costCompareResult = TotalCost.CompareTo(other.TotalCost); if (costCompareResult != 0) { return(costCompareResult); } // if cost and type are equal then go off names return(cardName.CompareTo(other.cardName)); }
public int CompareTo(object obj) { AbstractNode <T> temp = obj as AbstractNode <T>; if (temp == null) { throw new ArgumentException("Object is not an AbstractNode"); } int result = TotalCost.CompareTo(temp.TotalCost); if (result != 0) { return(result); } return(EstimatedCost.CompareTo(temp.EstimatedCost)); }
public int CompareTo(NodeInfo other) { if (other == null) { return(1); } if (other == this) { return(0); } if (TotalCost.Equals(other.TotalCost)) { return(0); } return(TotalCost > other.TotalCost ? 1 : -1); }
/// <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(); }
public async Task GetTotalCost(List <Beer> beers) { try { Console.WriteLine("*** GetTotalCost"); using (var call = _client.GetTotalCost()) { Random random = new Random(); foreach (Beer beer in beers) { Item item = _client.GetItem(beer); if (item.Exists()) { Console.WriteLine(string.Format("*** Getting cost of beer: style={0} name={1} brewery={2}", beer.Style, beer.Name, beer.Brewery)); await call.RequestStream.WriteAsync(beer); // add a small delay before sending the next one await Task.Delay(random.Next(1000) + 500); } else { Console.WriteLine(string.Format("Could not find item with name {0} \n", item.Beer.Name)); } } await call.RequestStream.CompleteAsync(); TotalCost cost = await call.ResponseAsync; Console.WriteLine(string.Format("*** Total cost of beers is ${0}\n", cost.Cost)); } } catch (RpcException e) { Console.WriteLine(string.Format("RPC failed", e)); throw; } }
/// <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(); }