SVN r1089
SVN-Revision: r1089
This commit is contained in:
@@ -80,6 +80,30 @@ namespace Lskj.Control.Model
|
||||
|
||||
GridRightMenuModel model = new GridRightMenuModel(rowItem);
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(model.MenuCond))
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// string cond = ReplaceHelper.ReplaceUserInfo(model.MenuCond);
|
||||
// if (this._controlObj != null)
|
||||
// {
|
||||
// cond = _controlObj.ReplaceControlValue(model.MenuCond);
|
||||
// }
|
||||
// if (BaseGridView != null && BaseGridView.GetFocusedDataRow() != null)
|
||||
// {
|
||||
// DataRow parentitem = BaseGridView.GetFocusedDataRow();
|
||||
// cond = ReplaceHelper.ReplaceRowParam(parentitem, cond) + "";
|
||||
// }
|
||||
// bool result = ReplaceHelper.EvalCond(cond);
|
||||
// if (!result) return false;
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// MessageUtil.Show(ResourceKeys.SetRightMenuCondFault);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(model.BeforeMsg))
|
||||
{
|
||||
string prompt = this._controlObj.ReplaceControlValue(model.BeforeMsg);
|
||||
@@ -108,6 +132,12 @@ namespace Lskj.Control.Model
|
||||
if (applyArgs.CancelFlag) return false;
|
||||
|
||||
List<string> paramList = HandleRightMenuParams(model.ParamList);
|
||||
string maintabFocusedRowJson = "";
|
||||
if (BaseGridView != null && BaseGridView.GetFocusedDataRow() != null)
|
||||
{
|
||||
maintabFocusedRowJson = BaseGridView.GetFocusedDataRow().ToJsonObject(); // 假设 ToJsonObject() 是将对象转换为 JSON 字符串的方法
|
||||
}
|
||||
paramList.Add(maintabFocusedRowJson);
|
||||
string dllName = this._controlObj.ReplaceControlValue(model.DllName).Trim();
|
||||
if (BaseGridView != null && BaseGridView.GetFocusedDataRow() != null)
|
||||
{
|
||||
@@ -312,7 +342,7 @@ namespace Lskj.Control.Model
|
||||
default:
|
||||
if (ReturnStoredProcedureValue != null)
|
||||
{
|
||||
ReturnStoredProcedureValue(pMsg.Value+"");
|
||||
ReturnStoredProcedureValue(pMsg.Value + "");
|
||||
}
|
||||
MessageUtil.Show(ResourceKeys.OperSuccess);
|
||||
break;
|
||||
@@ -355,7 +385,7 @@ namespace Lskj.Control.Model
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
private bool ExecDynamicLinkLibary(GridRightMenuModel model, List<string> paramList, DataRow rowItem,string dllname)
|
||||
private bool ExecDynamicLinkLibary(GridRightMenuModel model, List<string> paramList, DataRow rowItem, string dllname)
|
||||
{
|
||||
issuccess = true;
|
||||
if (string.IsNullOrWhiteSpace(dllname))
|
||||
@@ -388,30 +418,33 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
default:
|
||||
List<string> str = new List<string>
|
||||
{
|
||||
_model.FormText,
|
||||
ERPInfo.Instance.UserId,
|
||||
ERPInfo.Instance.UserName,
|
||||
"3",
|
||||
_model.ModuleCode,
|
||||
paramList[0],
|
||||
paramList[1],
|
||||
paramList[2],
|
||||
paramList[3],
|
||||
paramList[4],
|
||||
paramList[5],
|
||||
paramList[6],
|
||||
paramList[7],
|
||||
paramList[8],
|
||||
paramList[9]
|
||||
};
|
||||
string maintabFocusedRowJson = "";
|
||||
if (BaseGridView != null && BaseGridView.GetFocusedDataRow() != null)
|
||||
{
|
||||
maintabFocusedRowJson = BaseGridView.GetFocusedDataRow().ToJsonObject(); // 假设 ToJsonObject() 是将对象转换为 JSON 字符串的方法
|
||||
}
|
||||
str.Add(maintabFocusedRowJson); // 现在可以添加元素了,因为 str 是 List<string>
|
||||
// 假设你需要将 List<string> 转回字符串数组,可以这样操作
|
||||
{
|
||||
_model.FormText,
|
||||
ERPInfo.Instance.UserId,
|
||||
ERPInfo.Instance.UserName,
|
||||
"3",
|
||||
_model.ModuleCode,
|
||||
paramList[0],
|
||||
paramList[1],
|
||||
paramList[2],
|
||||
paramList[3],
|
||||
paramList[4],
|
||||
paramList[5],
|
||||
paramList[6],
|
||||
paramList[7],
|
||||
paramList[8],
|
||||
paramList[9],
|
||||
paramList[10],
|
||||
paramList[11],
|
||||
paramList[12]//固定添加行数据json字符串
|
||||
};
|
||||
//string maintabFocusedRowJson = "";
|
||||
//if (BaseGridView != null && BaseGridView.GetFocusedDataRow() != null)
|
||||
//{
|
||||
// maintabFocusedRowJson = BaseGridView.GetFocusedDataRow().ToJsonObject(); // 假设 ToJsonObject() 是将对象转换为 JSON 字符串的方法
|
||||
//}
|
||||
//str.Add(maintabFocusedRowJson); // 现在可以添加元素了,因为 str 是 List<string>
|
||||
// // 假设你需要将 List<string> 转回字符串数组,可以这样操作
|
||||
string[] strArray = str.ToArray();
|
||||
IForm form = FormHelper.LoadDllForm(dllname, strArray);
|
||||
if (form == null)
|
||||
|
||||
@@ -188,6 +188,17 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public const int LabCheckAutoSeacherText = 26;
|
||||
|
||||
/// <summary>
|
||||
/// 自动搜索框(带复选框,带参数),保存Value值,显示Text值
|
||||
/// </summary>
|
||||
public const int LabAutoCompleteCheckParamValue = 215;
|
||||
/// <summary>
|
||||
/// 自动搜索框(带复选框,带参数),保存Text值,显示Text值
|
||||
/// </summary>
|
||||
public const int LabAutoCompleteCheckParamText = 216;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 计算器
|
||||
/// </summary>
|
||||
|
||||
@@ -49,6 +49,7 @@ using DevExpress.Data;
|
||||
using DevExpress.Data.Filtering;
|
||||
using System.Data.SqlClient;
|
||||
using DevExpress.Utils;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Lskj.Control.Model
|
||||
{
|
||||
@@ -472,11 +473,13 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "IfFixColumn"))
|
||||
DataTable dataTable = BaseImpl.GetTableColumns(ResourceKeys.SettingTableName);
|
||||
|
||||
if (!dataTable.Columns.Contains("IfFixColumn"))
|
||||
{
|
||||
BaseImpl.ExecSqlValue("alter table " + ResourceKeys.SettingTableName + " add IfFixColumn bit");
|
||||
}
|
||||
if (!BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "FieldText"))
|
||||
if (!dataTable.Columns.Contains("FieldText"))
|
||||
{
|
||||
BaseImpl.ExecSqlValue("alter table " + ResourceKeys.SettingTableName + " add FieldText varchar(100)");
|
||||
}
|
||||
@@ -488,20 +491,20 @@ namespace Lskj.Control.Model
|
||||
bool isDisplayFiltering = false;
|
||||
string saveFieldName = string.Empty;
|
||||
//分组号
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "GroupIndex"))
|
||||
if (dataTable.Columns.Contains("GroupIndex"))
|
||||
{
|
||||
isGroupIndex = true;
|
||||
saveFieldName = ",GroupIndex";
|
||||
|
||||
}
|
||||
//列筛选条件
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "FilterInfo"))
|
||||
if (dataTable.Columns.Contains("FilterInfo"))
|
||||
{
|
||||
isFilterInfo = true;
|
||||
saveFieldName += ",FilterInfo";
|
||||
}
|
||||
//是否显示筛选行
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "DisplayFiltering"))
|
||||
if (dataTable.Columns.Contains("DisplayFiltering"))
|
||||
{
|
||||
isDisplayFiltering = true;
|
||||
saveFieldName += ",DisplayFiltering";
|
||||
@@ -554,14 +557,18 @@ namespace Lskj.Control.Model
|
||||
public static bool UpdateCustomColumnToDatabase(this BandedGridView gridView, string key)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key)) return false;
|
||||
if (!BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "IfFixColumn"))
|
||||
|
||||
DataTable dataTable = BaseImpl.GetTableColumns(ResourceKeys.SettingTableName);
|
||||
|
||||
if (!dataTable.Columns.Contains("IfFixColumn"))
|
||||
{
|
||||
BaseImpl.ExecSqlValue("alter table " + ResourceKeys.SettingTableName + " add IfFixColumn bit");
|
||||
}
|
||||
if (!BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "FieldText"))
|
||||
if (!dataTable.Columns.Contains("FieldText"))
|
||||
{
|
||||
BaseImpl.ExecSqlValue("alter table " + ResourceKeys.SettingTableName + " add FieldText varchar(100)");
|
||||
}
|
||||
|
||||
string sqlValue = string.Format("select * from {0} where formKey='{1}' and OperatorId='{2}'", ResourceKeys.SettingTableName, key, ERPInfo.Instance.UserId);
|
||||
DataTable customTable = SqlHelper.ExecuteDataTable(sqlValue);
|
||||
StringBuilder sBuilder = new StringBuilder();
|
||||
@@ -584,7 +591,7 @@ namespace Lskj.Control.Model
|
||||
saveFieldName += ",FilterInfo";
|
||||
}
|
||||
//是否显示筛选行
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "DisplayFiltering"))
|
||||
if (customTable.Columns.Contains("DisplayFiltering"))
|
||||
{
|
||||
isDisplayFiltering = true;
|
||||
saveFieldName += ",DisplayFiltering";
|
||||
@@ -636,7 +643,9 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "IfFixColumn"))
|
||||
DataTable dataTable = BaseImpl.GetTableColumns(ResourceKeys.SettingTableName);
|
||||
|
||||
if (!dataTable.Columns.Contains("IfFixColumn"))
|
||||
{
|
||||
BaseImpl.ExecSqlValue("alter table " + ResourceKeys.SettingTableName + " add IfFixColumn bit");
|
||||
}
|
||||
@@ -648,20 +657,20 @@ namespace Lskj.Control.Model
|
||||
bool isDisplayFiltering = false;
|
||||
string saveFieldName = string.Empty;
|
||||
//分组号
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "GroupIndex"))
|
||||
if (dataTable.Columns.Contains("GroupIndex"))
|
||||
{
|
||||
isGroupIndex = true;
|
||||
saveFieldName = ",GroupIndex";
|
||||
|
||||
}
|
||||
//列筛选条件
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "FilterInfo"))
|
||||
if (dataTable.Columns.Contains("FilterInfo"))
|
||||
{
|
||||
isFilterInfo = true;
|
||||
saveFieldName += ",FilterInfo";
|
||||
}
|
||||
//是否显示筛选行
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "DisplayFiltering"))
|
||||
if (dataTable.Columns.Contains("DisplayFiltering"))
|
||||
{
|
||||
isDisplayFiltering = true;
|
||||
saveFieldName += ",DisplayFiltering";
|
||||
@@ -767,7 +776,7 @@ namespace Lskj.Control.Model
|
||||
saveFieldName += ",FilterInfo";
|
||||
}
|
||||
//是否显示筛选行
|
||||
if (BaseImpl.HasExistsColumn(ResourceKeys.SettingTableName, "DisplayFiltering"))
|
||||
if (customTable.Columns.Contains("DisplayFiltering"))
|
||||
{
|
||||
isDisplayFiltering = true;
|
||||
saveFieldName += ",DisplayFiltering";
|
||||
@@ -1436,7 +1445,6 @@ namespace Lskj.Control.Model
|
||||
//}
|
||||
|
||||
|
||||
|
||||
switch (fileExt)
|
||||
{
|
||||
case ".xls":
|
||||
@@ -1452,6 +1460,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
newControl.ExportToXls(dialog.FileName, xlsOptionsEx);
|
||||
//control.ExportToXls(dialog.FileName);
|
||||
}
|
||||
@@ -2043,7 +2052,8 @@ namespace Lskj.Control.Model
|
||||
/// <para>版本:1.0.0.3</para>
|
||||
/// </summary>
|
||||
/// <param name="colFields">The col fields.</param>
|
||||
public static DataTable ToExcelDataTable(this GridView gridView, string fileName, string colFields, bool isDirectImport = false, bool isBillImport = false)
|
||||
/// <param name="AutoImportCalMode">导入时是否触发关联计算(模块配置)</param>
|
||||
public static DataTable ToExcelDataTable(this GridView gridView, string fileName, string colFields, bool isDirectImport = false, bool isBillImport = false,bool AutoImportCalMode = false)
|
||||
{
|
||||
DataTable table = new DataTable();
|
||||
int index = gridView is BandedGridView ? 1 : 0;
|
||||
@@ -2054,7 +2064,6 @@ namespace Lskj.Control.Model
|
||||
int CurrentColumn = 0;//当前列数
|
||||
string columnName = string.Empty;//当前列名
|
||||
bool ToAssignment = false;//是否在给新表赋值
|
||||
|
||||
try
|
||||
{
|
||||
ISheet sheet = ExcelHelper.GetSheet(fileName);
|
||||
@@ -2130,7 +2139,8 @@ namespace Lskj.Control.Model
|
||||
if (colFields.IndexOf("lskjimport_errorFlag") != -1 && !table.Columns.Contains("lskjimport_errorFlag"))
|
||||
table.Columns.Add("lskjimport_errorFlag");
|
||||
|
||||
bool AutoImportCal = SystemInfo.Instance.AutoImportCal;//是否执行 关联和计算公式
|
||||
|
||||
bool AutoImportCal = SystemInfo.Instance.AutoImportCal|| AutoImportCalMode;//是否执行 关联和计算公式
|
||||
//bool ImportDefaultValue= SystemInfo.Instance.ImportDefaultValue;//是否为空单元格添加默认值
|
||||
//bool isImportRows = true;//是否是导入行(如果是合计行就不触发默认值)
|
||||
// 添加行
|
||||
@@ -2239,8 +2249,8 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
else
|
||||
{
|
||||
dataRow[col.FieldName] = cell.NumericCellValue;
|
||||
|
||||
string customFormattedValue = string.Format("{0:" + "#################0.#################" + "}", cell.NumericCellValue);
|
||||
dataRow[col.FieldName] = customFormattedValue;
|
||||
if (AutoImportCal)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(model.UnionFields))
|
||||
@@ -2410,7 +2420,7 @@ namespace Lskj.Control.Model
|
||||
catch (IOException exe)
|
||||
{
|
||||
//string Message = ErrorMessage.PromptErrorMessage(exe);
|
||||
//MessageUtil.Show(Message, exe.Message);
|
||||
//MessageUtil.Show(exe.Message);
|
||||
MessageUtil.Show(string.Format(ResourceKeys.UseingFile, Path.GetFileName(fileName)));
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -2435,7 +2445,8 @@ namespace Lskj.Control.Model
|
||||
/// <para>版本:1.0.0.3</para>
|
||||
/// </summary>
|
||||
/// <param name="colFields">The col fields.</param>
|
||||
public static DataTable ToExcelTreeDataTable(this TreeList treeList, string fileName, string colFields, bool isDirectImport = false, bool isBillImport = false)
|
||||
/// <param name="AutoImportCalMode">导入时是否触发关联计算(模块配置)</param>
|
||||
public static DataTable ToExcelTreeDataTable(this TreeList treeList, string fileName, string colFields, bool isDirectImport = false, bool isBillImport = false, bool AutoImportCalMode = false)
|
||||
{
|
||||
DataTable table = new DataTable();
|
||||
isBillImport = isBillImport;
|
||||
@@ -2495,7 +2506,7 @@ namespace Lskj.Control.Model
|
||||
if (colFields.IndexOf("lskjimport_errorFlag") != -1 && !table.Columns.Contains("lskjimport_errorFlag"))
|
||||
table.Columns.Add("lskjimport_errorFlag");
|
||||
|
||||
bool AutoImportCal = SystemInfo.Instance.AutoImportCal;//是否执行 计算公式
|
||||
bool AutoImportCal = SystemInfo.Instance.AutoImportCal|| AutoImportCalMode;//是否执行 计算公式
|
||||
//bool ImportDefaultValue= SystemInfo.Instance.ImportDefaultValue;//是否为空单元格添加默认值
|
||||
//bool isImportRows = true;//是否是导入行(如果是合计行就不触发默认值)
|
||||
// 添加行
|
||||
@@ -2846,7 +2857,7 @@ namespace Lskj.Control.Model
|
||||
|
||||
string fileName = dialog.FileName;
|
||||
string colFields = gridControlEx.GridView.Columns.ToString(',');
|
||||
ImportTable = gridControlEx.GridView.ToExcelDataTable(fileName, colFields, true);
|
||||
ImportTable = gridControlEx.GridView.ToExcelDataTable(fileName, colFields, true,false, SysModel.AutoImportCalMode);
|
||||
|
||||
|
||||
if (ImportTable == null && ImportTable.Rows.Count < 1)
|
||||
@@ -2948,8 +2959,11 @@ namespace Lskj.Control.Model
|
||||
try
|
||||
{
|
||||
string sql = "select * from " + SysModel.MenuTable + " where 1<>1";
|
||||
SqlDataAdapter dat = BaseImpl.GetAdapterResult(sql);
|
||||
SqlCommandBuilder scb = new SqlCommandBuilder(dat);
|
||||
|
||||
DbDataAdapter dat = BaseImpl.GetAdapterResult(sql);
|
||||
DbCommandBuilder cb = SqlHelper.dbFactory.CreateCommandBuilder();
|
||||
cb.DataAdapter = dat;
|
||||
// SqlCommandBuilder scb = new SqlCommandBuilder(dat);
|
||||
DataTable datatb = new DataTable();
|
||||
DataTable failedData = new DataTable();
|
||||
dat.Fill(datatb);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
******************************/
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.Utils.Menu;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraGrid.Views.Base;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraTab;
|
||||
@@ -97,7 +98,24 @@ namespace Lskj.Control.Model
|
||||
this.Model = model;
|
||||
this.ControlObj = control;
|
||||
|
||||
if ((table == null || table.Rows.Count == 0) && menu == null) return;
|
||||
//判断是否存在网址框(需要绑定右键打开事件判断是否生成 网址框右键)
|
||||
bool existLabWWW = false;
|
||||
if (view is GridControlEx)
|
||||
{
|
||||
GridControlEx grid= view as GridControlEx;
|
||||
foreach (GridColumn item in grid.GridView.Columns)
|
||||
{
|
||||
if (item.Tag is GridColumnModel)
|
||||
{
|
||||
GridColumnModel gridColumnModel = item.Tag as GridColumnModel;
|
||||
if (gridColumnModel.FieldType == ControlType.LabWWW) existLabWWW = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (((table == null || table.Rows.Count == 0) && menu == null)&& !existLabWWW) return;
|
||||
|
||||
ContextMenuStrip cmsMenu = new ContextMenuStrip();
|
||||
cmsMenu.Opening += new CancelEventHandler(MenuStripOpening);
|
||||
@@ -618,14 +636,32 @@ namespace Lskj.Control.Model
|
||||
|
||||
public bool OpenFrmcCover(GridRightMenuModel model, List<string> paramList)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(paramList[1]) || string.IsNullOrWhiteSpace(paramList[2]))
|
||||
|
||||
bool importIntoDatabase = false;
|
||||
if (string.IsNullOrWhiteSpace(paramList[0]) || paramList[0] + "" == "0")
|
||||
{
|
||||
MessageUtil.Show("模块编号或主键名称未配置");
|
||||
return false;
|
||||
//模式1,把导入的数据反写到主界面上
|
||||
if (string.IsNullOrWhiteSpace(paramList[1]) || string.IsNullOrWhiteSpace(paramList[2]))
|
||||
{
|
||||
MessageUtil.Show("模块编号或主键名称未配置");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//模式2,保存到数据库中,在执行保存后sql
|
||||
importIntoDatabase = true;
|
||||
if (string.IsNullOrWhiteSpace(paramList[1]) )
|
||||
{
|
||||
MessageUtil.Show("模块编号未配置");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string primaryKey = paramList[2];
|
||||
FrmCover frmCover = new FrmCover(paramList[1], paramList[2]);
|
||||
if (frmCover.ShowDialog() == DialogResult.OK)
|
||||
FrmCover frmCover = new FrmCover(importIntoDatabase,paramList[1], paramList[2], paramList[3]);
|
||||
if (frmCover.ShowDialog() == DialogResult.OK&& !importIntoDatabase)
|
||||
{
|
||||
//反写数据源
|
||||
DataTable ReverseData = frmCover.ReverseData;
|
||||
|
||||
@@ -72,14 +72,9 @@ namespace Lskj.Control.Model
|
||||
mQQArray.Add(item);
|
||||
}
|
||||
|
||||
if (model.FieldType == ControlType.LabWWW &&
|
||||
(rowValue.StartsWith("www.") ||
|
||||
rowValue.StartsWith("http://") ||
|
||||
rowValue.StartsWith("https://") ||
|
||||
rowValue.StartsWith("ftp://") ||
|
||||
rowValue.StartsWith("file://")))
|
||||
if (model.FieldType == ControlType.LabWWW && !string.IsNullOrWhiteSpace(rowValue))
|
||||
{
|
||||
ToolStripMenuItem item = new ToolStripMenuItem("(" + column.Caption + ")" + rowValue, Resources.qq);
|
||||
ToolStripMenuItem item = new ToolStripMenuItem("(" + column.Caption + ")" + rowValue, Resources.www);
|
||||
item.Tag = mSelectRow[column.Name] + "";
|
||||
item.Click += new EventHandler(BrowerItemClick);
|
||||
mBrowerArray.Add(item);
|
||||
|
||||
@@ -236,6 +236,10 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ModuleResultDic = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// 带参数控件修改数据源字典
|
||||
/// </summary>
|
||||
public Dictionary<string, List<string>> ParaContrlsDic = new Dictionary<string, List<string>>();
|
||||
/// <summary>
|
||||
/// 控件值改变动态刷新表格列
|
||||
/// </summary>
|
||||
public event KeyEventHandler OnDataFileRefrshCallBack;
|
||||
@@ -1459,7 +1463,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
DataTable table = new DataTable();
|
||||
|
||||
if ((!ControlType.IsNotLoadData(model.FieldType)|| model.ModuleFrameDisplayText && (model.FieldType == 160|| model.FieldType == 161)) && model.FieldType != ControlType.LabTreeType)
|
||||
if ((!ControlType.IsNotLoadData(model.FieldType) || model.ModuleFrameDisplayText && (model.FieldType == 160 || model.FieldType == 161)) && model.FieldType != ControlType.LabTreeType)
|
||||
{
|
||||
if (mControlSourceDic.ContainsKey(model))
|
||||
{
|
||||
@@ -1528,6 +1532,25 @@ namespace Lskj.Control.Model
|
||||
// 智能搜索框
|
||||
LabelAutoGridLook autoiGridEdit = ctr as LabelAutoGridLook;
|
||||
autoiGridEdit.SetDataSource(table);
|
||||
if (autoiGridEdit.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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ControlType.LabMultiSelectText:
|
||||
case ControlType.LabMultiSelectTextNew:
|
||||
@@ -1561,6 +1584,8 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
case ControlType.LabCheckAutoSeacherValue:
|
||||
case ControlType.LabCheckAutoSeacherText:
|
||||
case ControlType.LabAutoCompleteCheckParamValue:
|
||||
case ControlType.LabAutoCompleteCheckParamText:
|
||||
// 带复选框自动搜索框
|
||||
LabelCheckAutoTextEdit checkAutoTextEdit = ctr as LabelCheckAutoTextEdit;
|
||||
checkAutoTextEdit.AutoTextEdit.SetDataSource(table);
|
||||
@@ -1573,7 +1598,7 @@ namespace Lskj.Control.Model
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
LabelMultiAutoTextEdit4 moduleReturnsIdnew = ctr as LabelMultiAutoTextEdit4;
|
||||
moduleReturnsIdnew.DataSource=table;
|
||||
moduleReturnsIdnew.DataSource = table;
|
||||
break;
|
||||
case ControlType.DynamicallyGeneratedSql:
|
||||
LabelMultiAutoTextEdit3 moduleSqlGenerated = ctr as LabelMultiAutoTextEdit3;
|
||||
@@ -1711,7 +1736,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
else if (model.FieldName.EndsWith("operatedate", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
controlValue = SqlHelper.ExecuteScalar("select getdate()")+"";//DateTime.Now.ToString();
|
||||
controlValue = SqlHelper.ExecuteScalar("select getdate()") + "";//DateTime.Now.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2095,6 +2120,8 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
case ControlType.LabCheckAutoSeacherValue:
|
||||
case ControlType.LabCheckAutoSeacherText:
|
||||
case ControlType.LabAutoCompleteCheckParamValue:
|
||||
case ControlType.LabAutoCompleteCheckParamText:
|
||||
// 带复选框自动搜索框
|
||||
LabelCheckAutoTextEdit checkAutoTextEdit = ctr as LabelCheckAutoTextEdit;
|
||||
if (checkAutoTextEdit.CheckEdit.Checked)
|
||||
@@ -2130,7 +2157,7 @@ namespace Lskj.Control.Model
|
||||
//数字编辑框
|
||||
case ControlType.LabTextInt:
|
||||
LabelTextEdit textIntEdit = ctr as LabelTextEdit;
|
||||
if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText;
|
||||
if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText.Replace(",", "");
|
||||
break;
|
||||
case ControlType.LabComboxPopupValue:
|
||||
case ControlType.LabComboxPopupText:
|
||||
@@ -3533,6 +3560,10 @@ namespace Lskj.Control.Model
|
||||
if (baseControl is LabelImageEdit)
|
||||
{
|
||||
LabelImageEdit imageEdit = baseControl as LabelImageEdit;
|
||||
if (imageEdit.TextEdit.Image != null)
|
||||
{
|
||||
imageEdit.TextEdit.Image.Dispose();
|
||||
}
|
||||
imageEdit.LoadImage(controlValue + "");
|
||||
}
|
||||
else if (baseControl is LabelPictureEdit)
|
||||
@@ -3915,7 +3946,7 @@ namespace Lskj.Control.Model
|
||||
foreach (DataRow item in _schemes.Rows)
|
||||
{
|
||||
BarButtonItem bbi_item = new BarButtonItem();
|
||||
bbi_item.Caption = item["ProjectName"] + "";
|
||||
bbi_item.Caption = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText(item["ProjectName"] + "") : item["ProjectName"] + "";
|
||||
bbi_item.Tag = item["SearchValue"] + "";
|
||||
bbi_item.ItemClick += new ItemClickEventHandler(OnPopupItemClick);
|
||||
|
||||
@@ -3923,11 +3954,11 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
|
||||
BarButtonItem bbi_save = new BarButtonItem();
|
||||
bbi_save.Caption = "保存方案";
|
||||
bbi_save.Caption = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("保存方案") : "保存方案";
|
||||
bbi_save.ItemClick += new ItemClickEventHandler(OnPopupSaveItemClick);
|
||||
|
||||
BarButtonItem bbi_manager = new BarButtonItem();
|
||||
bbi_manager.Caption = "方案管理";
|
||||
bbi_manager.Caption = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("方案管理") : "方案管理";
|
||||
bbi_manager.ItemClick += new ItemClickEventHandler(OnPopupManagerItemClick);
|
||||
|
||||
_popupMenu.AddItem(bbi_save);
|
||||
@@ -4417,6 +4448,8 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
case ControlType.LabCheckAutoSeacherValue:
|
||||
case ControlType.LabCheckAutoSeacherText:
|
||||
case ControlType.LabAutoCompleteCheckParamValue:
|
||||
case ControlType.LabAutoCompleteCheckParamText:
|
||||
// 带复选框自动搜索框
|
||||
LabelCheckAutoTextEdit checkAutoTextEdit = new LabelCheckAutoTextEdit();
|
||||
checkAutoTextEdit.clickAfterEmpty = model.clickAfterEmpty;
|
||||
@@ -4424,6 +4457,7 @@ namespace Lskj.Control.Model
|
||||
checkAutoTextEdit.AutoTextEdit.ValueField = model.ValueMember;
|
||||
checkAutoTextEdit.AutoTextEdit.TextField = model.TextMember;
|
||||
//checkAutoTextEdit.AutoTextEdit.SetDataSource(dataSource);
|
||||
if(ControlType.LabAutoCompleteCheckParamValue == model.FieldType || ControlType.LabAutoCompleteCheckParamText == model.FieldType) checkAutoTextEdit.TextEdit.ControlObj = this;
|
||||
|
||||
checkAutoTextEdit.TextEdit.SourceSQL = model.SourceSql;
|
||||
checkAutoTextEdit.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
|
||||
@@ -4631,7 +4665,7 @@ namespace Lskj.Control.Model
|
||||
billSourceComboxEdit.OpenDocumentSource += new EventHandler(OpenDocumentSource);
|
||||
|
||||
billSourceComboxEdit.clickAfterEmpty = model.clickAfterEmpty;
|
||||
billSourceComboxEdit.ValueMember =model.ValueMember;
|
||||
billSourceComboxEdit.ValueMember = model.ValueMember;
|
||||
billSourceComboxEdit.ValueField = model.ValueMember;
|
||||
billSourceComboxEdit.TextField = model.TextMember;
|
||||
billSourceComboxEdit.FormKey = model.FieldName + "_" + model.FormKey;
|
||||
@@ -4658,6 +4692,7 @@ namespace Lskj.Control.Model
|
||||
LabelTextEdit textEdit = new LabelTextEdit();
|
||||
if (model.FieldType == ControlType.LabTextInt)
|
||||
{
|
||||
textEdit.TextEdit.Tag = model;
|
||||
textEdit.TextEdit.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.OnIntKeyPress);
|
||||
textEdit.TextEdit.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(this.OnIntEditValueChanging);
|
||||
}
|
||||
@@ -4749,7 +4784,16 @@ namespace Lskj.Control.Model
|
||||
private void OnIntEditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
|
||||
{
|
||||
string newText = e.NewValue as string;
|
||||
|
||||
if (sender is TextEdit)
|
||||
{
|
||||
TextEdit textEdit = sender as TextEdit;
|
||||
if (textEdit.Tag is ControlModel)
|
||||
{
|
||||
//没有浏览权限默认显示****
|
||||
ControlModel model = textEdit.Tag as ControlModel;
|
||||
if (model.Visible && newText.Equals("****")) return;
|
||||
}
|
||||
}
|
||||
|
||||
// 第一个输入负号不会取消,出现了千位分隔符不会取消更改,末尾为百分号不会取消
|
||||
if (!newText.Equals("-") && !string.IsNullOrEmpty(newText) && !Regex.IsMatch(newText, @"^(?:-(?:[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)|[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)(?:%)?$"))
|
||||
@@ -5199,6 +5243,31 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 刷新带参数数据源
|
||||
/// </summary>
|
||||
/// <param name="baseControl"></param>
|
||||
private void RefushParaSource(BaseUserControl baseControl)
|
||||
{
|
||||
|
||||
if (baseControl != null && baseControl.Model != null)
|
||||
{
|
||||
if (ParaContrlsDic.ContainsKey(baseControl.Model.FieldName))
|
||||
{
|
||||
List<string> controlNames = ParaContrlsDic[baseControl.Model.FieldName];
|
||||
foreach (string controlName in controlNames)
|
||||
{
|
||||
BaseUserControl baseUserControl = FindControl(controlName.Trim('{', '}'));
|
||||
if (baseUserControl == null) continue;
|
||||
if (baseUserControl.Model == null) continue;
|
||||
if (baseUserControl is LabelAutoGridLook labelAutoGridLook)
|
||||
{
|
||||
labelAutoGridLook.HandPopupSqlValue(labelAutoGridLook.SourceSQL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件禁编或隐藏</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-01-22 </para>
|
||||
@@ -5213,7 +5282,7 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
ControlModel[] controls = this._models.Where(x => x.DisableCond.Contains("{" + model.FieldName + "}")).ToArray();
|
||||
ControlModel[] requiredcontrols = this._models.Where(x => x.RequiredCond.Contains("{" + model.FieldName + "}")).ToArray();
|
||||
if ((controls == null || controls.Length == 0)&&(requiredcontrols == null || requiredcontrols.Length == 0)) return;
|
||||
if ((controls == null || controls.Length == 0) && (requiredcontrols == null || requiredcontrols.Length == 0)) return;
|
||||
|
||||
string fieldValue = GetControlValue(model);
|
||||
foreach (ControlModel item in requiredcontrols)
|
||||
@@ -5577,6 +5646,7 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
BaseUserControl baseControl = (sender as System.Windows.Forms.Control).ToBaseUserControl();
|
||||
this.SetUnionAncCalcControl(baseControl);
|
||||
this.RefushParaSource(baseControl);
|
||||
if (baseControl.Model != null && baseControl.Model.IsRefreshSource == 1 && OnSourceRefrshCallBack != null)
|
||||
{
|
||||
this.RefreshControl = baseControl.Model.FieldName;//条件表刷新上表的关键字段名
|
||||
|
||||
@@ -4,6 +4,7 @@ using Lskj.Control.ZKFinger;
|
||||
using Lskj.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -33,4 +34,19 @@ namespace Lskj.Control.Model
|
||||
/// <summary>
|
||||
/// 当前拖拽源表格
|
||||
/// </summary>
|
||||
public static GridView SourceD
|
||||
public static GridView SourceDragGridView;
|
||||
/// <summary>
|
||||
/// 指纹识别模块
|
||||
/// </summary>
|
||||
public static FingerHelper fingerHelper;
|
||||
///// <summary>
|
||||
///// 外部exe进程
|
||||
///// </summary>
|
||||
//public static Dictionary<ExeType, Process> loadExeProcess = new Dictionary<ExeType, Process>();
|
||||
/// <summary>
|
||||
/// 打开的Add模块对应的父表格控件(模块编号,GridControlEx)
|
||||
/// </summary>
|
||||
public static KeyValuePair<string, GridControlEx> AddParentGrid = new KeyValuePair<string, GridControlEx>();
|
||||
/// <summary>
|
||||
/// 当前右键点击时的表格
|
||||
/// </summa
|
||||
Reference in New Issue
Block a user