Пример #1
0
        private void Splitta_Load(object sender, EventArgs e)
        {
            // TODO: questa riga di codice carica i dati nella tabella 'target2021DataSet.Commesse'. È possibile spostarla o rimuoverla se necessario.
            this.commesseTableAdapter.Fill(this.target2021DataSet.Commesse);
            // TODO: questa riga di codice carica i dati nella tabella 'target2021DataSet.Commesse'. È possibile spostarla o rimuoverla se necessario.
            this.commesseTableAdapter.Fill(this.target2021DataSet.Commesse);
            string CodiceCommessa;
            int    NrPezzi, NrLastre;

            CodiceCommessa = Riga.Field <string>(target2021DataSet.Commesse.Columns.IndexOf(target2021DataSet.Commesse.CodCommessaColumn));
            //CodiceCommessa = Riga.Field<string>(target2021DataSet.Commesse.CodCommessaColumn);
            NrPezzi       = Riga.Field <int>(target2021DataSet.Commesse.Columns.IndexOf(target2021DataSet.Commesse.NrPezziDaLavorareColumn));
            NrLastre      = Riga.Field <int>(target2021DataSet.Commesse.Columns.IndexOf(target2021DataSet.Commesse.NrLastreRichiesteColumn));
            textBox1.Text = CodiceCommessa;
            textBox2.Text = NrPezzi.ToString();
            textBox5.Text = NrLastre.ToString();
            PopolaCodCommessaOF();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int      IdSC, percentuale = 0, NrLastre, NuoveLastre, nrl;
            DateTime DataConsegna, DataInTextBox;
            string   Cliente;

            if (textBox1.Text == "")
            {
                IdSC = AssegnaIdSuperCommessa();
                IdSC++;
                textBox1.Text = IdSC.ToString();
            }
            nrl           = AggiungiRiga();
            percentuale   = Convert.ToInt32(textBox3.Text) + Convert.ToInt32(commesseDataGridView.SelectedRows[0].Cells[16].Value);
            textBox3.Text = percentuale.ToString();
            Colora(sender, e);
            NrLastre      = Convert.ToInt32(textBox4.Text);
            DataConsegna  = Convert.ToDateTime(commesseDataGridView.SelectedRows[0].Cells[7].Value);
            textBox6.Text = commesseDataGridView.SelectedRows[0].Cells[54].Value.ToString();
            DataInTextBox = Convert.ToDateTime(maskedTextBox1.Text);
            if (DataConsegna < DataInTextBox)
            {
                maskedTextBox1.Text = DataConsegna.ToString();
            }
            NuoveLastre = Convert.ToInt32(commesseDataGridView.SelectedRows[0].Cells[22].Value);

            // NrLastre = NrLastre + nrl; prima era così
            if (NrLastre < nrl)
            {
                NrLastre = nrl;
            }

            textBox4.Text = NrLastre.ToString();
            Cliente       = Convert.ToString(commesseDataGridView.SelectedRows[0].Cells[5].Value);
            textBox5.Text = Cliente;
            if (textBox2.Text == "")
            {
                textBox2.Text = Convert.ToString(commesseDataGridView.SelectedRows[0].Cells[21].Value);
            }
            if (comboBox2.SelectedIndex == 1)
            {
                commesseBindingSource.Filter = "TipoCommessa = 1 AND Stato = 0 AND IDMateriaPrima = '" + textBox2.Text + "'";
            }
        }