Esempio n. 1
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            List <CapDoNo> dsXoa = new List <CapDoNo>();

            foreach (int value in gridViewMain.GetSelectedRows())
            {
                dsXoa.Add(gridViewMain.GetRow(value) as CapDoNo);
            }
            try
            {
                BS_CapDoNo.XoaCapDoNo(dsXoa);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Lỗi - " + exc.Message);
            }
            HienThiDuLieu_CapDoNo();
        }
Esempio n. 2
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            CapDoNo updated = gridViewMain.GetFocusedRow() as CapDoNo;

            updated.TenCapDo = textBoxTenCapDo.Text;
            if (textBoxChiTieuThuocNo.Text != String.Empty)
            {
                updated.ChiTieuThuocNo = double.Parse(textBoxChiTieuThuocNo.Text);
            }
            updated.DoCungDatDa = textBoxDoCungDatDa.Text;
            try
            {
                BS_CapDoNo.CapNhatCapDoNo(updated);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Lỗi - " + exc.Message);
            }
            ShowPanel(1);
            HienThiDuLieu_CapDoNo();
        }
Esempio n. 3
0
        private void buttonInsert_Click(object sender, EventArgs e)
        {
            CapDoNo inserted = new CapDoNo();

            inserted.MaCapDo  = textBoxMaCapDo2.Text;
            inserted.TenCapDo = textBoxTenCapDo2.Text;
            if (textBoxChiTieuThuocNo2.Text != String.Empty)
            {
                inserted.ChiTieuThuocNo = double.Parse(textBoxChiTieuThuocNo2.Text);
            }
            inserted.DoCungDatDa = textBoxDoCungDatDa2.Text;
            try
            {
                BS_CapDoNo.ThemCapDoNo(inserted);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Lỗi - " + exc.Message);
            }
            ShowPanel(1);
            HienThiDuLieu_CapDoNo();
        }
        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();
        }
Esempio n. 6
0
        private void HienThiDuLieu_CapDoNo()
        {
            List <CapDoNo> dsCapDoNo = BS_CapDoNo.DanhSachCapDoNo();

            gridControlMain.DataSource = dsCapDoNo;
        }
Esempio n. 7
0
 private void buttonPrint_Click(object sender, EventArgs e)
 {
     BS_Main.PrintData <CapDoNo>(BS_CapDoNo.DanhSachCapDoNo());
 }
Esempio n. 8
0
 private void buttonExport_Click(object sender, EventArgs e)
 {
     BS_Main.ExcelExport <CapDoNo>(BS_CapDoNo.DanhSachCapDoNo());
 }