Пример #1
0
        public override int GetHashCode()
        {
            var hashCode = 371854915;

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

            hashCode = hashCode * -1521134295 + Giacenza.GetHashCode();
            hashCode = hashCode * -1521134295 + QtaOrdine.GetHashCode();
            return(hashCode);
        }
Пример #2
0
        private double CalcolaLastre()
        {
            double Totale = 0, ValoreLastra, ValoreTotale;
            string CodiceLastraGiacente;
            int    Giacenza, NrMagazzino = 0;

            foreach (DataGridViewRow row in giacenzeMagazziniDataGridView.Rows)
            {
                try
                {
                    NrMagazzino = Convert.ToInt32(row.Cells[1].Value);
                    if (NrMagazzino == 1)
                    {
                        CodiceLastraGiacente = row.Cells[2].Value.ToString();
                        Giacenza             = Convert.ToInt32(row.Cells[7].Value);
                        DataRow[] RigaTrovata;
                        RigaTrovata = target2021DataSet.Tables["Prime"].Select("codice = '" + CodiceLastraGiacente + "'");
                        try
                        {
                            ValoreLastra = Convert.ToDouble(RigaTrovata[0][3]);
                        }
                        catch
                        {
                            ValoreLastra = 0;
                        }
                        //MessageBox.Show("Lastra: " + CodiceLastraGiacente + " - Valore: " + ValoreLastra.ToString());
                        ValoreTotale = ValoreLastra * Giacenza;
                        Totale       = Totale + ValoreTotale;
                        this.dataGridView1.Rows.Add(CodiceLastraGiacente, ValoreLastra.ToString(), Giacenza.ToString(), ValoreTotale);
                    }
                }
                catch { }
            }
            dataGridView1.Columns[3].DefaultCellStyle.Format    = "0.##";
            dataGridView1.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            return(Totale);
        }