Exemple #1
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridView.CurrentRow.Index >= dataGridView.RowCount - 1)
            {
                return;
            }
            id.Text = dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString();
            int Id = int.Parse(id.Text);

            ShowFreight(Id);
            freights Freight = Functions.FindFreights(Id);

            if (dataGridView1.CurrentCell.ColumnIndex == 1)
            {
                CargoForm CF = new CargoForm(Freight.CargoId);
                CF.Show();
                return;
            }
            if (dataGridView1.CurrentCell.ColumnIndex == 2)
            {
                CompaniesForm CF = new CompaniesForm(Freight.From);
                CF.Show();
                return;
            }
            if (dataGridView1.CurrentCell.ColumnIndex == 3)
            {
                CompaniesForm CF = new CompaniesForm(Freight.To);
                CF.Show();
                return;
            }
        }
Exemple #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            CargoForm CF = new CargoForm();

            CF.Show();
        }
Exemple #3
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridView.CurrentRow.Index >= dataGridView.RowCount - 1)
            {
                return;
            }
            id.Text = dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString();
            int Id = int.Parse(id.Text);
            ShowFreight(Id);
            freights Freight = Functions.FindFreights(Id);

            if(dataGridView1.CurrentCell.ColumnIndex == 1)
            {
                CargoForm CF = new CargoForm(Freight.CargoId);
                CF.Show();
                return;
            }
            if (dataGridView1.CurrentCell.ColumnIndex == 2)
            {
                CompaniesForm CF = new CompaniesForm(Freight.From);
                CF.Show();
                return;
            }
            if (dataGridView1.CurrentCell.ColumnIndex == 3)
            {
                CompaniesForm CF = new CompaniesForm(Freight.To);
                CF.Show();
                return;
            }
        }
Exemple #4
0
 private void button3_Click(object sender, EventArgs e)
 {
     CargoForm CF = new CargoForm();
     CF.Show();
 }