BKI_DichVuMatDat.WinFormControls.openTemplate_v2 C# (CSharp) Method

openTemplate_v2() public static method

public static openTemplate_v2 ( string ip_file_name ) : void
ip_file_name string
return void
        public static void openTemplate_v2(string ip_file_name)
        {
            string sourcePath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"Template";//Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Template\");
            string targetPath = saveFileDialog(ip_file_name);
            if (targetPath !="")
            {
                string sourceFile = System.IO.Path.Combine(sourcePath, ip_file_name);
                System.IO.File.Copy(sourceFile, targetPath, true);
                XtraMessageBox.Show("Đã lưu file mẫu tại " + targetPath +".\nFile sẽ tự động mở ngay sau đây!","Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                var excel = new Excel.Application();
                excel.Visible = true;
                Excel.Workbooks books = excel.Workbooks;
                Excel.Workbook openexcel = books.Open(targetPath);
            }
        }