SVN r1047
SVN-Revision: r1047
This commit is contained in:
@@ -453,6 +453,10 @@ namespace Lskj.Control.Model
|
||||
///单据来源控件(弹出控件根据下拉框中的单据来源id加载数据)
|
||||
/// </summary>
|
||||
public const int LabBillSource = -11;
|
||||
/// <summary>
|
||||
///提示框
|
||||
/// </summary>
|
||||
public const int LabPrompt = 166;
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:是否为Value类型</para>
|
||||
|
||||
@@ -374,8 +374,11 @@ namespace Lskj.Control.Model
|
||||
/// <summary>
|
||||
/// 编辑框格式化(和显示格式一致)
|
||||
/// </summary>
|
||||
public bool FormatEditBox;
|
||||
|
||||
public bool FormatEditBox;
|
||||
/// <summary>
|
||||
/// 单元格内容为空时的提示信息
|
||||
/// </summary>
|
||||
public string PromptText;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -470,4 +473,5 @@ namespace Lskj.Control.Model
|
||||
this.ImportConversionFormat = item.Table.Columns.Contains("ImportConversionFormat") ? item["ImportConversionFormat"]+"" : string.Empty;
|
||||
this.PrivilegeView = item.Table.Columns.Contains("PrivilegeView") ? item["PrivilegeView"] + "" : string.Empty;
|
||||
this.PrivilegeOper = item.Table.Columns.Contains("PrivilegeOper") ? item["PrivilegeOper"] + "" : string.Empty;
|
||||
this.AdditionalAssociations = item.Table.Col
|
||||
this.AdditionalAssociations = item.Table.Columns.Contains("AdditionalAssociations") ? "1".Equals(item["AdditionalAssociations"] + "") : false;
|
||||
thi
|
||||
@@ -121,7 +121,7 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public bool IsDrag;
|
||||
/// <summary>
|
||||
/// 拖拽模式下是否可以拖拽明细
|
||||
/// 明细替换左侧表格
|
||||
/// </summary>
|
||||
public bool IsUnionleft;
|
||||
/// <summary>
|
||||
@@ -283,6 +283,7 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public string PlanLetfControl;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 主模块编号
|
||||
/// </summary>
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public bool isAllowDrag = true;
|
||||
/// <summary>
|
||||
/// 拖拽是否忽视节点
|
||||
/// 拖拽是否忽视节点(不忽视必须要推拽到节点上)
|
||||
/// </summary>
|
||||
public bool NeglectingNodes = false;
|
||||
/// <summary>
|
||||
@@ -269,27 +269,4 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
|
||||
if (treeNode == null) return;
|
||||
if (treeNode.Nodes.Count() > 0 && !CanDragParentNode)
|
||||
{
|
||||
MessageUtil.Show(string.Format(ResourceKeys.UnLastTreeNode, treeNode.GetDisplayText(treeListGrid.KeyFieldName)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!e.Data.GetDataPresent(typeof(TreeNode)))
|
||||
{
|
||||
if (OnDragComplete != null)
|
||||
{
|
||||
GridDragTreeGridArgs args = new GridDragTreeGridArgs();
|
||||
args.GridViewObj = this._gridView;
|
||||
args.TreeListObj = this._treeListGrid;
|
||||
args.GridViewSelectRows = this.GetGridSelectRows(this._gridView.GetSelectedRows());
|
||||
args.SelectTreeNode = treeNode;
|
||||
args.BeforeTreeNode = this._beforeListNode;
|
||||
OnDragComplete(sender, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (treeNode.Nod
|
||||
@@ -1189,6 +1189,23 @@ namespace Lskj.Control.Model
|
||||
opxls.ExportType = DevExpress.Export.ExportType.WYSIWYG;
|
||||
BandedGridControlEx NewBandedGridControlEx = export.ReplaceBitColumn(bandedGridControlEx);
|
||||
BandedGridView gridView = NewBandedGridControlEx.GridView as BandedGridView;
|
||||
|
||||
if (SystemInfo.Instance.ExportClearItemSource)
|
||||
{
|
||||
foreach (GridColumn column in gridView.Columns)//取消表格列下拉控件
|
||||
{
|
||||
if (column.ColumnEdit != null && column.ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit)
|
||||
{
|
||||
column.ColumnEdit = null;
|
||||
}
|
||||
//if (column.ColumnEdit != null && column.ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit)
|
||||
//{
|
||||
// column.ColumnEdit = null;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gridView.OptionsPrint.PrintHeader = true;
|
||||
gridView.OptionsPrint.AutoWidth = false;
|
||||
DataTable dataTable = gridView.GetGridViewFilteredAndSortedDataToDataTable();//获取数据表
|
||||
@@ -1329,6 +1346,10 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
column.ColumnEdit = null;
|
||||
}
|
||||
//if (column.ColumnEdit != null && column.ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit)
|
||||
//{
|
||||
// column.ColumnEdit = null;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1557,6 +1578,10 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
column.ColumnEdit = null;
|
||||
}
|
||||
//if (column.ColumnEdit != null && column.ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit)
|
||||
//{
|
||||
// column.ColumnEdit = null;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3160,10 +3185,18 @@ namespace Lskj.Control.Model
|
||||
string sqlValue = string.Format("update {0} set {1}='0' ", SysModel.MenuTable, _importFlag);
|
||||
sqlValue = string.Format("update {0} set {1}='0' where {1}!='0' ", SysModel.MenuTable, _importFlag);
|
||||
SqlHelper.ExecuteNonQuery(sqlValue);
|
||||
DataRow dataRow = datatb.Rows[0];
|
||||
if (!string.IsNullOrWhiteSpace(SysModel.afterimportSql2) && failed == 0)
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(SysModel.afterimportSql2) && failed == 0 && datatb.Rows.Count > 0)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(ReplaceHelper.ReplaceRowParam(dataRow, ReplaceHelper.ReplaceUserInfo(SysModel.afterimportSql2)));
|
||||
try
|
||||
{
|
||||
DataRow dataRow = datatb.Rows[0];
|
||||
SqlHelper.ExecuteNonQuery(ReplaceHelper.ReplaceRowParam(dataRow, ReplaceHelper.ReplaceUserInfo(SysModel.afterimportSql2)));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageUtil.Show("导入后执行sql执行失败" + e.Message);
|
||||
}
|
||||
}
|
||||
datatb.Clear();
|
||||
|
||||
@@ -3635,7 +3668,7 @@ namespace Lskj.Control.Model
|
||||
// MessageUtil.Show(string.Format("明细列:{0}不能为空!", gridView.Columns[requiredField].Caption));
|
||||
// return false;
|
||||
//}
|
||||
|
||||
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(gridView.GetRowCellDisplayText(i, requiredField)))
|
||||
|
||||
@@ -579,7 +579,7 @@ namespace Lskj.Control.Model
|
||||
//LogUtil.WriteDebug(model.MenuTabName, "打印", "右键打印:"+ model.MenuName, "打印格式:" + paramList[1]);
|
||||
break;
|
||||
case 4://调用主程序右键直接添加到page上
|
||||
resultValue = ExecDynamicLinkLibary(model, paramList, dllName, true);
|
||||
resultValue = ExecDynamicLinkLibary(model, paramList, dllName, true, rowData);
|
||||
break;
|
||||
case 5://执行存储过程获取下载url集合执行批量下载
|
||||
resultValue = ExecDownloadFiles(model, paramList, rows);
|
||||
@@ -587,6 +587,9 @@ namespace Lskj.Control.Model
|
||||
case 6://下载后打开文件
|
||||
resultValue = OpenAfterDownloading(model, paramList);
|
||||
break;
|
||||
case 7://打开导入覆盖控件
|
||||
resultValue = OpenFrmcCover(model, paramList);
|
||||
break;
|
||||
case 0: // 执行sql语句
|
||||
resultValue = ExecSqlValue(model, rowData, actionSql);
|
||||
break;
|
||||
@@ -613,6 +616,69 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
|
||||
|
||||
public bool OpenFrmcCover(GridRightMenuModel model, List<string> paramList)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(paramList[1]) || string.IsNullOrWhiteSpace(paramList[2]))
|
||||
{
|
||||
MessageUtil.Show("模块编号或主键名称未配置");
|
||||
return false;
|
||||
}
|
||||
string primaryKey = paramList[2];
|
||||
FrmCover frmCover = new FrmCover(paramList[1], paramList[2]);
|
||||
if (frmCover.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
//反写数据源
|
||||
DataTable ReverseData = frmCover.ReverseData;
|
||||
//外部数据
|
||||
DataTable table = GetDataTable();
|
||||
|
||||
// 2. 筛选出 ReverseData 和 table 中名称和数据类型都相同的列(排除主键列,避免重复赋值)
|
||||
var commonColumns = ReverseData.Columns.Cast<DataColumn>()
|
||||
.Where(col1 => col1.ColumnName != primaryKey // 跳过 id 列(无需更新)
|
||||
&& table.Columns.Contains(col1.ColumnName) // 列名存在于 table2
|
||||
)
|
||||
.Select(col => col.ColumnName)
|
||||
.ToList();
|
||||
|
||||
if (!commonColumns.Any())
|
||||
{
|
||||
// 没有可匹配的列,直接返回
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. 遍历 导入数据 的每一行,根据主键匹配 外部数据 的行并更新
|
||||
foreach (DataRow row1 in ReverseData.Rows)
|
||||
{
|
||||
// 获取当前行的主键值
|
||||
var idValue = row1[primaryKey];
|
||||
if (idValue == DBNull.Value)
|
||||
continue; // 跳过 id 为空的行
|
||||
|
||||
// 在 table2 中查找 id 匹配的行(使用 Select 方法快速定位)
|
||||
DataRow[] matchedRows = table.Select($""+ primaryKey + " = '"+ idValue + "'");
|
||||
|
||||
// 只处理找到唯一匹配行的情况
|
||||
if (matchedRows.Length == 1)
|
||||
{
|
||||
DataRow row2 = matchedRows[0];
|
||||
// 遍历所有相同列,将 反写数据源 的值赋给 外部数据源
|
||||
foreach (string colName in commonColumns)
|
||||
{
|
||||
// 避免将 DBNull 赋值给不允许为空的列(可选处理)
|
||||
if (row2[colName] != DBNull.Value || ReverseData.Columns[colName].AllowDBNull)
|
||||
{
|
||||
row2[colName] = row1[colName];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下载后打开程序
|
||||
/// </summary>
|
||||
@@ -753,7 +819,7 @@ namespace Lskj.Control.Model
|
||||
catch (Exception)
|
||||
{
|
||||
result = 0;
|
||||
if (result==0 && ERPInfo.Instance.UserName.Equals("管理员"))
|
||||
if (result==0 )
|
||||
{
|
||||
SqlStoredProcedurepPrompt.GenerateProcedureExecutionScript(procName, paramList, isFirstFlag, comfirmFlag );
|
||||
}
|
||||
@@ -773,7 +839,7 @@ namespace Lskj.Control.Model
|
||||
switch (rValue)
|
||||
{
|
||||
case -1:
|
||||
if (rValue == -1 && ERPInfo.Instance.UserName.Equals("管理员"))
|
||||
if (rValue == -1)
|
||||
{
|
||||
SqlStoredProcedurepPrompt.GenerateProcedureExecutionScript(procName, paramList, isFirstFlag, comfirmFlag);
|
||||
}
|
||||
@@ -909,7 +975,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, string dllName, bool isAddPage = false)
|
||||
private bool ExecDynamicLinkLibary(GridRightMenuModel model, List<string> paramList, string dllName, bool isAddPage = false,DataRow rowData = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(dllName))
|
||||
{
|
||||
@@ -1124,6 +1190,12 @@ namespace Lskj.Control.Model
|
||||
string guid = Guid.NewGuid().ToString();
|
||||
XtraTabPage tp = new XtraTabPage();
|
||||
tp.Text = model.MenuName;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(model.PageName))
|
||||
{
|
||||
tp.Text = ReplaceHelper.ReplaceRowParam(rowData, model.PageName).Trim();
|
||||
}
|
||||
|
||||
tp.Tag = guid;
|
||||
// 这个必须有不然会提示:"不能向tabControl中添加顶级控件"
|
||||
form.SubForm.TopLevel = false;
|
||||
@@ -1669,6 +1741,17 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取外面的数据源
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected virtual DataTable GetDataTable()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:处理右键菜单10个扩展参数</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
|
||||
@@ -191,6 +191,12 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
return this.GridControlObj.GetViewFocusedDataRows();
|
||||
}
|
||||
|
||||
protected override DataTable GetDataTable()
|
||||
{
|
||||
return this.GridControlObj.GridControl.DataSourceTable();
|
||||
}
|
||||
|
||||
protected override void MenuStripClickBefore(ToolStripMenuItem item, GridRightMenuModel model)
|
||||
{
|
||||
this._oldSelectRows = this._gridView.GetSelectedRows();
|
||||
|
||||
@@ -323,7 +323,10 @@ namespace Lskj.Control.Model
|
||||
/// sql执行成功不提示
|
||||
/// </summary>
|
||||
public bool DisableSuccessfulPrompt;
|
||||
|
||||
/// <summary>
|
||||
/// 页签名称(审核模块以页签形式打开,可以配置单据id)
|
||||
/// </summary>
|
||||
public string PageName;
|
||||
|
||||
/// <summary>
|
||||
/// 需要单独处理的exe程序
|
||||
@@ -447,4 +450,5 @@ namespace Lskj.Control.Model
|
||||
this.ExecuteFirstCode = item["ExecuteFirstCode"] + "";
|
||||
if (item.Table.Columns.Contains("DuringExecutionMinimize"))
|
||||
this.DuringExecutionMinimize = string.IsNullOrWhiteSpace(item["DuringExecutionMinimize"] + "") ? false : "1".Equals(item["DuringExecutionMinimize"] + "");
|
||||
if
|
||||
if (item.Table.Columns.Contains("SqlDirectExecution"))
|
||||
this.SqlDirectExecution = string.IsNullOrWhi
|
||||
@@ -38,6 +38,13 @@ namespace Lskj.Control.Model.MenuStrip
|
||||
{
|
||||
return this.TreeGridControlObj.GetViewFocusedDataRows();
|
||||
}
|
||||
protected override DataTable GetDataTable()
|
||||
{
|
||||
return this.TreeGridControlObj.GetGridViewDataSource();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override List<string> HandleRightMenuParams(List<string> paramList, DataRow rowData, DataRow[] rowDatas = null, int actionType = 0)
|
||||
{
|
||||
List<string> handleParamList = base.HandleRightMenuParams(paramList, rowData, rowDatas, actionType);
|
||||
|
||||
@@ -2897,7 +2897,8 @@ namespace Lskj.Control.Model
|
||||
leftField.Equals(model.FieldName) ||
|
||||
"ID".Equals(model.FieldName, StringComparison.CurrentCultureIgnoreCase) ||
|
||||
model.FieldType == ControlType.LabPic ||
|
||||
model.FieldType == ControlType.LabPicEx || !tableColumns.Columns.Contains(model.FieldName) ||
|
||||
model.FieldType == ControlType.LabPicEx ||
|
||||
model.FieldType == ControlType.LabPrompt || !tableColumns.Columns.Contains(model.FieldName) ||
|
||||
Autogrowcolumn.ToLower() == model.FieldName.ToLower())
|
||||
continue;
|
||||
string fieldValue = this.GetControlValue(model);
|
||||
@@ -2939,7 +2940,8 @@ namespace Lskj.Control.Model
|
||||
leftField.Equals(model.FieldName) ||
|
||||
"ID".Equals(model.FieldName, StringComparison.CurrentCultureIgnoreCase) ||
|
||||
model.FieldType == ControlType.LabPic ||
|
||||
model.FieldType == ControlType.LabPicEx || !tableColumns.Columns.Contains(model.FieldName) ||
|
||||
model.FieldType == ControlType.LabPicEx ||
|
||||
model.FieldType == ControlType.LabPrompt || !tableColumns.Columns.Contains(model.FieldName) ||
|
||||
Autogrowcolumn.ToLower() == model.FieldName.ToLower())
|
||||
continue;
|
||||
BaseUserControl userControl = this.FindControl(model);
|
||||
@@ -4644,6 +4646,10 @@ namespace Lskj.Control.Model
|
||||
if (!isLoadBorder) billSourceComboxEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
baseControl = billSourceComboxEdit;
|
||||
break;
|
||||
case ControlType.LabPrompt:
|
||||
LabelPrompt labelPrompt = new LabelPrompt();
|
||||
baseControl = labelPrompt;
|
||||
break;
|
||||
case ControlType.LabText:
|
||||
case ControlType.LabTextInt:
|
||||
default:
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using DevExpress.XtraSplashScreen;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Data;
|
||||
|
||||
namespace Lskj.Control.Model
|
||||
@@ -49,33 +50,4 @@ namespace Lskj.Control.Model
|
||||
public static void ShowForm(string msg = null)
|
||||
{
|
||||
_dataMsg = msg ?? ResourceKeys.DataLoading;
|
||||
bool flag = !LoadForm.IsSplashFormVisible;
|
||||
if (flag)
|
||||
{
|
||||
_loadForm.ShowWaitForm();
|
||||
_loadForm.SetWaitFormCaption(_dataMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loadForm.SetWaitFormCaption(_dataMsg);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:关闭等待窗体</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-11 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public static void HideForm()
|
||||
{
|
||||
bool isSplashFormVisible = LoadForm.IsSplashFormVisible;
|
||||
if (isSplashFormVisible)
|
||||
{
|
||||
_loadForm.CloseWaitForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (LanguageTrans
|
||||
Reference in New Issue
Block a user