private void FormCreateOrder_Load(object sender, EventArgs e) { var get_tour = tourBL.GetAllTour(); dataGridView1.DataSource = get_tour; comboBox1.DataSource = get_tour; comboBox1.DisplayMember = "IDTour"; }
private void FormListTourMini_Load(object sender, EventArgs e) { TourBL tourBL = new TourBL(); var get_tour = tourBL.GetAllTour(); dataGridView1.DataSource = get_tour; }
private void FormEditOrder_Load(object sender, EventArgs e) { TourBL tourBL = new TourBL(); OrderTourBL orderTourBL = new OrderTourBL(); var get_ordertour = orderTourBL.GetAllOrderActive(); dataGridView1.DataSource = get_ordertour; comboBox2.DataSource = tourBL.GetAllTour(); comboBox2.DisplayMember = "IDTour"; textBox1.Enabled = false; textBox2.Enabled = false; textBox3.Enabled = false; textBox4.Enabled = false; textBox5.Enabled = false; //comboBox1.DataSource = get_ordertour; //comboBox1.DisplayMember = "OrderID"; }
private void CapnhatourForm_Load(object sender, EventArgs e) { try { Getcombobox(); BindingSource bs = tourBL.GetAllTour(); this.dataGridView1.DataSource = bs; this.bindingNavigator1.BindingSource = bs; this.txtMa.DataBindings.Add("Text", bs, "matour"); this.txtTen.DataBindings.Add("Text", bs, "tentour"); this.txtHinh.DataBindings.Add("Text", bs, "hinh"); this.dateTimePicker1.DataBindings.Add("Value", bs, "ngaykhoihanh", true, DataSourceUpdateMode.OnValidation, null, "dd/MM/yyyy"); this.cbcLoai.DataBindings.Add("SelectedValue", bs, "maloai"); this.dataGridView1.Columns[3].DefaultCellStyle.Format = "dd/MM/yyyy"; } catch (SqlException ex) { MessageBox.Show(ex.Message); } }