private void button2_Click(object sender, EventArgs e) { tour.TENTOUR = textBox1.Text; tour.DACDIEM = richTextBox1.Text; tour.GIATOUR = int.Parse(textBox4.Text); tour.LOAIHINH = textBox3.Text; int t = QLTOUR_BUS.sua(tour); if (t == 0) { MessageBox.Show("Lỗi sửa tour"); } if (idcu != idmoi) { t = QLTOUR_BUS.sua(idcu); if (t == 0) { MessageBox.Show("Lỗi sửa giá cũ"); } t = QLTOUR_BUS.sua(idmoi); if (t == 0) { MessageBox.Show("Lỗi sửa giá mới"); } } }
public void set() { dd = QLTOUR_BUS.loaddd(); comboBox1.DataSource = QLTOUR_BUS.loaddd(); comboBox1.DisplayMember = "TENDIADIEM"; comboBox1.ValueMember = "ID"; }
private void button6_Click(object sender, EventArgs e) { var x = QLTOUR_BUS.thongke(dateTimePicker1.Value.Date, dateTimePicker2.Value.Date); if (!x.Any()) { MessageBox.Show("Không có dữ liệu"); } gridControl2.DataSource = x; gridControl2.RefreshDataSource(); }
public void set(TOUR t) { tour = t; textBox1.Text = t.TENTOUR; richTextBox1.Text = t.DACDIEM; textBox4.Text = t.GIATOUR.ToString(); textBox3.Text = t.LOAIHINH; gia = QLTOUR_BUS.loadg(t.ID); idcu = gia.Where(s => s.current == true).FirstOrDefault().ID; gridControl2.DataSource = gia; }
public void set(TOUR t) { textBox1.Text = t.TENTOUR; richTextBox1.Text = t.DACDIEM; textBox4.Text = t.GIATOUR.ToString(); textBox3.Text = t.LOAIHINH; List <DIADIEM> dd = QLTOUR_BUS.load(t.ID); List <CTDD> ctdd = new List <CTDD>(); foreach (var x in dd) { CTDD ct = new CTDD(); ct = x.CTDD; ctdd.Add(ct); } List <GIATOUR> gia = QLTOUR_BUS.loadg(t.ID); gridControl1.DataSource = ctdd; gridControl2.DataSource = gia; }
private void button2_Click(object sender, EventArgs e) { TOUR tt = new TOUR(); tt.TENTOUR = textBox1.Text; tt.DACDIEM = richTextBox1.Text; tt.GIATOUR = int.Parse(textBox4.Text); tt.LOAIHINH = textBox3.Text; int t = QLTOUR_BUS.them(tt); if (t == 0) { MessageBox.Show("Lỗi thêm tour"); } else { int id = QLTOUR_BUS.id(); foreach (var x in ctdd) { DIADIEM d = new DIADIEM(); d.IDTOUR = id; d.IDDD = x.ID; t = QLTOUR_BUS.them(d); if (t == 0) { MessageBox.Show("Lỗi thêm địa điểm"); } } foreach (var x in gia) { x.IDTOUR = id; t = QLTOUR_BUS.them(x); if (t == 0) { MessageBox.Show("Lỗi thêm giá"); } } } }
private void load() { gridControl1.DataSource = QLTOUR_BUS.load(); }