コード例 #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 getCompanies()
        {
            projektEntities ctx   = new projektEntities();
            var             query = from c in ctx.companies
                                    join ci in ctx.cities_list on c.CityId equals ci.Id
                                    join co in ctx.company_name_list on c.CompanyId equals co.Id
                                    select new
            {
                Company     = c,
                CompanyName = co,
                CityName    = ci
            };

            CompaniesForm.clearDataGridView();

            foreach (var result in query)
            {
                CompaniesForm.fillDataGridView(result.Company.Id, result.CompanyName.Company, result.CityName.City, result.Company.Address, result.Company.Comment);
            }
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: lukadut/bazy
        private void button4_Click(object sender, EventArgs e)
        {
            CompaniesForm CF = new CompaniesForm();

            CF.Show();
        }
コード例 #4
0
ファイル: FreightsForm.cs プロジェクト: lukadut/bazy
        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 button4_Click(object sender, EventArgs e)
 {
     CompaniesForm CF = new CompaniesForm();
     CF.Show();
 }