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
        public static void getCargo()
        {
            projektEntities ctx   = new projektEntities();
            var             query = from c in ctx.cargo
                                    select new
            {
                Cargo = c
            };

            CargoForm.clearDataGridView();

            foreach (var result in query)
            {
                CargoForm.fillDataGridView(result.Cargo.Id, result.Cargo.Name, result.Cargo.Type, result.Cargo.ADR, result.Cargo.ADR_Class, result.Cargo.Comment);
            }
        }
Exemple #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            CargoForm CF = new CargoForm();

            CF.Show();
        }
Exemple #4
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 #5
0
 private void button3_Click(object sender, EventArgs e)
 {
     CargoForm CF = new CargoForm();
     CF.Show();
 }