예제 #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;
            }
        }
예제 #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);
            }
        }
예제 #3
0
파일: MainForm.cs 프로젝트: lukadut/bazy
        private void button3_Click(object sender, EventArgs e)
        {
            CargoForm CF = new CargoForm();

            CF.Show();
        }
예제 #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;
            }
        }
예제 #5
0
파일: MainForm.cs 프로젝트: lukadut/bazy
 private void button3_Click(object sender, EventArgs e)
 {
     CargoForm CF = new CargoForm();
     CF.Show();
 }