/// <summary> /// Returns a list of string element contained within the tempFour overall data. /// </summary> /// <returns>Returns the list of string values contained within temptFour of overall data. returns null if an error occured and must be handled.</returns> public List <string> GetData() { List <string> results = null; try { List <string> temp = new List <string>(); // Add the template elements to tempory storage and return it. temp.Add(TotalValue.ToString()); temp.Add(GreaterThanZeroWeeks.ToString()); temp.Add(GreaterThanMinusOneWeeks.ToString()); temp.Add(GreaterThanMinusTwoWeeks.ToString()); temp.Add(GreaterThanMinusThreeWeeks.ToString()); temp.Add(GreaterThanMinusFourWeeks.ToString()); temp.Add(GreaterThanMinusFiveWeeks.ToString()); temp.Add(GreaterThanMinusSixWeeks.ToString()); temp.Add(GreaterThanMinusSevenWeeks.ToString()); temp.Add(GreaterThanMinusEightWeeks.ToString()); temp.Add(LessThanEightWeeks.ToString()); temp.Add(Total.ToString()); results = new List <string>(temp); temp.Clear(); temp = null; } catch (Exception ex) { MessageBox.Show(ex.Message); } return(results); }
private void ActorConfig_Load(object sender, EventArgs e) { flag = false; searched = false; MinimumValue = 0; n = 1; TotalValue = int.Parse(parentForm.intEDU.Text) * 20; txtActor.Text = parentForm.txtName.Text + ": "; txtValue.Text = RemainValue.ToString() + " / " + TotalValue.ToString(); for (int i = 1; i <= 27; i++) { if (parentForm.cmbWork.Text == originalForm.CthulhuAct[i].ActName) { txtBoxValidityF(i, 0, txtSkill1, SkillValue1); txtBoxValidityF(i, 1, txtSkill2, SkillValue2); txtBoxValidityF(i, 2, txtSkill3, SkillValue3); txtBoxValidityF(i, 3, txtSkill4, SkillValue4); txtBoxValidityF(i, 4, txtSkill5, SkillValue5); txtBoxValidityF(i, 5, txtSkill6, SkillValue6); txtBoxValidityF(i, 6, txtSkill7, SkillValue7); txtBoxValidityF(i, 7, txtSkill8, SkillValue8); if (originalForm.CthulhuAct[i].ExtraSkill == 1) { for (int j = 1; j <= 60; j++) { cmbExSkill1.Items.Add(originalForm.CthulhuSkill[j].SkillName); } cmbExSkill1.Enabled = true; } else if (originalForm.CthulhuAct[i].ExtraSkill == 2) { if (parentForm.cmbWork.Text == originalForm.CthulhuAct[4].ActName) { cmbExSkill1.Items.AddRange(originalForm.KyoujuSelection); cmbExSkill2.Items.AddRange(originalForm.KyoujuSelection); } else if (parentForm.cmbWork.Text == originalForm.CthulhuAct[7].ActName) { cmbExSkill1.Items.AddRange(originalForm.KeikanSelection); cmbExSkill2.Items.AddRange(originalForm.KeikanSelection); } cmbExSkill1.Enabled = true; cmbExSkill2.Enabled = true; } else { } } else { } } RemainValue = TotalValue; MinimumValue = Decimal.ToInt32(SkillValue1.Value) + Decimal.ToInt32(SkillValue2.Value) + Decimal.ToInt32(SkillValue3.Value) + Decimal.ToInt32(SkillValue4.Value) + Decimal.ToInt32(SkillValue5.Value) + Decimal.ToInt32(SkillValue6.Value) + Decimal.ToInt32(SkillValue7.Value) + Decimal.ToInt32(SkillValue8.Value); txtActor.Text = parentForm.txtName.Text + ": "; txtValue.Text = RemainValue.ToString() + " / " + TotalValue.ToString(); }
public void CheckDisplay() { if (TotalValue <= 0.00m) { Display = NoChange ? "EXACT CHANGE ONLY" : "INSERT COIN"; } else { Display = $"${TotalValue.ToString("0.00")}"; } }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Contract #" + Number); sb.AppendLine("Total value: $" + TotalValue.ToString("F2", CultureInfo.InvariantCulture)); sb.AppendLine("Installments"); foreach (Installment installment in Installments) { sb.AppendLine(installment.DueDate.ToShortDateString() + " - " + "$" + installment.Value.ToString("F2", CultureInfo.InvariantCulture)); } return(sb.ToString()); }
// 残スキルポイント数の計算 public void MinimumValueEvaluationCheckF() { CurrentValue = Decimal.ToInt32(SkillValue1.Value) + Decimal.ToInt32(SkillValue2.Value) + Decimal.ToInt32(SkillValue3.Value) + Decimal.ToInt32(SkillValue4.Value) + Decimal.ToInt32(SkillValue5.Value) + Decimal.ToInt32(SkillValue6.Value) + Decimal.ToInt32(SkillValue7.Value) + Decimal.ToInt32(SkillValue8.Value) + Decimal.ToInt32(ExSkillValue1.Value) + Decimal.ToInt32(ExSkillValue2.Value); RemainValue = TotalValue - (CurrentValue - MinimumValue); txtValue.Text = RemainValue.ToString() + " / " + TotalValue.ToString(); if (RemainValue < 0) { button1.Enabled = false; } else { button1.Enabled = true; } }
// 残スキルポイント数の計算 public void MinimumValueEvaluationCheckF() { CurrentValue = Decimal.ToInt32(valueInterest1.Value) + Decimal.ToInt32(valueInterest2.Value) + Decimal.ToInt32(valueInterest3.Value) + Decimal.ToInt32(valueInterest4.Value) + Decimal.ToInt32(valueInterest5.Value); RemainValue = TotalValue - (CurrentValue - MinimumValue); txtValue.Text = RemainValue.ToString() + " / " + TotalValue.ToString(); if (RemainValue < 0) { button1.Enabled = false; } else { button1.Enabled = true; } }
public override string ToString() { var average = GetAverage(); var percentile95Latency = GetPercentile(0.95); var percentile99Latency = GetPercentile(0.99); var percentile999Latency = GetPercentile(0.999); var sb = new StringBuilder(); for (var i = 0; i < limits.Length; i++) { sb.AppendFormat("{0}:{1}, ", limits[i] / scale, buckets[i]); } var histogram = sb.ToString(0, sb.Length - 2); return($"TotalValue: {TotalValue.ToString("F0")}; TotalCount: {TotalCount}; Avg: {average.ToString("F0")}; 95%%: {percentile95Latency}; 99%%: {percentile99Latency}; 99.9%%: {percentile999Latency}; Min: {Min}; Max: {Max}; Histogram: {{{histogram}}}"); }
public void CreateNode(XmlWriter writer) { writer.WriteStartElement("Order"); writer.WriteElementString("OrderNo", OrderNo); writer.WriteElementString("TotalValue", TotalValue.ToString()); writer.WriteElementString("TotalWeight", TotalWeight.ToString()); writer.WriteStartElement("Consignments"); foreach (var cons in Consignments) { cons.CreateNode(writer); } writer.WriteEndElement(); writer.WriteEndElement(); }
public override string ToString() { var average = GetAverage(); var percentile95Latency = GetPercentile(0.95); var percentile99Latency = GetPercentile(0.99); var percentile999Latency = GetPercentile(0.999); var sb = new StringBuilder(); for (var i = 0; i < limits.Length; i++) { sb.AppendFormat("{0}:{1}, ", limits[i] / scale, buckets[i]); } var histogram = sb.ToString(0, sb.Length - 2); return(string.Format("TotalValue: {0}; TotalCount: {1}; Avg: {2}; 95%%: {3}; 99%%: {4}; 99.9%%: {5}; Min: {6}; Max: {7}; Histogram: {{{8}}}", TotalValue.ToString("F0"), TotalCount, average.ToString("F0"), percentile95Latency, percentile99Latency, percentile999Latency, Min, Max, histogram)); }
private void CalculateInvoice() { pnlSubtotal.Visible = true; pnlTaxValue.Visible = true; decimal subTotal = decimal.Zero; decimal serviceTax = decimal.Zero; foreach (InvoiceProduct product in lstInvoiceProduct) { subTotal = Math.Round(subTotal + product.TotalPrice, 2); serviceTax = Math.Round(serviceTax + product.TaxValue, 2); } TotalValue = subTotal + serviceTax; decimal discPercentage = String.IsNullOrEmpty(txtDiscount.Text) ? decimal.Zero : Math.Round(Convert.ToDecimal(txtDiscount.Text), 2); decimal discountValue = Math.Round(TotalValue * discPercentage * (decimal)0.01, 2); TotalValue = TotalValue - discountValue; decimal shippingAndPackaging = String.IsNullOrEmpty(txtShippingnPackaging.Text) ? decimal.Zero : Math.Round(Convert.ToDecimal(txtShippingnPackaging.Text), 2); TotalValue = TotalValue + shippingAndPackaging; lblSubtotalValue.Text = subTotal.ToString(); lblTaxValue.Text = serviceTax.ToString(); lblDiscountValue.Text = "- " + discountValue.ToString(); decimal roundedValue = decimal.Zero; if (chkRoundOff.Checked) { roundedValue = Math.Round(TotalValue); decimal value = roundedValue - TotalValue; TotalValue = roundedValue; lblRoundedOffValue.Text = Convert.ToString(value); } lblTotalValue.Text = Convert.ToString(TotalValue); if (chkMarkInvoicePaid.Checked) { txtAmountPaid.Text = TotalValue.ToString(); } }
private void ActorInterest_Load(object sender, EventArgs e) { flag = false; searched = false; MinimumValue = 0; Prev = new int[6]; PrevMin = new int[6]; TotalValue = int.Parse(parentForm.intINT.Text) * 10; txtActor.Text = parentForm.txtName.Text + ": "; txtValue.Text = RemainValue.ToString() + " / " + TotalValue.ToString(); comboBoxAddingF(cmbInterest1); comboBoxAddingF(cmbInterest2); comboBoxAddingF(cmbInterest3); comboBoxAddingF(cmbInterest4); comboBoxAddingF(cmbInterest5); RemainValue = TotalValue; MinimumValue = Decimal.ToInt32(valueInterest1.Value) + Decimal.ToInt32(valueInterest2.Value) + Decimal.ToInt32(valueInterest3.Value) + Decimal.ToInt32(valueInterest4.Value) + Decimal.ToInt32(valueInterest5.Value); txtActor.Text = parentForm.txtName.Text + ": "; txtValue.Text = RemainValue.ToString() + " / " + TotalValue.ToString(); }
public void InsertCoin(Coin coin) { InsertedCoins.Add(coin); TotalValue += coin.Value; Display = $"${TotalValue.ToString("0.00")}"; }
public override string ToString() { return("Saldo: $" + TotalValue.ToString("F2") + " " + NumCoins + "/" + MaximumCapacity + " moedas"); }
public override string ToString() { return("Não há moedas suficientes para o troco de $" + TotalValue.ToString("F2") + ", faltam $" + MissingValue.ToString("F2")); }
// typeCode = 0 - generate invoice // typeCode = 1 - generate invoice duplicate eith current date public string generate(int typeCode) { string path = "templates/invoice.xml"; XDocument doc = XDocument.Load(path); XElement root = doc.Element("Template"); string dateTimeFormat = "yyyy-MM-dd"; string header = root.Element("Header").Value; header = string.Format(header, Company.Name, Company.FullAddress, Company.Phone, Company.Email, Company.Website, Company.BankName, Company.BankAccountNumber); string title = root.Element("Title").Value; string dateOfIssue = DateOfIssue.ToString(dateTimeFormat); if (typeCode == 1) { string duplicateTitle = " - DUPLIKAT"; Number = Number + duplicateTitle; dateOfIssue = DateTime.Now.ToString(dateTimeFormat); } title = string.Format(title, Number); string cityOfIssue = root.Element("DatePlace").Value; string dateOfDelivery = DateOfDelivery.ToString(dateTimeFormat); cityOfIssue = string.Format(cityOfIssue, dateOfIssue, Company.InvoiceIssueCity, dateOfDelivery); string sellerBuyer = root.Element("SellerBuyer").Value; sellerBuyer = string.Format(sellerBuyer, Company.FullName, Company.FullAddress, Company.NIP, Contractor.FullName, Contractor.FullAddress, Contractor.NIP); header += cityOfIssue += title += sellerBuyer; string invoiceItemsTable = root.Element("InvoiceItemsTableHeader").Value; string invoiceItemsSummary = root.Element("InvoiceItemTableSummary").Value; string invoiceItem = root.Element("InvoiceItem").Value; int i = 1; foreach (InvoiceItem item in InvoiceItems) { string newItem = string.Format(invoiceItem, i, item.Name, item.UnitOfMeasureShortName, item.Quantity, item.Price.ToString("0.00"), item.TotalPrice.ToString("0.00"), item.VATValue.ToString("0.00"), item.TotalVATValue.ToString("0.00"), item.TotalPriceBrutto.ToString("0.00")); invoiceItemsTable += newItem; i++; } invoiceItemsSummary = string.Format(invoiceItemsSummary, TotalValue.ToString("0.00"), TotalVATValue.ToString("0.00"), TotalValueInclVat.ToString("0.00")); invoiceItemsTable += invoiceItemsSummary; string taxTableHeader = root.Element("TaxTableHeader").Value; string tax = root.Element("Tax").Value; tax = string.Format(tax, "23", TotalValue.ToString("0.00"), TotalVATValue.ToString("0.00"), TotalValueInclVat.ToString("0.00")); string taxTableSummary = root.Element("TaxTableSummary").Value; taxTableSummary = string.Format(taxTableSummary, TotalValue.ToString("0.00"), TotalVATValue.ToString("0.00"), TotalValueInclVat.ToString("0.00")); string taxTable = taxTableHeader + tax + taxTableSummary; string priceSummary = root.Element("PriceSummary").Value; priceSummary = string.Format(priceSummary, TotalValueInclVat.ToString("0.00"), getValueInWords(TotalValueInclVat)); string paymentMethod = root.Element("PaymentMethod").Value; paymentMethod = string.Format(paymentMethod, PaymentMethod.Name, DateOfIssue.AddDays(PaymentMethod.DueTerm).ToString(dateTimeFormat)); string issuer = root.Element("Issuer").Value; issuer = string.Format(issuer, Company.InvoiceIssuerName); string footer = paymentMethod + issuer; //string output = header + invoiceItemsTable + priceSummary + footer; string output = header + invoiceItemsTable + taxTable + priceSummary + footer; output = output.Replace("~^~^", "{{"); output = output.Replace("^~^~", "}}"); output = output.Replace("~^", "{"); output = output.Replace("^~", "}"); string time = DateTime.Now.ToFileTime().ToString(); string outputFile = Tools.getHash(sellerBuyer + time); File.WriteAllText("tmp/" + outputFile + ".tex", output); Process process = new Process(); process.StartInfo.WorkingDirectory = "tmp"; process.StartInfo.FileName = "pdflatex"; process.StartInfo.Arguments = outputFile + ".tex"; process.Start(); // wait to avoid FileNotFoundException //Task.Delay(5000); process.Dispose(); return(outputFile + ".pdf"); }