private void ViewFile(TreeGridView tgv, DataType.FileType fileType)
{
int rowIndex = tgv.CurrentCell.RowIndex;
if (rowIndex <= 0)
{
MessageBox.Show("请选择文件", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
else
{
// dr["DFL_FILE_NAME"].ToString()
DataGridViewRow row = tgv.Rows[rowIndex];
// string ff = row.Cells[0].Value.ToString();
HYDocumentMS.IFileHelper file = new FileHelper();
Boolean bl = file.isHasAuth(DataType.AuthParmsType.View, LoginInfo.LoginID, row.Cells["DFL_ID"].Value.ToString());
if (bl == false)
{
MessageBox.Show("你没有权限查看此文件!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
String fileName = Path.ChangeExtension(row.Cells["DFL_FILE_NAME"].Value.ToString(), "swf");
string viewPath = System.Configuration.ConfigurationManager.AppSettings["viewFilePath"].ToString();
ViewFileFrm fileView = new ViewFileFrm();
fileView.FileName = fileName;
//fileView.ViewFilePathAndName = @"D:\swf\Java网络编程精解.swf";
fileView.ViewFilePath = viewPath;
fileView.ShowDialog();
}
}