SVN r785
SVN-Revision: r785
This commit is contained in:
@@ -329,7 +329,14 @@ namespace Lskj.Control
|
||||
// 配置按钮可用 显示
|
||||
btnCopyNew.Enabled = this.SysModel.AddEnable && this.SysModel.AddCopyEnabled;
|
||||
// 配置有目录结构(显示)、修改状态(可用)
|
||||
btnAttach.Visible = this.SysModel.MenuDirId > 0;
|
||||
if (this.SysModel.HideAttachBtn)
|
||||
{
|
||||
btnAttach.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnAttach.Visible = this.SysModel.MenuDirId > 0;
|
||||
}
|
||||
btnAttach.Enabled = !string.IsNullOrWhiteSpace(this.PrimaryValue);
|
||||
int AttachCount = AttachImpl.GetFileCount(this.SysModel.MenuDirId + "", this.PrimaryValue);
|
||||
this.btnAttach.Text = AttachCount > 0 ? "附件管理" + "(" + AttachCount + ")" : this.btnAttach.Text;
|
||||
@@ -2548,8 +2555,51 @@ namespace Lskj.Control
|
||||
string[] defaultArgs = string.Format(ModuleArgs.DefaultArgs, this.Model.FormText, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, this.Model.Privilege, this.Model.ModuleCode).Split('~');
|
||||
string[] menuArgs = SystemInfo.Instance.BsAttachFlag.Equals("1") ? new string[] { "", "", url } : new string[] { string.Format(ModuleArgs.PubPhotoViewArgs, this.PrimaryValue), "0", this.SysModel.MenuDirId + "", "" };
|
||||
string[] args = defaultArgs.Concat(menuArgs).ToArray();
|
||||
IForm form = FormHelper.LoadDllForm(SystemInfo.Instance.BsAttachFlag.Equals("1") ? ResourceDynamic.PubBrower : ResourceDynamic.PhotoView, args);
|
||||
DialogResult result = form.SubForm.ShowDialog();
|
||||
if (SystemInfo.Instance.BsAttachFlag.Equals("2"))
|
||||
{
|
||||
IForm form = FormHelper.LoadDllForm(ResourceDynamic.PubBrower, args);
|
||||
form.SubForm.Controls.Clear();
|
||||
form.SubForm.WindowState = FormWindowState.Maximized;
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo()
|
||||
{
|
||||
FileName = "WebBrowser\\Lskj.WebBrowser.exe",
|
||||
Arguments = HandleHelper.CombineArgs(args),
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = false,
|
||||
RedirectStandardError = false,
|
||||
CreateNoWindow = false
|
||||
};
|
||||
Process startedProcess = Process.Start(processStartInfo);
|
||||
if (startedProcess == null)
|
||||
{
|
||||
MessageUtil.Show("进程启动失败");
|
||||
return;
|
||||
}
|
||||
startedProcess.WaitForInputIdle();
|
||||
int retry = 0;
|
||||
while (startedProcess.MainWindowHandle == IntPtr.Zero && retry < 50)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
startedProcess.Refresh();
|
||||
retry++;
|
||||
}
|
||||
IntPtr exeMainHandle = startedProcess.MainWindowHandle;
|
||||
if (exeMainHandle == IntPtr.Zero)
|
||||
{
|
||||
MessageBox.Show("无法获取启动程序的主窗口句柄");
|
||||
return;
|
||||
}
|
||||
HandleHelper.SetFormNoneStyle(exeMainHandle, form.SubForm);
|
||||
DialogResult result = form.SubForm.ShowDialog();
|
||||
startedProcess.Kill();
|
||||
form.SubForm.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
IForm form = FormHelper.LoadDllForm(SystemInfo.Instance.BsAttachFlag.Equals("1") ? ResourceDynamic.PubBrower : ResourceDynamic.PhotoView, args);
|
||||
DialogResult result = form.SubForm.ShowDialog();
|
||||
form.SubForm.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user