private void buttonDelete_Click(object sender, EventArgs e) { List <ThuocNo> dsXoa = new List <ThuocNo>(); foreach (int value in gridViewMain.GetSelectedRows()) { dsXoa.Add(gridViewMain.GetRow(value) as ThuocNo); } try { BS_ThuocNo.XoaThuocNo(dsXoa); } catch (Exception exc) { MessageBox.Show("Lỗi - " + exc.Message); } HienThiDuLieu_ThuocNo(); }
private void buttonInsert_Click(object sender, EventArgs e) { ThuocNo inserted = gridViewMain.GetFocusedRow() as ThuocNo; inserted.TenThuocNo = textBoxTenThuocNo2.Text; if (textBoxTocDoNo2.Text != String.Empty) { inserted.TocDoNo = double.Parse(textBoxTocDoNo2.Text); } if (textBoxKhaNangSinhCong2.Text != String.Empty) { inserted.KhaNangSinhCong = double.Parse(textBoxKhaNangSinhCong2.Text); } if (textBoxMatDoNapThuoc2.Text != String.Empty) { inserted.MatDoNapThuoc = double.Parse(textBoxMatDoNapThuoc2.Text); } inserted.ChiuNuoc = textBoxChiuNuoc2.Text; if (textBoxHeSoChuyenDoi2.Text != String.Empty) { inserted.HS_ChuyenDoi = double.Parse(textBoxHeSoChuyenDoi2.Text); } if (textBoxDonViTinh2.Text != String.Empty) { inserted.DonViTinh_TN = double.Parse(textBoxDonViTinh2.Text); } if (textBoxGiaThanh2.Text != String.Empty) { inserted.GiaThanh_TN = double.Parse(textBoxGiaThanh2.Text); } try { BS_ThuocNo.ThemThuocNo(inserted); } catch (Exception exc) { MessageBox.Show("Lỗi - " + exc.Message); } ShowPanel(1); HienThiDuLieu_ThuocNo(); }
private void gridViewMain_DoubleClick(object sender, EventArgs e) { ShowPanel(3); HoChieu focusedRow = gridViewMain.GetFocusedRow() as HoChieu; textBoxMaBanVe.Text = focusedRow.MaBanVe; textBoxMaHoChieu.Text = focusedRow.MaHoChieu; textBoxTenHoChieu.Text = focusedRow.TenHoChieu; textBoxNgayLap.Text = focusedRow.NgayLap; comboBox_CongTruong.Text = BS_CongTruong.CongTruong(focusedRow.MaCongTruong).TenCongTruong; comboBox_DatDa.Text = BS_DatDa.DatDa(focusedRow.MaDatDa).TenDatDa; comboBox_MayKhoan.Text = BS_MayKhoan.MayKhoan(focusedRow.MaMayKhoan).TenMayKhoan; comboBox_KipNo.Text = BS_KipNo.KipNo(focusedRow.MaMayKhoan).TenKipNo; comboBox_ThuocNo.Text = BS_ThuocNo.ThuocNo(focusedRow.MaThuocNo).TenThuocNo; comboBox_PhuongPhapNo.Text = BS_PhuongPhapNo.PhuongPhapNo(focusedRow.MaPPNo).TenPPNo; comboBox_PhuKien.Text = BS_PhuKienNo.PhuKienNo(focusedRow.MaPhuKien).TenPhuKien; comboBox_CapDo.Text = BS_CapDoNo.CapDoNo(focusedRow.MaCapDo).TenCapDo; textBoxHeSoKC.Text = focusedRow.HeSoKC.ToString(); textBoxChieuCaoTang.Text = focusedRow.ChieuCaoTang.ToString(); textBoxQuyMoDotNo.Text = focusedRow.QuyMoDotNo.ToString(); textBoxKichThuoc_X.Text = focusedRow.KichThuoc_X.ToString(); textBoxKichThuoc_Y.Text = focusedRow.KichThuoc_Y.ToString(); //textBoxThoiDiemNo.Text = ...; }
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 HienThiDuLieu_ThuocNo() { List <ThuocNo> dsThuocNo = BS_ThuocNo.DanhSachThuocNo(); gridControlMain.DataSource = dsThuocNo; }
private void buttonExport_Click(object sender, EventArgs e) { BS_Main.ExcelExport <ThuocNo>(BS_ThuocNo.DanhSachThuocNo()); }
private void buttonPrint_Click(object sender, EventArgs e) { BS_Main.PrintData <ThuocNo>(BS_ThuocNo.DanhSachThuocNo()); }