SVN r1148
SVN-Revision: r1148
This commit is contained in:
@@ -269,7 +269,7 @@ namespace Lskj.AutoUpdate
|
|||||||
System.IO.FileInfo f = new FileInfo(newPath);
|
System.IO.FileInfo f = new FileInfo(newPath);
|
||||||
if (!file.Size.ToString().Equals(f.Length.ToString()) && !file.FileName.ToString().EndsWith(".xml"))
|
if (!file.Size.ToString().Equals(f.Length.ToString()) && !file.FileName.ToString().EndsWith(".xml"))
|
||||||
{
|
{
|
||||||
MessageBox.Show($"文件大小与服务器不匹配");
|
MessageBox.Show($"文件大小与服务器不匹配 "+ file.FileName);
|
||||||
ShowErrorAndRestartApplication();
|
ShowErrorAndRestartApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -774,6 +774,13 @@ namespace Lskj.Control
|
|||||||
gridColumn.AppearanceCell.Options.UseTextOptions = true;
|
gridColumn.AppearanceCell.Options.UseTextOptions = true;
|
||||||
gridColumn.AppearanceCell.TextOptions.HAlignment = model.DataAlignment == 1 ? DevExpress.Utils.HorzAlignment.Center : DevExpress.Utils.HorzAlignment.Far;
|
gridColumn.AppearanceCell.TextOptions.HAlignment = model.DataAlignment == 1 ? DevExpress.Utils.HorzAlignment.Center : DevExpress.Utils.HorzAlignment.Far;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(model.TitleColor))
|
||||||
|
{
|
||||||
|
gridColumn.AppearanceHeader.Options.UseForeColor = true;
|
||||||
|
gridColumn.AppearanceHeader.ForeColor = ColorTranslator.FromHtml(model.TitleColor);
|
||||||
|
}
|
||||||
|
|
||||||
if (EnabledChangeColor)
|
if (EnabledChangeColor)
|
||||||
{
|
{
|
||||||
if (!model.Edit)
|
if (!model.Edit)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ using System.Net;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Web;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Lskj.Main.Control
|
namespace Lskj.Main.Control
|
||||||
@@ -457,6 +458,22 @@ namespace Lskj.Main.Control
|
|||||||
{
|
{
|
||||||
this.lbUserName.Text = ERPInfo.Instance.UserName;
|
this.lbUserName.Text = ERPInfo.Instance.UserName;
|
||||||
|
|
||||||
|
if (this.lbUserName.Width+ this.lbUserName.Left-2> button6.Left)
|
||||||
|
{
|
||||||
|
//右上角用户名特殊处理
|
||||||
|
this.lbUserName.Text = this.lbUserName.Text.Substring(0, 2) + "...";
|
||||||
|
ToolTip toolTip = new ToolTip
|
||||||
|
{
|
||||||
|
InitialDelay = 100, // 鼠标悬浮后延迟显示时间(毫秒)
|
||||||
|
ReshowDelay = 500, // 连续悬浮不同控件时的延迟
|
||||||
|
ShowAlways = true, // 始终显示提示
|
||||||
|
UseAnimation = true, // 显示动画效果
|
||||||
|
UseFading = true, // 淡入淡出效果
|
||||||
|
AutoPopDelay = 1000000 // 提示框自动消失时间(毫秒)
|
||||||
|
};
|
||||||
|
toolTip.SetToolTip(this.lbUserName, ERPInfo.Instance.UserName);
|
||||||
|
}
|
||||||
|
|
||||||
this.tsmi_userName.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("用户名") + ":" + ERPInfo.Instance.UserName : "用户名:" + ERPInfo.Instance.UserName;
|
this.tsmi_userName.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("用户名") + ":" + ERPInfo.Instance.UserName : "用户名:" + ERPInfo.Instance.UserName;
|
||||||
this.tsmi_account_book.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("账套") + ":" + ERPInfo.Instance.AccountBook : "账套:" + ERPInfo.Instance.AccountBook;
|
this.tsmi_account_book.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("账套") + ":" + ERPInfo.Instance.AccountBook : "账套:" + ERPInfo.Instance.AccountBook;
|
||||||
this.tsmi_version.Text = string.Format("Version:{0}", Assembly.GetExecutingAssembly().GetName().Version + "");
|
this.tsmi_version.Text = string.Format("Version:{0}", Assembly.GetExecutingAssembly().GetName().Version + "");
|
||||||
|
|||||||
@@ -746,8 +746,8 @@ namespace Lskj.Main
|
|||||||
break;
|
break;
|
||||||
case -1: // 登录失败
|
case -1: // 登录失败
|
||||||
default:
|
default:
|
||||||
ErrorLogText = string.Format("登录用户Id:{0}\r\n登录用户名称:{1}\r\n输入密码:{2}", userId, userName, password);
|
//ErrorLogText = string.Format("登录用户Id:{0}\r\n登录用户名称:{1}\r\n输入密码:{2}", userId, userName, password);
|
||||||
LogUtil.WriteDebug("", "登录失败", ErrorLogText, "");
|
//LogUtil.WriteDebug("", "登录失败", ErrorLogText, "");
|
||||||
MessageUtil.Show(ResourceKeys.LoginFault);
|
MessageUtil.Show(ResourceKeys.LoginFault);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ using System.Reflection;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using Lskj.Control.BrowserSetting;
|
using Lskj.Control.BrowserSetting;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using System.Resources;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Lskj.Main
|
namespace Lskj.Main
|
||||||
{
|
{
|
||||||
@@ -26,12 +28,15 @@ namespace Lskj.Main
|
|||||||
//private static extern bool SetProcessDpiAwarenessContext(IntPtr dpiContext);
|
//private static extern bool SetProcessDpiAwarenessContext(IntPtr dpiContext);
|
||||||
|
|
||||||
//private static readonly IntPtr DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = new IntPtr(-4);
|
//private static readonly IntPtr DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = new IntPtr(-4);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应用程序的主入口点。
|
/// 应用程序的主入口点。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|
||||||
//SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
//SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||||
CefRuntime.Load();//cef浏览器模块设置加载
|
CefRuntime.Load();//cef浏览器模块设置加载
|
||||||
var mainArgs = new CefMainArgs(args);
|
var mainArgs = new CefMainArgs(args);
|
||||||
@@ -81,6 +86,7 @@ namespace Lskj.Main
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
MessageUtil.Show(ex);
|
MessageUtil.Show(ex);
|
||||||
|
LogHelper.Instance.WriteError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -113,6 +119,9 @@ namespace Lskj.Main
|
|||||||
commandLine.AppendSwitch("resources-dir-path", path);
|
commandLine.AppendSwitch("resources-dir-path", path);
|
||||||
commandLine.AppendSwitch("locales-dir-path", Path.Combine(path, "locales"));
|
commandLine.AppendSwitch("locales-dir-path", Path.Combine(path, "locales"));
|
||||||
|
|
||||||
|
commandLine.AppendSwitch("ignore-certificate-errors", "1");
|
||||||
|
commandLine.AppendSwitch("allow-running-insecure-content", "1");
|
||||||
|
|
||||||
//如果注册表中CefMultithreading不为1,并且根目录中不存在BrowserMultithreading.txt"文件,就是单线程模式
|
//如果注册表中CefMultithreading不为1,并且根目录中不存在BrowserMultithreading.txt"文件,就是单线程模式
|
||||||
//只要有一个条件满足就是多线程模式
|
//只要有一个条件满足就是多线程模式
|
||||||
if (!BrowserMultithreading() && !File.Exists(PubUtil.AbsolutelyPath + "BrowserMultithreading.txt"))
|
if (!BrowserMultithreading() && !File.Exists(PubUtil.AbsolutelyPath + "BrowserMultithreading.txt"))
|
||||||
@@ -146,7 +155,9 @@ namespace Lskj.Main
|
|||||||
/// <param name="e">The <see cref="ThreadExceptionEventArgs"/> instance containing the event data.</param>
|
/// <param name="e">The <see cref="ThreadExceptionEventArgs"/> instance containing the event data.</param>
|
||||||
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
MessageUtil.Show(e.Exception);
|
// 获取异常对象
|
||||||
|
Exception ex = e.Exception;
|
||||||
|
MessageUtil.Show(ex);
|
||||||
LogHelper.Instance.WriteError(e.Exception);
|
LogHelper.Instance.WriteError(e.Exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -431,7 +431,10 @@ namespace Lskj.Model
|
|||||||
///打印按钮交互条件
|
///打印按钮交互条件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PrintingConditions;
|
public string PrintingConditions;
|
||||||
|
/// <summary>
|
||||||
|
///新增保存时检查单据号
|
||||||
|
/// </summary>
|
||||||
|
public bool SaveVerifyBillNo;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -439,7 +442,7 @@ namespace Lskj.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rowItem">The row item.</param>
|
/// <param name="rowItem">The row item.</param>
|
||||||
///
|
///
|
||||||
|
//p_systembilltype
|
||||||
public BillModel(DataRow rowItem)
|
public BillModel(DataRow rowItem)
|
||||||
{
|
{
|
||||||
if (rowItem == null) return;
|
if (rowItem == null) return;
|
||||||
@@ -521,4 +524,5 @@ namespace Lskj.Model
|
|||||||
this.RefreshSelectedDetail = rowItem.Table.Columns.Contains("RefreshSelectedDetail") ? "1".Equals(rowItem["RefreshSelectedDetail"] + "") : false;
|
this.RefreshSelectedDetail = rowItem.Table.Columns.Contains("RefreshSelectedDetail") ? "1".Equals(rowItem["RefreshSelectedDetail"] + "") : false;
|
||||||
this.InitialRefreshId = rowItem.Table.Columns.Contains("InitialRefreshId") ? rowItem["InitialRefreshId"] + "" : "";
|
this.InitialRefreshId = rowItem.Table.Columns.Contains("InitialRefreshId") ? rowItem["InitialRefreshId"] + "" : "";
|
||||||
this.IgnoreAllocated = rowItem.Table.Columns.Contains("IgnoreAllocated") ? "1".Equals(rowItem["IgnoreAllocated"] + "") : false;
|
this.IgnoreAllocated = rowItem.Table.Columns.Contains("IgnoreAllocated") ? "1".Equals(rowItem["IgnoreAllocated"] + "") : false;
|
||||||
this.BillSourceControlName = rowItem.Table.Col
|
this.BillSourceControlName = rowItem.Table.Columns.Contains("BillSourceControlName") ? rowItem["BillSourceControlName"] + "" : "";
|
||||||
|
if (!string.IsNullOrWhiteSpace(this.BillSource
|
||||||
@@ -4979,7 +4979,7 @@ namespace Lskj.PubBill
|
|||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
private string GetAddRecord(ref string parmaryValue)
|
private string GetAddRecord(ref string parmaryValue)
|
||||||
{
|
{
|
||||||
if (BillModel.NewVer == 0)
|
if (BillModel.NewVer == 0|| BillModel.SaveVerifyBillNo)
|
||||||
{
|
{
|
||||||
// 检查当前的单据号是否已被占用.
|
// 检查当前的单据号是否已被占用.
|
||||||
string newBillNo = BillImpl.GetBillNo(this.BillModel.BillSeq);
|
string newBillNo = BillImpl.GetBillNo(this.BillModel.BillSeq);
|
||||||
@@ -5421,7 +5421,6 @@ namespace Lskj.PubBill
|
|||||||
|
|
||||||
string masterSql = BillModel.SaveState ? GetUpdateRecord(billNo) : GetAddRecord(ref billNo);
|
string masterSql = BillModel.SaveState ? GetUpdateRecord(billNo) : GetAddRecord(ref billNo);
|
||||||
string detailSql = GetDetailRecord(detailGuid, billNo, addRowList).ToString();
|
string detailSql = GetDetailRecord(detailGuid, billNo, addRowList).ToString();
|
||||||
|
|
||||||
// 检查单据头数据合法性
|
// 检查单据头数据合法性
|
||||||
if (string.IsNullOrEmpty(masterSql)) return false;
|
if (string.IsNullOrEmpty(masterSql)) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace Lskj.PubBrower
|
|||||||
{
|
{
|
||||||
urlEnd = string.IsNullOrEmpty(PubBrowerModel.UrlParame) ? ReplaceHelper.ReplaceUserInfo(PubBrowerModel.ModuleCode) : string.IsNullOrWhiteSpace(PubBrowerModel.UrlParame) ? "" : HttpUtility.UrlEncode(PubBrowerModel.UrlParame);
|
urlEnd = string.IsNullOrEmpty(PubBrowerModel.UrlParame) ? ReplaceHelper.ReplaceUserInfo(PubBrowerModel.ModuleCode) : string.IsNullOrWhiteSpace(PubBrowerModel.UrlParame) ? "" : HttpUtility.UrlEncode(PubBrowerModel.UrlParame);
|
||||||
}
|
}
|
||||||
|
this.Tag= urlEnd;
|
||||||
string OAUrlAndEnd = string.Empty;
|
string OAUrlAndEnd = string.Empty;
|
||||||
if (!(PubBrowerModel.BetweenDLLCoid != null && PubBrowerModel.BetweenDLLCoid.StartsWith("http")) && !urlEnd.StartsWith("http"))
|
if (!(PubBrowerModel.BetweenDLLCoid != null && PubBrowerModel.BetweenDLLCoid.StartsWith("http")) && !urlEnd.StartsWith("http"))
|
||||||
{
|
{
|
||||||
@@ -150,4 +151,22 @@ namespace Lskj.PubBrower
|
|||||||
FrmSelectDownload frmSelectDownload = new FrmSelectDownload();
|
FrmSelectDownload frmSelectDownload = new FrmSelectDownload();
|
||||||
frmSelectDownload.URL = URL;
|
frmSelectDownload.URL = URL;
|
||||||
frmSelectDownload.FileName = FileName;
|
frmSelectDownload.FileName = FileName;
|
||||||
frmSelectDownload.isBatchDownLoad = isBa
|
frmSelectDownload.isBatchDownLoad = isBatchBrower;
|
||||||
|
// frmSelectDownload.TopMost = true;
|
||||||
|
frmSelectDownload.ShowDialog();
|
||||||
|
//SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||||
|
//saveFileDialog.FileName = FileName;
|
||||||
|
//saveFileDialog.Title = "下载模板文件到";
|
||||||
|
//saveFileDialog.RestoreDirectory = true;
|
||||||
|
////点了保存按钮进入
|
||||||
|
//if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
//{
|
||||||
|
// string localFilePath = System.IO.Path.GetFullPath(saveFileDialog.FileName);//获得文件路径,含文件名
|
||||||
|
// string fileNameExt = localFilePath.Substring(localFilePath.LastIndexOf("\\") + 1);//获取文件名,不带路径
|
||||||
|
// string FilePath = localFilePath.Substring(0, localFilePath.LastIndexOf("\\"));//获取文件路径,不带文件名
|
||||||
|
// FrmDownload frm = new FrmDownload(URL, FileName, localFilePath);
|
||||||
|
// frm.Show();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Lskj.Control.Model;
|
|||||||
using Lskj.Business.Impl;
|
using Lskj.Business.Impl;
|
||||||
using Lskj.Util;
|
using Lskj.Util;
|
||||||
using Lskj.Data;
|
using Lskj.Data;
|
||||||
|
using DevExpress.XtraEditors;
|
||||||
|
|
||||||
namespace Lskj.PubChart
|
namespace Lskj.PubChart
|
||||||
{
|
{
|
||||||
@@ -40,6 +40,8 @@ namespace Lskj.PubChart
|
|||||||
/// 数据源
|
/// 数据源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private DataTable dtData;
|
private DataTable dtData;
|
||||||
|
//是否初始化完成
|
||||||
|
public bool _isInitFinish = false;
|
||||||
public FrmMain()
|
public FrmMain()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -67,10 +69,14 @@ namespace Lskj.PubChart
|
|||||||
this.SearchObj.OnSearchAfterCallBack += new EventHandler(OnSearchAfter);
|
this.SearchObj.OnSearchAfterCallBack += new EventHandler(OnSearchAfter);
|
||||||
DataTable gridColumn = BaseModuleImpl.GetBaseGridColumns(this.PubchartModel.ModuleCode);
|
DataTable gridColumn = BaseModuleImpl.GetBaseGridColumns(this.PubchartModel.ModuleCode);
|
||||||
this.chartControlEx.PanelControlObj.Visible = true;
|
this.chartControlEx.PanelControlObj.Visible = true;
|
||||||
|
this.chartControlEx.SplitMain.PanelVisibility = SplitPanelVisibility.Both;//初始化时默认隐藏
|
||||||
|
|
||||||
this.chartControlEx.GridControlObj.GridView.OptionsView.ColumnAutoWidth = true;
|
this.chartControlEx.GridControlObj.GridView.OptionsView.ColumnAutoWidth = true;
|
||||||
this.chartControlEx.GridControlObj.SetEditColumns(gridColumn);
|
this.chartControlEx.GridControlObj.SetEditColumns(gridColumn);
|
||||||
this.chartControlEx.GridControlObj.gridControl.DataSource = dtData;
|
this.chartControlEx.GridControlObj.gridControl.DataSource = dtData;
|
||||||
this.chartControlEx.SetCharts(BaseModuleImpl.GetChartParams(SysModel.FormKey));
|
this.chartControlEx.SetCharts(BaseModuleImpl.GetChartParams(SysModel.FormKey));
|
||||||
|
|
||||||
|
this.chartControlEx.SplitMain.SplitterMoved += new System.EventHandler(this.OnTopSplitterMoved);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -81,6 +87,7 @@ namespace Lskj.PubChart
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
this.InitializeSplitterPosition();
|
||||||
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
||||||
this.chartControlEx.Visible = true;
|
this.chartControlEx.Visible = true;
|
||||||
}
|
}
|
||||||
@@ -111,5 +118,10 @@ namespace Lskj.PubChart
|
|||||||
MessageUtil.Show(Message,ex.Message);
|
MessageUtil.Show(Message,ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
//分割条改变时
|
||||||
|
private void OnTopSplitterMoved(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (this._isInitFinish)// 是否为初始化创建
|
||||||
|
|
||||||
@@ -26,6 +26,18 @@ namespace Lskj.PubPrint
|
|||||||
{
|
{
|
||||||
public Form1()
|
public Form1()
|
||||||
{
|
{
|
||||||
|
string DataServerText = ini.IniReadValue("刷新时间", "Server");
|
||||||
|
string DataNameText = ini.IniReadValue("刷新时间", "Database");
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(DataServerText) && !string.IsNullOrWhiteSpace(DataNameText))
|
||||||
|
{
|
||||||
|
DBConfig.Instance.ServerName = DataServerText;
|
||||||
|
DBConfig.Instance.DataBase = DataNameText;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (DBConfig.Instance.CreateConnection())
|
if (DBConfig.Instance.CreateConnection())
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -276,7 +288,6 @@ namespace Lskj.PubPrint
|
|||||||
System.Environment.Exit(0);
|
System.Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (DBConfig.Instance.CreateConnection())
|
if (DBConfig.Instance.CreateConnection())
|
||||||
{
|
{
|
||||||
string ip = string.Empty;
|
string ip = string.Empty;
|
||||||
@@ -286,7 +297,7 @@ namespace Lskj.PubPrint
|
|||||||
//解析主机名称或IP地址的system.net.iphostentry实例。
|
//解析主机名称或IP地址的system.net.iphostentry实例。
|
||||||
//IPHostEntry localhost = Dns.GetHostEntry(hostname);
|
//IPHostEntry localhost = Dns.GetHostEntry(hostname);
|
||||||
ip = ERPInfo.Instance.LoginIP;
|
ip = ERPInfo.Instance.LoginIP;
|
||||||
//hostname = "PC-20210908GGIV";
|
//hostname = "shuanghe-kailian";
|
||||||
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemComputerTab where ComputerName='{0}'", hostname));
|
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemComputerTab where ComputerName='{0}'", hostname));
|
||||||
|
|
||||||
//foreach (string ss in PrinterSettings.InstalledPrinters)
|
//foreach (string ss in PrinterSettings.InstalledPrinters)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.Windows.Forms;
|
|||||||
using Lskj.Model;
|
using Lskj.Model;
|
||||||
using Lskj.Business.Impl;
|
using Lskj.Business.Impl;
|
||||||
using Lskj.Control;
|
using Lskj.Control;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
namespace Lskj.Report
|
namespace Lskj.Report
|
||||||
{
|
{
|
||||||
@@ -25,54 +26,12 @@ namespace Lskj.Report
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DynamicReportModel reportModel = new DynamicReportModel(obj);
|
|
||||||
|
|
||||||
//int formType = ReportImpl.GetBaseType(reportModel.ModuleCode);
|
|
||||||
|
|
||||||
GridEnum gridEnum = GridEnum.GridView;
|
|
||||||
//if (formType == 1) gridEnum = GridEnum.BandedGridView;
|
|
||||||
//if (formType == 2) gridEnum = GridEnum.TreeListGridView;
|
|
||||||
|
|
||||||
FrmMain mainForm = new FrmMain();
|
FrmMain mainForm = new FrmMain();
|
||||||
//mainForm.Model = reportModel;
|
DynamicReportModel reportModel = new DynamicReportModel(obj);
|
||||||
//mainForm.Model.GridEnumObj = gridEnum;
|
mainForm.Model = reportModel;
|
||||||
//this.SubForm = mainForm;
|
reportModel.DataCaches = new Dictionary<object, Hashtable>();
|
||||||
|
if (SystemInfo.Instance.OptimizationSpeed) mainForm.GetDataCaches(reportModel.DataCaches);
|
||||||
|
GridEnum gridEnum = GridEnum.GridView;
|
||||||
|
|
||||||
//判断是否存在存储过程
|
|
||||||
string results = BaseImpl.GetResult("IF EXISTS(SELECT *FROM SYSOBJECTS WHERE NAME ='p_Get_NewDesignPlatform_BasicFile' AND TYPE = 'P') begin select 1 end else Begin select 2 end").ToString();
|
if (!reportModel.DataCaches.GetValu
|
||||||
if (results.Equals("1") && SystemInfo.Instance.isExecload) {
|
|
||||||
int formType;
|
|
||||||
int _errCode;
|
|
||||||
System.Data.DataSet dsConfig = ReportImpl.GetNewDesignPlatform(reportModel.ModuleId, reportModel.ModuleCode, Lskj.Data.ResourceKeys.SettingTableName, out formType, out _errCode);
|
|
||||||
Lskj.Data.Caches.CacheSYSConfig.Instance().BaseType = formType;
|
|
||||||
Lskj.Data.Caches.CacheSYSConfig.Instance().ErrCode = _errCode;
|
|
||||||
Lskj.Data.Caches.CacheSYSConfig.Instance().SetData(dsConfig);
|
|
||||||
if (formType == 1) gridEnum = GridEnum.BandedGridView;
|
|
||||||
if (formType == 2) gridEnum = GridEnum.TreeListGridView; // 基础档案暂时注释GridEnum.TreeListGridView此类型,TrcReport和手机端显示卡片冲突.
|
|
||||||
mainForm.Model = reportModel;
|
|
||||||
mainForm.Model.GridEnumObj = gridEnum;
|
|
||||||
this.SubForm = mainForm;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int formType = ReportImpl.GetBaseType(reportModel.ModuleCode);
|
|
||||||
if (formType == 1) gridEnum = GridEnum.BandedGridView;
|
|
||||||
if (formType == 2) gridEnum = GridEnum.TreeListGridView;
|
|
||||||
mainForm.Model = reportModel;
|
|
||||||
mainForm.Model.GridEnumObj = gridEnum;
|
|
||||||
this.SubForm = mainForm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageUtil.Show(ex);
|
|
||||||
LogHelper.Instance.WriteError(ex);
|
|
||||||
LogUtil.WriteError("Lskj.Report.dll--参数错误-->" + obj.ToString(), ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 窗口
|
|
||||||
/// </summary>
|
|
||||||
public Form SubForm { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+55
-16
@@ -22,6 +22,8 @@ using Lskj.Util;
|
|||||||
using Lskj.Data;
|
using Lskj.Data;
|
||||||
using Lskj.Business.Impl;
|
using Lskj.Business.Impl;
|
||||||
using Lskj.Business;
|
using Lskj.Business;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
namespace Lskj.Report
|
namespace Lskj.Report
|
||||||
{
|
{
|
||||||
@@ -52,11 +54,19 @@ namespace Lskj.Report
|
|||||||
WaitForm.ShowForm();
|
WaitForm.ShowForm();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Dictionary<object, Hashtable> dataCaches = Model != null ? Model.DataCaches : null;
|
||||||
this.Model.Privilege = this.Model.Privilege.Equals("3") ? "1" : Model.ModuleId > 0 ? BaseImpl.GetUserPurviewsByMenuId(Model.ModuleId + "") + "" : BaseImpl.GetUserPurviewsByMenuCode(Model.ModuleCode) + "";
|
this.Model.Privilege = this.Model.Privilege.Equals("3") ? "1" : Model.ModuleId > 0 ? BaseImpl.GetUserPurviewsByMenuId(Model.ModuleId + "") + "" : BaseImpl.GetUserPurviewsByMenuCode(Model.ModuleCode) + "";
|
||||||
|
|
||||||
this.mControl.ModuleGridDetailObj.ModuleGridObj.VisibleOperPanel = false;
|
this.mControl.ModuleGridDetailObj.ModuleGridObj.VisibleOperPanel = false;
|
||||||
this.mControl.Details = GetReportDetails();
|
|
||||||
|
if (!dataCaches.GetValue(this, "Details", out List<GridDetailModel> details))
|
||||||
|
{
|
||||||
|
details = GetReportDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mControl.Details = details;
|
||||||
this.mControl.InitControls(Model);
|
this.mControl.InitControls(Model);
|
||||||
|
this.FormClosing += new FormClosingEventHandler(OnClose);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -74,6 +84,11 @@ namespace Lskj.Report
|
|||||||
WaitForm.HideForm();
|
WaitForm.HideForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnClose(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
this.mControl.CloseModule();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>说明:获取报表明细</para>
|
/// <para>说明:获取报表明细</para>
|
||||||
/// <para>创建人:龚宇超</para>
|
/// <para>创建人:龚宇超</para>
|
||||||
@@ -87,29 +102,53 @@ namespace Lskj.Report
|
|||||||
private List<GridDetailModel> GetReportDetails()
|
private List<GridDetailModel> GetReportDetails()
|
||||||
{
|
{
|
||||||
List<GridDetailModel> details = new List<GridDetailModel>();
|
List<GridDetailModel> details = new List<GridDetailModel>();
|
||||||
bool ProcessExists = (Lskj.Data.Caches.CacheSYSConfig.Instance().JudgeProcessExists()&&SystemInfo.Instance.isExecload);
|
|
||||||
|
|
||||||
if (ProcessExists)
|
|
||||||
{
|
|
||||||
DataTable table = Lskj.Data.Caches.CacheSYSConfig.Instance().GetBaseDetailPages();
|
|
||||||
foreach (DataRow item in table.Rows)
|
|
||||||
{
|
|
||||||
DataTable gridColumns = Lskj.Data.Caches.CacheSYSConfig.Instance().GetReportDetailColumns(item["id"] + "");
|
|
||||||
details.Add(new GridDetailModel(item, gridColumns, GridCustomColumnStruct.BaseDetailGridView));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
DataTable table = ReportImpl.GetReportDetailPages(Model.ModuleCode);
|
DataTable table = ReportImpl.GetReportDetailPages(Model.ModuleCode);
|
||||||
foreach (DataRow item in table.Rows)
|
foreach (DataRow item in table.Rows)
|
||||||
{
|
{
|
||||||
DataTable gridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");
|
DataTable gridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");
|
||||||
details.Add(new GridDetailModel(item, gridColumns, GridCustomColumnStruct.BaseDetailGridView));
|
details.Add(new GridDetailModel(item, gridColumns, GridCustomColumnStruct.BaseDetailGridView));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return details;
|
return details;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取数据源缓存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cachesDic"></param>
|
||||||
|
public void GetDataCaches(Dictionary<object, Hashtable> cachesDic)
|
||||||
|
{
|
||||||
|
//全局数据
|
||||||
|
Task<DynamicModel> dynamicModelTask = cachesDic.AddTask(this, "DynamicModel", new Task<DynamicModel>(() =>
|
||||||
|
{
|
||||||
|
return Model;//动态链接库对象
|
||||||
|
}));
|
||||||
|
Task<DataRow> systemDllRowTask = cachesDic.AddTask(this, "SystemDllRow", new Task<DataRow>(() =>
|
||||||
|
{
|
||||||
|
return MainImpl.GetSystemdllTab(Model.ModuleCode);//获取单个模块信息
|
||||||
|
}));
|
||||||
|
Task<ModuleModel> sysModelTask = cachesDic.AddTask(this, "SysModel", new Task<ModuleModel>(() =>
|
||||||
|
{
|
||||||
|
ModuleModel sysModel = new ModuleModel(systemDllRowTask.Result);
|
||||||
|
return sysModel;//系统模块实体对象
|
||||||
|
}));
|
||||||
|
Task<List<GridDetailModel>> detailTask = cachesDic.AddTask(this, "Details", new Task<List<GridDetailModel>>(() =>
|
||||||
|
{
|
||||||
|
DataTable detailPages = ReportImpl.GetReportDetailPages(Model.ModuleCode);//
|
||||||
|
List<GridDetailModel> details = new List<GridDetailModel>();//表格明细对象的集合
|
||||||
|
foreach (DataRow item in detailPages.Rows)
|
||||||
|
{
|
||||||
|
GridDetailModel gridDetailModel = new GridDetailModel(item, null, GridCustomColumnStruct.BaseDetailGridView);
|
||||||
|
details.Add(gridDetailModel);
|
||||||
|
Task<DataTable> addGridColumnsTask = cachesDic.AddTask(gridDetailModel, "GridColumns", new Task<DataTable>(() =>
|
||||||
|
{
|
||||||
|
DataTable gridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");//获取报表明细列
|
||||||
|
gridDetailModel.GridColumns = gridColumns;
|
||||||
|
return gridColumns;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
return details;
|
||||||
|
}));
|
||||||
|
Task<int> formTypeTask
|
||||||
@@ -2038,6 +2038,12 @@ namespace Lskj.SweepCode
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//页签中设置主表行(页签里可以设置主表行中的值为默认值)
|
||||||
|
if (_rowItem != null)
|
||||||
|
{
|
||||||
|
this.detailTab.SetMainRow(_rowItem);
|
||||||
|
}
|
||||||
|
|
||||||
IniAllControl(_rowItem, isFocus);
|
IniAllControl(_rowItem, isFocus);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -2381,32 +2387,4 @@ namespace Lskj.SweepCode
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <para>说明:明细分割条移动保存位置</para>
|
|
||||||
/// <para>创建人:龚宇超</para>
|
|
||||||
/// <para>创建日期:2018-03-06 </para>
|
|
||||||
/// <para>修改人:</para>
|
|
||||||
/// <para>修改日期:</para>
|
|
||||||
/// <para>修改备注:</para>
|
|
||||||
/// <para>版本:1.0</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender">The source of the event.</param>
|
|
||||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
||||||
private void OnDetailsSplitterMoved(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (this._isInitFinish)
|
|
||||||
{
|
|
||||||
SplitContainerControl splitContainerControl = sender as SplitContainerControl;
|
|
||||||
IniHelper.Write(string.Format("Step_splitLeftSide_{0}", this.SysModel.ModuleCode), splitContainerControl.SplitterPosition + "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -106,6 +106,22 @@ namespace Lskj.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 导出文件的文件路径
|
||||||
|
/// </summary>
|
||||||
|
public static string ExportFilePath
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string path = AbsolutelyPath + "TempFiles\\ExportFile/";
|
||||||
|
if (!Directory.Exists(path))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(path);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void ClearFilesInDirectory(string targetDir)
|
public static void ClearFilesInDirectory(string targetDir)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user