Ejemplo n.º 1
0
        private void b_edytuj_Click(object sender, EventArgs e)
        {
            Kontrah k  = new Kontrah();
            Form3   f3 = new Form3(this, Konwersje.KonwertujInt(dataGridView1.SelectedCells[0].Value.ToString()), dataGridView1.SelectedCells[1].Value.ToString(), dataGridView1.SelectedCells[2].Value.ToString(), dataGridView1.SelectedCells[3].Value.ToString(), Konwersje.KonwertujInt(dataGridView1.SelectedCells[4].Value.ToString()), Konwersje.KonwertujInt(dataGridView1.SelectedCells[5].Value.ToString()), dataGridView1.SelectedCells[6].Value.ToString(), dataGridView1.SelectedCells[7].Value.ToString(), dataGridView1.SelectedCells[8].Value.ToString(), Konwersje.KonwertujInt(dataGridView1.SelectedCells[9].Value.ToString()), Konwersje.KonwertujInt(dataGridView1.SelectedCells[10].Value.ToString()), dataGridView1.SelectedCells[11].Value.ToString(), dataGridView1.SelectedCells[12].Value.ToString(), dataGridView1.SelectedCells[13].Value.ToString(), dataGridView1.SelectedCells[14].Value.ToString(), true, dataGridView1.SelectedCells[16].Value.ToString(), dataGridView1.SelectedCells[17].Value.ToString(), dataGridView1.SelectedCells[18].Value.ToString(), dataGridView1.SelectedCells[19].Value.ToString(), dataGridView1.SelectedCells[20].Value.ToString(), dataGridView1.SelectedCells[21].Value.ToString(), dataGridView1.SelectedCells[22].Value.ToString(), dataGridView1.SelectedCells[23].Value.ToString(), Konwersje.KonwertujInt(dataGridView1.SelectedCells[24].Value.ToString()), Konwersje.KonwertujInt(dataGridView1.SelectedCells[24].Value.ToString()));

            this.Enabled = false;
            f3.Show();
        }
Ejemplo n.º 2
0
        private void b_zapisz_Click(object sender, EventArgs e)
        {
            Kontrah k = new Kontrah(textboxy[0].Text, textboxy[1].Text, textboxy[2].Text, Konwersje.KonwertujInt(textboxy[3].Text), Konwersje.KonwertujInt(textboxy[4].Text), textboxy[5].Text, textboxy[6].Text, textboxy[7].Text, Konwersje.KonwertujInt(textboxy[8].Text), Konwersje.KonwertujInt(textboxy[9].Text), textboxy[10].Text, textboxy[11].Text, textboxy[12].Text, textboxy[13].Text, Convert.ToBoolean(textboxy[14].Text), textboxy[15].Text, textboxy[16].Text, textboxy[17].Text, textboxy[18].Text, textboxy[19].Text, textboxy[20].Text, textboxy[21].Text, textboxy[22].Text, Konwersje.KonwertujInt(textboxy[23].Text), Konwersje.KonwertujInt(textboxy[24].Text));

            if (id_kontrah == 0)
            {
                sql.dodaj(k);
            }
            else
            {
                sql.edytuj(id_kontrah, k);
            }
            this.Close();
            form2.OdswiezGrid();
        }