public KeChuyenForm(string strMaBaiHoc, ChonBaiHocForm MyParent)
 {
     InitializeComponent();
     frmParent = MyParent;
     frmParent.Hide();
     maBH = strMaBaiHoc;
     try
     {
         BaiHocDTO baihoc = new BaiHocDTO();
         baihoc       = BaiHocBUS.LayBaiHocTheoMa(strMaBaiHoc);
         tenCauChuyen = baihoc.Ten.ToString();
         FileHinhAnh  = baihoc.FileHinhAnh.ToString();
         labelX4.Text = tenCauChuyen;
         if (FileHinhAnh != "")
         {
             Bitmap bm = new Bitmap(FileHinhAnh);
             bm.MakeTransparent(System.Drawing.Color.White);
             pictureBox1.BackgroundImage = bm;
         }
         else
         {
             pnlHinhAnh.Visible         = false;
             pnlCauChuyenTraLoi.Visible = false;
             rtbNoiDung.Visible         = false;
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
Beispiel #2
0
        public OnTap(string strMaBaiHoc, ChonBaiHocForm MyParent)
        {
            InitializeComponent();
            DanhSachDeBai = FileLuyenTapBUS.LayFileTheoMaBaiHoc(strMaBaiHoc);
            frmParent     = MyParent;
            frmParent.Hide();
            intDeBaiHienTai = 0;
            BaiHocDTO BaiNghe = BaiHocBUS.LayBaiHocTheoMa(strMaBaiHoc);

            DanhSachBaiNghe = FileAmThanhBUS.LayFileAmThanhTheoMa(BaiNghe.FileAmThanh);
        }
Beispiel #3
0
        public TapLamVanForm(string strMaBaiHoc, ChonBaiHocForm frmParent)
        {
            InitializeComponent();

            cauHienTai     = 0;
            pictruocstatus = 0;
            pictiepstatus  = 0;
            myParent       = frmParent;
            myParent.Hide();
            rtbGhiNho.Visible = false;
            picCauHoi.Visible = false;
            picDapAn.Visible  = true;
            try
            {
                tableLT    = TapLamVanBUS.LayDanhSachBai(strMaBaiHoc, "TLV_LT");
                tableGN    = TapLamVanBUS.LayDanhSachBai(strMaBaiHoc, "TLV_GN");
                slRecordLT = tableLT.Rows.Count;
                slRecordGN = tableGN.Rows.Count;
                layDuongDan();

                if (slRecordLT > 1)
                {
                    pictiepstatus = 1;
                }

                rtbCauHoi.LoadFile(filenoidung);
                if (pictiepstatus == 1)
                {
                    picCTCauTiepTheo.Visible = true;
                }
                if (pictruocstatus == 1)
                {
                    picCTCauTruoc.Visible = true;
                }
            }
            catch (Exception)
            {
                if (slRecordLT == 0)
                {
                    rtbCauHoi.Text = "Bài này không có bài tập!";
                }
                else
                {
                    MessageBox.Show("Không thể đọc được dữ liệu!", "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Beispiel #4
0
 private void btnEnter_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     //this.Hide();
     if (this.Flag == true)
     {
         ChonBaiHocForm frm = new ChonBaiHocForm(this);
         frm.Location = Location;
         frm.Show();
         this.Cursor = Cursors.Default;
     }
     else
     {
         ChonGiaiTriForm frm = new ChonGiaiTriForm();
         frm.Location = Location;
         frm.Show();
         this.Cursor = Cursors.Default;
     }
 }
        //Kết thúc khai báo dành cho bài nghe.

        public ChinhTaForm(string strMaBaiHoc, ChonBaiHocForm MyParent)
        {
            //Khởi tạo chung:
            InitializeComponent();
            ChucNangHienTai = ChucNang.KhongXacDinh;
            LoiKhuyen();
            frmParent = MyParent;
            //Kết thúc khởi tạo chung.

            //Khởi tạo phần chức năng chính tả:
            klbChinhTa.Visible   = false;
            klbChinhTa.QuanLyDau = new QuanLyDau(Application.StartupPath + @"\CaiDat\QuyTacDau.dat");
            DanhSachDeBaiChinhTa = FileLuyenTapBUS.LayFileTheoMaBaiHoc(strMaBaiHoc, "CT");
            DeChinhTaHienTai     = -1;
            //Kết thúc phần khởi tạo chức năng chính tả.

            //Phần khởi tạo chức năng nghe và viết.
            BaiNghe = BaiHocBUS.LayBaiHocTheoMa(strMaBaiHoc);
            if (BaiNghe != null && BaiNghe.FileAmThanh != "")
            {
                axNVVNguoiDoc.URL = Application.StartupPath + "\\" + BaiNghe.FileAmThanh;
            }
            //Kết thúc phần khởi tạo chức năng nghe và viết.
        }
 public LuyenTuVaCauForm(string strMaBaiHoc, ChonBaiHocForm MyParent)
 {
     InitializeComponent();
     frmParent = MyParent;
     frmParent.Hide();
     try
     {
         DanhSachDeBai = FileLuyenTapBUS.LayFileTheoMaBaiHoc(strMaBaiHoc);
         if (DanhSachDeBai.Count == 0)
         {
             MessageBox.Show("Không có dữ liệu cho bài học này");
             frmParent.Show();
             this.Close();
         }
         else
         {
             this.picCTCauTiepTheo.Visible = false;
             this.intDeBaiHienTai          = 0;
             this.picCTCauTruoc.Visible    = false;
             this.arrDanhSachCauDuocChon   = new List <int>();
             if (DanhSachDeBai.Count <= 1)
             {
                 this.picCTCauTiepTheo.Visible = false;
             }
             else
             {
                 this.picCTCauTiepTheo.Visible = true;
             }
         }
     }
     catch (Exception Ex)
     {
         MessageBox.Show(Ex.Message);
         this.Dispose();
     }
 }