Example #1
0
        private void repositoryItemButtonEdit1_Click(object sender, EventArgs e)
        {
            //获取当前文件的FileDataAttachmentGuid
            if (gridView2.RowCount > 0)
            {
                //判断是否为自己创建的文件
                //if (FileDataManage.GetFileCreateName(((DataRowView)(gridView1.GetFocusedRow())).Row["FileGuid"].ToString()) != SysParams.UserID)
                //{
                //    this.ShowAlertMessage("你没有权限查看此文件!");
                //    return;
                //}


                string guid = ((DataRowView)(gridView2.GetFocusedRow())).Row["FileDataAttachmentGuid"].ToString();

                string FileSourceName = ((DataRowView)(gridView2.GetFocusedRow())).Row["FileSourceName"].ToString();


                if (FileSourceName.ToLower().IndexOf(".pdf") > 0)
                {
                    //PDF文档才用专门的窗口打开,别的文档直接调用系统的安装程序直接打开
                    //调用pdf显示窗口显示文档
                    frmViewPDF frmViewPDF = new frmViewPDF();
                    frmViewPDF.ViewPDF(guid);
                }
                else
                {
                    //打开文件,不包括pdf文件
                    OpenFile(guid);
                }
            }
        }
        private void repositoryItemButtonEdit1_Click(object sender, EventArgs e)
        {
            //获取当前文件的FileDataAttachmentGuid
            if (gridView2.RowCount > 0)
            {
                if (rightgroupManage.IsOperateRightByUserID(SysParams.UserID, "FileAllView", "Qry") == false)
                {
                    if (rdoPerson.Checked == true)
                    {
                        if (FileApplyManage.IsViewRight_User(txtFileApplyGuID.Text, SysParams.UserName) == false)
                        {
                            this.ShowAlertMessage("你没有权限查看此文件,申请单中不存在当前登陆用户!");
                            return;
                        }
                    }
                    else if (rdoDept.Checked == true)
                    {
                        if (FileApplyManage.IsViewRight_Dept(txtFileApplyGuID.Text, SysParams.UserName) == false)
                        {
                            this.ShowAlertMessage("你没有权限查看此文件,申请单中不存在当前登陆人所在部门!");
                            return;
                        }
                    }
                }


                string guid = ((DataRowView)(gridView2.GetFocusedRow())).Row["FileDataAttachmentGuid"].ToString();

                string FileSourceName = ((DataRowView)(gridView2.GetFocusedRow())).Row["FileSourceName"].ToString();


                if (FileSourceName.ToLower().IndexOf(".pdf") > 0)
                {
                    //PDF文档才用专门的窗口打开,别的文档直接调用系统的安装程序直接打开
                    //调用pdf显示窗口显示文档
                    frmViewPDF frmViewPDF = new frmViewPDF();
                    frmViewPDF.ViewPDF(guid);
                }
                else
                {
                    //打开文件,不包括pdf文件
                    OpenFile(guid);
                }
            }
        }