private void controlDanhSachBanVe_Click(object sender, EventArgs e) { List <HoChieu> danhSachHoChieu = BS_HoChieu.DanhSachHoChieu(); LinkLabel value = sender as LinkLabel; foreach (HoChieu a in danhSachHoChieu) { if (a.TenHoChieu.Equals(value.Text)) { MyGetData(a.MaHoChieu); this.Close(); } } }
public FormBaoCaoThongKe(HoChieu _HoChieu) { InitializeComponent(); //add text control textLabel.Add(labelText); textLabel.Add(labelText3); textLabel.Add(label_GiaTri1); textLabel.Add(label_GiaTri2); textLabel.Add(label_GiaTri3); textLabel.Add(label_GiaTri4); textLabel.Add(label_GiaTri5); textLabel.Add(label_GiaTri6); textLabel.Add(label_GiaTri7); //add value control valueLabel.Add(labelValue_GiaTri1); valueLabel.Add(labelValue_GiaTri2); valueLabel.Add(labelValue_GiaTri3); valueLabel.Add(labelValue_GiaTri4); valueLabel.Add(labelValue_GiaTri5); valueLabel.Add(labelValue_GiaTri6); valueLabel.Add(labelValue_GiaTri7); //add combobox control valueComboBox.Add(comboBox_MaHoChieu); //add button control buttonGroup.Add(buttonTaoMoi); //UI this.BackColor = Properties.Settings.Default.FormBackgroundColor; this.MinimizeBox = false; this.MaximizeBox = false; foreach (Button b in buttonGroup) { b.BackColor = Properties.Settings.Default.ButtonColor; b.FlatAppearance.BorderSize = 0; } foreach (Label l in textLabel) { l.ForeColor = Properties.Settings.Default.TextColor; } idHoChieu = _HoChieu.MaHoChieu; comboBox_MaHoChieu.DataSource = BS_HoChieu.DanhSachHoChieu(); comboBox_MaHoChieu.DisplayMember = "TenHoChieu"; comboBox_MaHoChieu.Text = _HoChieu.TenHoChieu; }
private void FormMoBanVeDatabase_Load(object sender, EventArgs e) { t.Start(); List <HoChieu> danhSachHoChieu = BS_HoChieu.DanhSachHoChieu(); int y = 0, i = 1; foreach (HoChieu value in danhSachHoChieu) { UserControl_BanVe controlBanVe = new UserControl_BanVe(value.TenHoChieu, BS_BanVe.BanVe(value.MaBanVe).NgayChinhSua, i); controlBanVe.Width = panelMain.Width; controlBanVe.Location = new Point(0, y); controlDanhSachBanVe.Add(controlBanVe); panelMain.Controls.Add(controlBanVe); y += 30; i++; } foreach (UserControl_BanVe value in controlDanhSachBanVe) { value.LinkLabelBanVe.Click += new System.EventHandler(controlDanhSachBanVe_Click); } }
private void HienThiDuLieu_HoChieu() { List <HoChieu> dsHoChieu = BS_HoChieu.DanhSachHoChieu(); gridControlMain.DataSource = dsHoChieu; //panel insert + update comboBox_CongTruong.DataSource = comboBox_CongTruong2.DataSource = BS_CongTruong.DanhSachCongTruong(); comboBox_CongTruong.DisplayMember = comboBox_CongTruong2.DisplayMember = "TenCongTruong"; comboBox_DatDa.DataSource = comboBox_DatDa2.DataSource = BS_DatDa.DanhSachDatDa(); comboBox_DatDa.DisplayMember = comboBox_DatDa2.DisplayMember = "TenDatDa"; comboBox_MayKhoan.DataSource = comboBox_MayKhoan2.DataSource = BS_MayKhoan.DanhSachMayKhoan(); comboBox_MayKhoan.DisplayMember = comboBox_MayKhoan2.DisplayMember = "TenMayKhoan"; comboBox_KipNo.DataSource = comboBox_KipNo2.DataSource = BS_KipNo.DanhSachKipNo(); comboBox_KipNo.DisplayMember = comboBox_KipNo2.DisplayMember = "TenKipNo"; comboBox_ThuocNo.DataSource = comboBox_ThuocNo2.DataSource = BS_ThuocNo.DanhSachThuocNo(); comboBox_ThuocNo.DisplayMember = comboBox_ThuocNo2.DisplayMember = "TenThuocNo"; comboBox_PhuongPhapNo.DataSource = comboBox_PhuongPhapNo2.DataSource = BS_PhuongPhapNo.DanhSachPPNo(); comboBox_PhuongPhapNo.DisplayMember = comboBox_PhuongPhapNo2.DisplayMember = "TenPPNo"; comboBox_PhuKien.DataSource = comboBox_PhuKien2.DataSource = BS_PhuKienNo.DanhSachPhuKienNo(); comboBox_PhuKien.DisplayMember = comboBox_PhuKien2.DisplayMember = "TenPhuKien"; comboBox_CapDo.DataSource = comboBox_CapDo2.DataSource = BS_CapDoNo.DanhSachCapDoNo(); comboBox_CapDo.DisplayMember = comboBox_CapDo2.DisplayMember = "TenCapDo"; textBoxNgayLap2.Text = DateTime.Now.ToString(); }
private void buttonExport_Click(object sender, EventArgs e) { BS_Main.ExcelExport <HoChieu>(BS_HoChieu.DanhSachHoChieu()); }
private void buttonPrint_Click(object sender, EventArgs e) { BS_Main.PrintData <HoChieu>(BS_HoChieu.DanhSachHoChieu()); }