Exemple #1
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            MayKhoan updated = gridViewMain.GetFocusedRow() as MayKhoan;

            updated.TenMayKhoan = textBoxTenMayKhoan.Text;
            if (textBoxDuongKinhLK.Text != String.Empty)
            {
                updated.DuongKinhLoKhoan = double.Parse(textBoxDuongKinhLK.Text);
            }
            updated.HuongKhoan = textBoxHuongKhoan.Text;
            if (textBoxChieuSau.Text != String.Empty)
            {
                updated.ChieuSau = double.Parse(textBoxChieuSau.Text);
            }
            try
            {
                BS_MayKhoan.CapNhatMayKhoan(updated);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Lỗi - " + exc.Message);
            }
            ShowPanel(1);
            HienThiDuLieu_MayKhoan();
        }
Exemple #2
0
 private void RefreshData()
 {
     labelValue_MaHoChieu.Text       = BS_HoChieu.HoChieu(idHoChieu).TenHoChieu;
     comboBox_MayKhoan.DataSource    = BS_MayKhoan.DanhSachMayKhoan();
     comboBox_MayKhoan.DisplayMember = "TenMayKhoan";
     comboBox_MayKhoan.SelectedItem  = null;
 }
Exemple #3
0
        private void buttonInsert_Click(object sender, EventArgs e)
        {
            MayKhoan inserted = new MayKhoan();

            inserted.MaMayKhoan  = textBoxMaMayKhoan2.Text;
            inserted.TenMayKhoan = textBoxTenMayKhoan2.Text;
            if (textBoxDuongKinhLK2.Text != String.Empty)
            {
                inserted.DuongKinhLoKhoan = double.Parse(textBoxDuongKinhLK2.Text);
            }
            inserted.HuongKhoan = textBoxHuongKhoan2.Text;
            if (textBoxChieuSau2.Text != String.Empty)
            {
                inserted.ChieuSau = double.Parse(textBoxChieuSau2.Text);
            }
            try
            {
                BS_MayKhoan.ThemMayKhoan(inserted);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Lỗi - " + exc.Message);
            }
            ShowPanel(1);
            HienThiDuLieu_MayKhoan();
        }
        private void HienThiLoKhoan()
        {
            List <MayKhoan> dsMayKhoan = BS_MayKhoan.DanhSachMayKhoan();

            elementHost1.Child = dv;
            dv.AddData <MayKhoan>(dsMayKhoan);
        }
        private void RefreshData(String _idLoKhoan)
        {
            LoKhoan loKhoan = BS_LoKhoan.ThongTinLoKhoan(idHoChieu, _idLoKhoan);

            //hiển thị thông tin
            labelValue_MaHoChieu.Text       = BS_HoChieu.HoChieu(loKhoan.MaHoChieu).TenHoChieu;
            labelValue_MaBanVe.Text         = loKhoan.MaBanVe;
            labelValue_MaMayKhoan.Text      = BS_MayKhoan.MayKhoan(loKhoan.MaMayKhoan).TenMayKhoan;
            labelValue_MaLK.Text            = loKhoan.MaLoKhoan;
            comboBox_MayKhoan.DataSource    = BS_MayKhoan.DanhSachMayKhoan();
            comboBox_MayKhoan.DisplayMember = "TenMayKhoan";
            comboBox_MayKhoan.Text          = BS_MayKhoan.MayKhoan(loKhoan.MaMayKhoan).TenMayKhoan;
            //hiển thị thông số
            labelValue_DuongKinh.Text  = (Math.Round(loKhoan.BanKinh * 2, 2)).ToString();
            textBox_DuongKinh.Text     = (Math.Round(loKhoan.BanKinh * 2, 2)).ToString();
            labelValue_ChieuSauLK.Text = (Math.Round(loKhoan.ChieuSau, 2)).ToString();
            textBox_ChieuSauLK.Text    = (Math.Round(loKhoan.ChieuSau, 2)).ToString();
            labelValue_HuongKhoan.Text = comboBox_HuongKhoan.Text = loKhoan.HuongKhoan;
            labelValue_ToaDoX.Text     = textBox_ToaDoX.Text = (Math.Round(loKhoan.ToaDoX, 2)).ToString();
            labelValue_ToaDoY.Text     = textBox_ToaDoY.Text = (Math.Round(loKhoan.ToaDoY, 2)).ToString();
            labelValue_Lt.Text         = textBox1.Text = loKhoan.Lt.ToString();
            labelValue_Lkk.Text        = textBox2.Text = loKhoan.Lkk.ToString();
            labelValue_L0.Text         = textBox3.Text = loKhoan.L0.ToString();
            labelValue_Lbua.Text       = textBox4.Text = loKhoan.Lbua.ToString();
        }
        private void HienThiDuLieu_LoKhoan()
        {
            List <LoKhoan> dsLoKhoan = BS_LoKhoan.DanhSachLoKhoan();

            gridControlMain.DataSource      = dsLoKhoan;
            comboBox_MayKhoan.DataSource    = BS_MayKhoan.DanhSachMayKhoan();
            comboBox_MayKhoan.DisplayMember = "TenMayKhoan";
        }
Exemple #7
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            List <MayKhoan> dsXoa = new List <MayKhoan>();

            foreach (int value in gridViewMain.GetSelectedRows())
            {
                dsXoa.Add(gridViewMain.GetRow(value) as MayKhoan);
            }
            try
            {
                BS_MayKhoan.XoaMayKhoan(dsXoa);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Lỗi - " + exc.Message);
            }
            HienThiDuLieu_MayKhoan();
        }
        private void gridViewMain_DoubleClick(object sender, EventArgs e)
        {
            ShowPanel(3);
            LoKhoan focusedRow = gridViewMain.GetFocusedRow() as LoKhoan;

            textBoxMaHoChieu.Text    = focusedRow.MaHoChieu;
            textBoxMaBanVe.Text      = focusedRow.MaBanVe;
            textBoxMaLoKhoan.Text    = focusedRow.MaLoKhoan;
            comboBox_MayKhoan.Text   = BS_MayKhoan.MayKhoan(focusedRow.MaMayKhoan).TenMayKhoan;
            textBoxBanKinh.Text      = focusedRow.BanKinh.ToString();
            textBoxChieuSau.Text     = focusedRow.ChieuSau.ToString();
            comboBox_HuongKhoan.Text = focusedRow.HuongKhoan;
            textBoxToaDoX.Text       = focusedRow.ToaDoX.ToString();
            textBoxToaDoY.Text       = focusedRow.ToaDoY.ToString();
            textBoxLt.Text           = focusedRow.Lt.ToString();
            textBoxLkk.Text          = focusedRow.Lkk.ToString();
            textBoxL0.Text           = focusedRow.L0.ToString();
            textBoxLbua.Text         = focusedRow.Lbua.ToString();
        }
        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();
        }
Exemple #11
0
        private void HienThiDuLieu_MayKhoan()
        {
            List <MayKhoan> dsMayKhoan = BS_MayKhoan.DanhSachMayKhoan();

            gridControlMain.DataSource = dsMayKhoan;
        }
Exemple #12
0
 private void buttonPrint_Click(object sender, EventArgs e)
 {
     BS_Main.PrintData <MayKhoan>(BS_MayKhoan.DanhSachMayKhoan());
 }
Exemple #13
0
 private void buttonExport_Click(object sender, EventArgs e)
 {
     BS_Main.ExcelExport <MayKhoan>(BS_MayKhoan.DanhSachMayKhoan());
 }