提交当前本机最新程序

This commit is contained in:
cyf
2026-07-16 16:05:38 +08:00
parent 43ae774164
commit 6be6607a40
47 changed files with 7895 additions and 811 deletions
+12 -4
View File
@@ -493,13 +493,21 @@ namespace Lskj.Control.Model
/// <summary>
/// 测试特殊搜索框返回id
/// 快速搜索框返回id(字典模式)
/// </summary>
public const int SpecialSearchBoxToId = 181;
public const int DictionarySearchBoxToId = 181;
/// <summary>
/// 测试特殊搜索框返回text
/// 快速搜索框返回text(字典模式)
/// </summary>
public const int SpecialSearchBoxToText = 182;
public const int DictionarySearchBoxToText = 182;
/// <summary>
/// 快速搜索框返回id 带参数(字典模式)
/// </summary>
public const int DictionarySearchBoxToIdParam = 183;
/// <summary>
/// 快速搜索框返回text 带参数(字典模式)
/// </summary>
public const int DictionarySearchBoxToTextParam = 184;
/// <summary>
/// <para>说明:是否为Value类型</para>
@@ -423,7 +423,10 @@ namespace Lskj.Control.Model
this._bandTitle = item.Table.Columns.Contains("bandTitle") ? item["bandTitle"] + "" : string.Empty;
this._bandFields = item.Table.Columns.Contains("bandFields") ? item["bandFields"] + "" : string.Empty;
this._fieldtype = item.Table.Columns.Contains("fieldsqltag") && !string.IsNullOrWhiteSpace(item["fieldsqltag"] + "") ? Convert.ToInt32(item["fieldsqltag"] + "") : 0;
//if (this._fieldtype == 5 || this._fieldtype == 15)
//{
// _fieldtype = 181;
//}
this._sqlSource = item.Table.Columns.Contains("fieldsql") && !string.IsNullOrWhiteSpace(item["fieldsql"] + "") ? item["fieldsql"] + "" : string.Empty;
this._valueMember = item.Table.Columns.Contains("fieldsqlid") && !string.IsNullOrWhiteSpace(item["fieldsqlid"] + "") ? item["fieldsqlid"] + "" : "dm";
this._textMember = item.Table.Columns.Contains("fieldsqlname") && !string.IsNullOrWhiteSpace(item["fieldsqlname"] + "") ? item["fieldsqlname"] + "" : "mc";
+12 -1
View File
@@ -3048,7 +3048,18 @@ namespace Lskj.Control.Model
/// <summary>
/// 快速导入
/// </summary>
/// <param name="gridView"></param>
/// <param name="SysModel"></param>
/// <param name="parmaryKey"></param>
/// <param name="leftField"></param>
/// <param name="leftValue"></param>
/// <param name="ImportReturnName"></param>
/// <param name="ImportReturnValue"></param>
/// <param name="ParentGridEx"></param>
/// <returns></returns>
public static bool QuickImport(this GridView gridView, ModuleModel SysModel, string parmaryKey, string leftField, string leftValue, List<string> ImportReturnName, List<string> ImportReturnValue, GridControlEx ParentGridEx = null)
{
OpenFileDialog dialog = new OpenFileDialog();
@@ -485,6 +485,12 @@ namespace Lskj.Control.Model
{
tipOnlyOne = false;
string prompt = ReplaceHelper.ReplaceRowParam(rowData, model.BeforeMsg);
if (model.Mergeexec)
{
//替换[],替换的是多选行中的数据
prompt = ReplaceHelper.ReplaceRowParam(rows, prompt.Replace("[", "{").Replace("]", "}"), "", "");
}
if (prompt.StartsWith("@") || prompt.StartsWith("!"))
{
prompt = BaseImpl.GetDefaultValue(prompt);
@@ -42,6 +42,14 @@ namespace Lskj.Control.Model
{
int[] mSelectRows = this._gridView.GetSelectedRows();
if (mSelectRows == null || mSelectRows.Length == 0) return;
DataRow[] dataRows = new DataRow[mSelectRows.Length];
for (int i = 0; i < mSelectRows.Length; i++)
{
dataRows[i] = this._gridView.GetDataRow(mSelectRows[i]);
}
DataRow mSelectRow = this._gridView.GetDataRow(mSelectRows[0]);
this._gridView.UpdateCurrentRow();
this._gridView.ShowEditor();
@@ -127,6 +135,13 @@ namespace Lskj.Control.Model
cond = _control.ReplaceParentControlValue(model.MenuCond);
}
cond = ReplaceHelper.ReplaceRowParam(selectRow, model.MenuCond);
if (model.Mergeexec&& cond.StartsWith("@"))
{
//替换[],替换的是多选行中的数据
cond = ReplaceHelper.ReplaceRowParam(dataRows, cond.Replace("[", "{").Replace("]", "}"), "", "");
}
if (this._gridView != null)
{
if (cells != null && cells.Length > 0 && cond.Contains("{COLUMN_"))
@@ -134,37 +134,69 @@ namespace Lskj.Control.Model.MenuStrip
{
try
{
string cond = string.Empty;
if (this._control != null)
cond = _control.ReplaceParentControlValue(model.MenuCond);
cond = ReplaceHelper.ReplaceRowParam(mSelectRow, model.MenuCond);
if (this._treeView != null)
bool condResult = false;
StringBuilder condBuilder = new StringBuilder();
StringBuilder sqlCondBuilder = new StringBuilder();
List<TreeListCell> cells = this._treeView != null ? this._treeView.GetSelectedCells() : null;
DataRow focusedRow = this.TreeGridControlObj.GetViewFocusedDataRow();
foreach (DataRow selectRow in mSelectRows)
{
List<TreeListCell> cells = this._treeView.GetSelectedCells();
if (selectRow == null) continue;
string cond = string.Empty;
if (this._control != null)
cond = _control.ReplaceParentControlValue(model.MenuCond);
cond = ReplaceHelper.ReplaceRowParam(selectRow, model.MenuCond);
if (model.Mergeexec && cond.StartsWith("@"))
{
//替换[],替换的是多选行中的数据
cond = ReplaceHelper.ReplaceRowParam(mSelectRows, cond.Replace("[", "{").Replace("]", "}"), "", "");
}
if (cells != null && cells.Count > 0 && cond.Contains("{COLUMN_"))
{
TreeListCell cell = cells[0];
DataRow focusedRow = this.BaseGridView.GetFocusedDataRow();
string colValue = focusedRow == null || !focusedRow.Table.Columns.Contains(cell.Column.Name) ? "" : focusedRow[cell.Column.Name] + "";
cond = cond.ReplaceColumnParam(cell.Column.Name, cell.Column.Caption, colValue);
}
}
if (ControlObj != null)
cond = ControlObj.ReplaceParentControlValue(cond);
//cms.Enabled = ReplaceHelper.EvalCond(cond);
if (ControlObj != null)
cond = ControlObj.ReplaceParentControlValue(cond);
if (cond.StartsWith("@"))
{
sqlCondBuilder.Append($"({cond.TrimStart('@')}) = '1' and ");
}
else
{
condBuilder.Append($"({cond}) and ");
}
}
string condStr = "";
if (model.MenuCond.StartsWith("@"))
{
condStr = $"@if({sqlCondBuilder.ToString().TrimEnd().TrimEnd('d', 'n', 'a')}) begin select '1' end else begin select '0' end";
}
else
{
condStr = condBuilder.ToString().TrimEnd().TrimEnd('d', 'n', 'a');
}
condResult = ValidateCond(condStr, null);
//cms.Enabled = ReplaceHelper.EvalCond(cond);
if (model.ForbiddenDisplay)
{
cms.Visible = ValidateCond(cond, null);
cms.Visible = condResult;
}
cms.Enabled = ValidateCond(cond, null); ;
cms.Enabled = condResult;
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(ResourceKeys.SetRightMenuCondFault + "\r\n" + Message);
e.Cancel = true;
break;
}
}
+8 -4
View File
@@ -26,6 +26,10 @@ namespace Lskj.Control
/// </summary>
public sealed class MessageUtil
{
public static string Prompt = string.IsNullOrWhiteSpace(SystemInfo.Instance.DeadlockPrompt) ? "网络连接超时,请稍候再试!" : SystemInfo.Instance.DeadlockPrompt;
/// <summary>
/// <para>说明:弹出Ok对话框</para>
/// <para>创建人:龚宇超</para>
@@ -51,7 +55,7 @@ namespace Lskj.Control
}
if (!string.IsNullOrEmpty(msg) && msg.Contains("与另一个进程被死锁在")&& !SystemInfo.Instance.PromptDeadlock)
msg = "网络连接超时,请稍候再试!";
msg = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
msg = Business.Impl.LanguageTranslation.GetTranslatedText(msg);
@@ -87,7 +91,7 @@ namespace Lskj.Control
if (!string.IsNullOrEmpty(errorMessage) && errorMessage.Contains("与另一个进程被死锁在") && !SystemInfo.Instance.PromptDeadlock)
{
errorMessage = "网络连接超时,请稍候再试!";
errorMessage = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
errorMessage = Business.Impl.LanguageTranslation.GetTranslatedText(errorMessage);
@@ -162,7 +166,7 @@ namespace Lskj.Control
{
string msg = ex == null ? ResourceKeys.UnKownErrorTip : ex.StackTrace;
if (!string.IsNullOrEmpty(msg) && msg.Contains("与另一个进程被死锁在") && !SystemInfo.Instance.PromptDeadlock)
msg = "网络连接超时,请稍候再试!";
msg = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
msg = Business.Impl.LanguageTranslation.GetTranslatedText(msg);
@@ -173,7 +177,7 @@ namespace Lskj.Control
{
string msg = ex == null ? ResourceKeys.UnKownErrorTip : ex.Message; //ResourceKeys.SystemErrorTip + "\r\n" + ex.Message + "\r\n" + ex.StackTrace;
if (!string.IsNullOrEmpty(msg) && msg.Contains("与另一个进程被死锁在") && !SystemInfo.Instance.PromptDeadlock)
msg = "网络连接超时,请稍候再试!";
msg = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
msg = Business.Impl.LanguageTranslation.GetTranslatedText(msg);
+63 -4
View File
@@ -1503,7 +1503,31 @@ namespace Lskj.Control.Model
// 下拉框
LabelComboxEdit comboxEdit = ctr as LabelComboxEdit;
comboxEdit.SetDataSource(table);
comboxEdit.TextEdit.SelectedIndex = 0;
if (comboxEdit.Isparameters)
{
List<string> condition = ReplaceHelper.GetParamFields(model.SourceSql);
foreach (string item in condition)
{
string filename = item.Trim('{', '}');
if (ParaContrlsDic.ContainsKey(filename))
{
if (!ParaContrlsDic[filename].Contains(model.FieldName))
{
ParaContrlsDic[filename].Add(model.FieldName);
}
}
else
{
ParaContrlsDic[filename] = new List<string>() { model.FieldName };
}
}
}
else
{
//默认选中第一个,如果设置了带参数,就不默认选中
comboxEdit.TextEdit.SelectedIndex = 0;
}
break;
case ControlType.LabAutoCompleteValue:
case ControlType.LabAutoCompleteText:
@@ -3829,6 +3853,7 @@ namespace Lskj.Control.Model
if (rowItem == null) return;
foreach (ControlModel model in this.ControlModels)
{
selectModel = model;
if (rowItem.Table.Columns.Contains(model.FieldName))
@@ -3859,6 +3884,8 @@ namespace Lskj.Control.Model
{
SetControlValue(model, "****");
}
}
}
catch (Exception ex)
@@ -4212,6 +4239,27 @@ namespace Lskj.Control.Model
model.FieldType = 161;
model.IsRadio = true;
}
//快速搜索框在控件中转成普通搜索框
if (model.FieldType == 181 || model.FieldType == 182 || model.FieldType == 183 || model.FieldType == 184)
{
switch (model.FieldType)
{
case ControlType.DictionarySearchBoxToId:
model.FieldType = 5;
break;
case ControlType.DictionarySearchBoxToText:
model.FieldType = 6;
break;
case ControlType.DictionarySearchBoxToIdParam:
model.FieldType = 15;
break;
case ControlType.DictionarySearchBoxToTextParam:
model.FieldType = 16;
break;
}
}
return model;
}
@@ -4340,6 +4388,13 @@ namespace Lskj.Control.Model
comboxEdit.ValueMember = ControlType.LabComboxValue == model.FieldType || ControlType.LabComboxValueParam == model.FieldType ? model.ValueMember : model.TextMember;
comboxEdit.ValueField = model.ValueMember;
comboxEdit.TextField = model.TextMember;
if (ControlType.LabComboxValueParam == model.FieldType || ControlType.LabComboxTextParam == model.FieldType)
{
comboxEdit.ControlObj = this;
comboxEdit.SourceSQL = model.SourceSql;
comboxEdit.Isparameters = true;
}
//comboxEdit.SetDataSource(dataSource);
// 假如为报表模式并且没有默认值,默认选择第一条记录
if (model.IsSearchControl && string.IsNullOrEmpty(model.DefaultValue))
@@ -5426,6 +5481,10 @@ namespace Lskj.Control.Model
{
labelAutoGridLook.HandPopupSqlValue(labelAutoGridLook.SourceSQL);
}
if (baseUserControl is LabelComboxEdit labelComboxEdit)
{
labelComboxEdit.RefreshData();
}
}
}
}
@@ -6415,10 +6474,10 @@ namespace Lskj.Control.Model
if (rowItem == null) return;
foreach (ControlModel model in this.ControlModels)
{
if (rowItem.Table.Columns.Contains(model.FieldName)&&!string.IsNullOrWhiteSpace(model.DefaultValue))
if (rowItem.Table.Columns.Contains(model.FieldName) && !string.IsNullOrWhiteSpace(model.DefaultValue))
{
string DefaultValue = ReplaceHelper.ReplaceUserInfo(model.DefaultValue);
if (!DefaultValue.Equals(rowItem[model.FieldName] + ""))
if (!DefaultValue.Equals(rowItem[model.FieldName] + ""))
{
BaseUserControl baseControl = FindControl(model.FieldName);
if (baseControl == null) continue;
@@ -6432,7 +6491,7 @@ namespace Lskj.Control.Model
// baseControl.ForeColor = ColorTranslator.FromHtml("#000000");
// baseControl.ContentBold = false;
//}
}
}
}
}
}
+50 -6
View File
@@ -124,12 +124,19 @@ namespace Lskj.Control.Model
form.IsMdiContainer = true;
form.WindowState = System.Windows.Forms.FormWindowState.Maximized;
design.ReportObj.Prepare();
design.ReportObj.Design(form);
design.ReportObj.Designer.BorderStyle = BorderStyle.None;
design.ReportObj.Designer.cmdPreview.CustomAction += OnCustomAction;
try
{
design.ReportObj.Prepare();
design.ReportObj.Design(form);
design.ReportObj.Designer.BorderStyle = BorderStyle.None;
design.ReportObj.Designer.cmdPreview.CustomAction += OnCustomAction;
form.ShowDialog();
form.ShowDialog();
}
finally
{
ReleaseFastReportDesignerResource(design);
}
}
}
@@ -156,13 +163,50 @@ namespace Lskj.Control.Model
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
design.ReportObj.Design();
if (design != null && design.ReportObj != null)
{
design.ReportObj.Design();
}
WaitForm.HideForm();
}
}
private static void ReleaseFastReportDesignerResource(FrmFastReportDesign design)
{
try
{
if (design != null && design.ReportObj != null && design.ReportObj.Designer != null)
{
try
{
design.ReportObj.Designer.StopAutoSave();
}
catch
{
}
try
{
design.ReportObj.Designer.cmdPreview.CustomAction -= OnCustomAction;
}
catch
{
}
}
if (design != null && design.ReportObj != null)
{
design.ReportObj.Dispose();
design.ReportObj = null;
}
}
catch
{
}
}
private static void OnCustomAction(object sender, EventArgs e)
{
FastReport.Design.StandardDesigner.DesignerControl design = sender as FastReport.Design.StandardDesigner.DesignerControl;