예제 #1
0
        public override int GetHashCode()
        {
            var hashCode = -1788079105;

            hashCode = hashCode * -1521134295 + LotteryId.GetHashCode();
            hashCode = hashCode * -1521134295 + DateRealized.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <List <int> > .Default.GetHashCode(Dozens);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Team);

            hashCode = hashCode * -1521134295 + TotalValue.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalWinners7.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(City);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(UF);

            hashCode = hashCode * -1521134295 + TotalWinners6.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalWinners5.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalWinners4.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalWinners3.GetHashCode();
            hashCode = hashCode * -1521134295 + WinnersTeam.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalValueNumbers7.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalValueNumbers6.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalValueNumbers5.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalValueNumbers4.GetHashCode();
            hashCode = hashCode * -1521134295 + TotalValueNumbers3.GetHashCode();
            hashCode = hashCode * -1521134295 + TeamValue.GetHashCode();
            hashCode = hashCode * -1521134295 + AccumulatedValue.GetHashCode();
            hashCode = hashCode * -1521134295 + EstimatedPrize.GetHashCode();
            return(hashCode);
        }
        /// <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);
        }
예제 #3
0
        public override int GetHashCode()
        {
            var hashCode = -94129212;

            hashCode *= -1521134295 + LotteryId.GetHashCode();
            hashCode *= -1521134295 + DateRealized.GetHashCode();
            hashCode *= -1521134295 + EqualityComparer <List <int> > .Default.GetHashCode(Dozens);

            hashCode *= -1521134295 + TotalValue.GetHashCode();
            hashCode *= -1521134295 + TotalWinners20.GetHashCode();
            hashCode *= -1521134295 + EqualityComparer <string> .Default.GetHashCode(City);

            hashCode *= -1521134295 + EqualityComparer <string> .Default.GetHashCode(UF);

            hashCode *= -1521134295 + TotalWinners19.GetHashCode();
            hashCode *= -1521134295 + TotalWinners18.GetHashCode();
            hashCode *= -1521134295 + TotalWinners17.GetHashCode();
            hashCode *= -1521134295 + TotalWinners16.GetHashCode();
            hashCode *= -1521134295 + TotalWinnersNoNumbers.GetHashCode();
            hashCode *= -1521134295 + TotalValueNumbers20.GetHashCode();
            hashCode *= -1521134295 + TotalValueNumbers19.GetHashCode();
            hashCode *= -1521134295 + TotalValueNumbers18.GetHashCode();
            hashCode *= -1521134295 + TotalValueNumbers17.GetHashCode();
            hashCode *= -1521134295 + TotalValueNumbers16.GetHashCode();
            hashCode *= -1521134295 + TotalValueNoNumbers.GetHashCode();
            hashCode *= -1521134295 + Acumulated20.GetHashCode();
            hashCode *= -1521134295 + Acumulated19.GetHashCode();
            hashCode *= -1521134295 + Acumulated18.GetHashCode();
            hashCode *= -1521134295 + Acumulated17.GetHashCode();
            hashCode *= -1521134295 + Acumulated16.GetHashCode();
            hashCode *= -1521134295 + AcumulatedNoNumbers.GetHashCode();
            hashCode *= -1521134295 + PrizeEstimated.GetHashCode();
            hashCode *= -1521134295 + SpecialPrizeEstimated.GetHashCode();
            return(hashCode);
        }
예제 #4
0
        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();
        }
 /// <summary>
 /// MoneyControl Constructor. It is used when you want to only show your data
 /// </summary>
 /// <param name="manager">TotalValue interface. it is necessary for the event to add quantity </param>
 /// <param name="money">Money object. Object of the currency to be displayed</param>
 public MoneyControl(TotalValue manager, Money money)
 {
     this.editing = false;
     this.manager = manager;
     InitializeComponent();
     this.money    = money;
     lblValue.Text = money.Value.ToString();
     this.changeBackground();
 }
예제 #6
0
 public void CheckDisplay()
 {
     if (TotalValue <= 0.00m)
     {
         Display = NoChange ? "EXACT CHANGE ONLY" : "INSERT COIN";
     }
     else
     {
         Display = $"${TotalValue.ToString("0.00")}";
     }
 }
예제 #7
0
        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());
        }
예제 #8
0
        // 残スキルポイント数の計算
        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;
            }
        }
예제 #9
0
        // 残スキルポイント数の計算
        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}}}");
        }
예제 #11
0
        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();
        }
예제 #12
0
        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));
        }
예제 #13
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DeliveryDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderQuantity?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InvoiceId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InvoiceDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FundedRate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InterestRate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalValue?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FundingValue?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PaymentId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PayementDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreditNoteNumber?.GetHashCode() ?? 0);
            return(hashCode);
        }
예제 #14
0
        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();
            }
        }
    //Method runs when user clicks confirm, checks for correct amount of units & confirms or rejects
    protected void ConfirmBtn_Click(object sender, EventArgs e)
    {
        TotalValue.DataBind();
        TotalValue2.DataBind();
        int units1 = Convert.ToInt32(TotalValue.Text);
        int units2 = Convert.ToInt32(TotalValue2.Text);

        string uID   = Request.QueryString["userID"];
        string sID   = Request.QueryString["studentID"];
        string level = Request.QueryString["level"];

        //If either unit count is fulfilled, redirect back to main wizard
        if (units1 == 120 || units2 == 120)
        {
            //Redirect to add compulsory modules:
            Response.Redirect("RegWizardCompMod.aspx?UserID=" + uID + "&studentID=" + sID + "&level=" + level);
        }
        else
        {
            //Alert user they have insufficient units
            Response.Write("<script>alert('Please ensure you have selected 120 units.');</script>");
        }
    }
예제 #16
0
        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();
        }
예제 #17
0
        // 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");
        }
예제 #18
0
 public override string ToString()
 {
     return("Não há moedas suficientes para o troco de $" + TotalValue.ToString("F2") + ", faltam $" + MissingValue.ToString("F2"));
 }
예제 #19
0
 private void ComputeTotalValue()
 {
     TotalValue.ComputedAs(Details.Value.Sum());
 }
 public override string ToString()
 {
     return("Saldo: $" + TotalValue.ToString("F2") + "  " +
            NumCoins + "/" + MaximumCapacity + " moedas");
 }
예제 #21
0
 public void InsertCoin(Coin coin)
 {
     InsertedCoins.Add(coin);
     TotalValue += coin.Value;
     Display     = $"${TotalValue.ToString("0.00")}";
 }
예제 #22
0
 public override string ToString()
 {
     return($"Credito: {(CreditAproved ? "Aprovado" : "Reprovado")}, Valor Total com Juros {TotalValue.ToBrazilianFormat()}, Valor do Juros {InterestValue.ToBrazilianFormat()}");
 }