/// <summary>
        /// Thủ tục đọc các cấu trúc mẫu từ file mau vào các biến kiểu chuỗi
        /// </summary>
        /// <Modifield>
        /// Người tạo                   ngày tạo            chú thích
        /// Nguyễn Trung Tuyến          9/04/2009           Tạo mới
        /// </Modifield>
        protected void ReadCacBanMau()
        {
            ClsFileFunction f = new ClsFileFunction();

            strBanMau1 = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Ban mau\\Ban mau thiet ke chi tiet CSDL 1.xml");
            strBanMau2 = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Ban mau\\Ban mau thiet ke chi tiet CSDL 2.xml");

            strBanMauDanhSachBang          = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucdanhsachbang.txt");
            strBanMauHangTrongDanhSachBang = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangtrongdanhsachbang.txt");

            strBanMauChiTietBang          = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucchitietbang.txt");
            strBanMauHangTrongChiTietBang = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangtrongchititetbang.txt");

            strBanMauDanhSachIndex          = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucdanhsachindex.txt");
            strBanMauHangTrongDanhSachIndex = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangtrongdanhsachindex.txt");

            strBanMauDanhSachTrigger          = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucdanhsachtrigger.txt");
            strBanMauHangTrongDanhSachTrigger = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangtrongdanhsachtrigger.txt");

            strBanMauDanhSachStoreProcedure1          = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucdanhsachstoreprocedure.txt");
            strBanMauHangTrongDanhSachStoreProcedure1 = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangtrongdanhsachstoreprocedure.txt");

            strBanMauDanhSachFunctions1          = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucdanhsachstoreprocedure.txt");
            strBanMauHangTrongDanhSachFunctions1 = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangtrongdanhsachstoreprocedure.txt");


            strBanMauDanhSachStoreFunction2   = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucstoreprocedure.txt");
            strBanMauHangDauVaoStoreFunction2 = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangdauvaostoreprocedure.txt");

            strBanMauDanhSachView          = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautrucdanhsachview.txt");
            strBanMauHangTrongDanhSachView = f.ReadFileToString(clsGlobalVariable.STRServerMapPath + "\\Cau truc\\cautruchangtrongdanhsachview.txt");
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="orclconn"></param>
        /// <param name="strFilePath"></param>
        /// <returns></returns>
        /// <Modifield>
        /// Người tạo                   ngày tạo            chú thích
        /// Nguyễn Trung Tuyến          9/04/2009           Tạo mới
        /// </Modifield>

        public bool WriteDatabaseStructureToWordFile(OracleConnection orclconn, String strFilePath, String strOptionPrint)
        {
            ClsFileFunction f          = new ClsFileFunction();
            String          strContent = string.Empty;

            ReadCacBanMau();
            strContent = FillCoustomInformToXML(orclconn, strOptionPrint);
            if (f.WriteContentToFile(strFilePath, strContent))
            {
                return(true);
            }
            return(false);
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            ClsSQLDatabaseToDoc    SQLdbtoword    = new ClsSQLDatabaseToDoc();
            ClsOracleDatabaseToDoc ORACLEdbtoword = new ClsOracleDatabaseToDoc();
            ClsFileFunction        ffunc          = new ClsFileFunction();
            String strOption = GetOptionString();

            if (strOption.Contains("0"))
            {
                if (ffunc.CopyFile(clsGlobalVariable.STRServerMapPath + "\\temp.doc", filepath))
                {
                    if (MessageBox.Show("In File Thành Công!\nBạn có muốn mở File để xem? ", "Kết quả",
                                        MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                    {
                        System.Diagnostics.Process proc = new System.Diagnostics.Process();
                        proc.EnableRaisingEvents = false;
                        proc.StartInfo.FileName  = filepath;
                        proc.Start();
                        //proc.WaitForExit();
                    }
                }
                else
                {
                    MessageBox.Show("In File Thất Bại!", "Kết quả", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                if (sqlConn != null)
                {
                    if (SQLdbtoword.WriteDatabaseStructureToWordFile(sqlConn, filepath, strOption))
                    {
                        if (MessageBox.Show("In File Thành Công!\nBạn có muốn mở File để xem? ", "Kết quả",
                                            MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                        {
                            System.Diagnostics.Process proc = new System.Diagnostics.Process();
                            try
                            {
                                proc.EnableRaisingEvents = false;

                                proc.StartInfo.FileName = filepath;

                                proc.Start();
                            }
                            catch (Exception ex)
                            {
                            }
                            finally { proc.Dispose(); }
                        }
                    }
                    else
                    {
                        MessageBox.Show("In File Thất Bại!", "Kết quả", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (oracleConn != null)
                {
                    if (ORACLEdbtoword.WriteDatabaseStructureToWordFile(oracleConn, filepath, strOption))
                    {
                        if (MessageBox.Show("In File Thành Công!\nBạn có muốn mở File để xem? ", "Kết quả",
                                            MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                        {
                            System.Diagnostics.Process proc = new System.Diagnostics.Process();
                            try
                            {
                                proc.EnableRaisingEvents = false;

                                proc.StartInfo.FileName = filepath;

                                proc.Start();
                            }
                            catch (Exception ex)
                            {
                            }
                            finally { proc.Dispose(); }
                        }
                    }
                    else
                    {
                        MessageBox.Show("In File Thất Bại!", "Kết quả", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            this.Dispose();
        }