ab56a9bcf7
SVN-Revision: r240
491 lines
26 KiB
C#
491 lines
26 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Lskj.Control;
|
|
using Lskj.Core;
|
|
using Lskj.Model;
|
|
using DevExpress.XtraEditors.Repository;
|
|
using DevExpress.XtraEditors.Controls;
|
|
using DevExpress.Utils;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Business;
|
|
using DevExpress.XtraGrid.Views.Base;
|
|
using DevExpress.XtraGrid.Columns;
|
|
using DevExpress.XtraGrid;
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
using Lskj.Data;
|
|
using Lskj.Business.Impl;
|
|
|
|
namespace Lskj.ToolSet
|
|
{
|
|
public partial class FrmMain : BaseForm
|
|
{
|
|
#region 公有变量
|
|
public string Key;
|
|
public DynamicBaseTableModel SysModel;
|
|
public string username = "username";
|
|
public string colTable = string.Empty;
|
|
public string keyField = string.Empty;
|
|
public string stepCode = string.Empty;
|
|
public GridControl ObjGridcontrol;
|
|
public GridView ObjGridView;
|
|
public Dictionary<string, DataRow> dictionary = new Dictionary<string, DataRow>();
|
|
#endregion
|
|
public FrmMain()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
#region 初始化
|
|
#region 窗口初始化
|
|
/// <summary>
|
|
/// <para>说明:窗口初始化</para>
|
|
/// <para>创建人:钱雄</para>
|
|
/// <para>创建日期: </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected void OnLoad(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.Key = SysModel.Key;
|
|
this.Text = SysModel.FormText;
|
|
InitGridControl();
|
|
this.lab_search.TextEdit.EditValueChanged += new EventHandler(OnUserEditValueChanged);
|
|
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
#endregion
|
|
#region 格式化数据源初始化
|
|
/// <summary>
|
|
/// <para>说明:初始化绑定列数据源</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020年12月28日 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected void InitColumnData(RepositoryItemLookUpEdit comboxEdit)
|
|
{
|
|
DataTable ColumnFormat = SqlHelper.ExecuteDataTable("select formatString,remark from p_systemdataformat");
|
|
comboxEdit.ShowHeader = false;
|
|
comboxEdit.ImmediatePopup = false;
|
|
comboxEdit.SearchMode = SearchMode.AutoFilter;
|
|
comboxEdit.NullText = "";
|
|
comboxEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
|
comboxEdit.AllowNullInput = DefaultBoolean.False;
|
|
comboxEdit.DisplayMember = "remark";
|
|
comboxEdit.ValueMember = "formatString";
|
|
comboxEdit.DataSource = ColumnFormat;
|
|
LookUpColumnInfo valueColumn = new LookUpColumnInfo();
|
|
valueColumn.Caption = "编码";
|
|
valueColumn.FieldName = "formatString";
|
|
valueColumn.Visible = false;
|
|
LookUpColumnInfo textColumn = new LookUpColumnInfo();
|
|
textColumn.Caption = "名称";
|
|
textColumn.FieldName = "remark";
|
|
comboxEdit.Columns.AddRange(new LookUpColumnInfo[] { valueColumn, textColumn });
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:初始化绑定列数据源 类型</para>
|
|
/// <para>创建人:曹屹峰</para>
|
|
/// <para>创建日期:2021年7月7日 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected void InitColumnData2(RepositoryItemLookUpEdit comboxEdit)
|
|
{
|
|
DataTable ColumnFormat = SqlHelper.ExecuteDataTable(" select 0 as showid,'字符串' as showname union all select 1 as showid,'下拉框返回ID' as showname union all select 2 as showid,'下拉框返回名称' as showname union all select 35 as showid,'下拉框返回ID-带参数' as showname union all select 23 as "
|
|
+ "showid,'下拉框返回名称-带参数' as showname union all select 3 as showid,'树型结点关联' as showname union all select 4 as showid,'日期类型框' as showname union all select 44 as showid,'日期时间类型框(时分秒)' as showname union "
|
|
+ " all select 444 as showid,'日期时间类型框(时分)' as showname union all select 4444 as showid,'时间类型框(时分秒)' as showname union all select 44444 as showid,'时间类型框(时分)' as showname union all select 5 as "
|
|
+ "showid,'搜索框返回ID' as showname union all select 6 as showid,'搜索框返回名称' as showname union all select 38 as showid,'智能搜索返回ID' as showname union all select 39 as showid,'智能搜索返回名称' as showname union "
|
|
+ "all select 40 as showid,'智能搜索返回ID-带参数' as showname union all select 41 as showid,'智能搜索返回名称-带参数' as showname union all select 15 as showid,'搜索框返回ID-带参数' as showname union all "
|
|
+ "select 16 as showid,'搜索框返回名称-带参数' as showname union all select 17 as showid,'复选框' as showname union all select 18 as showid,'下拉复选返回代码' as showname union all select 19 as showid,'下拉复选返回名称' as showname union all select 7 "
|
|
+ "as showid,'数值' as showname union all select 27 as showid,'数值-计算器' as showname union all select 8 as showid,'密码框' as showname union all select 9 as showid,'备注框' as "
|
|
+ "showname union all select 20 as showid,'备注框A' as showname union all select 10 as showid,'网址框' as showname union all select 11 as showid,'QQ框' as showname "
|
|
+ "union all select 12 as showid,'电话类型' as showname union all select 13 as showid,'多选返回ID' as showname union all select 14 as "
|
|
+ "showid,'多选返回名称' as showname union all select 33 as showid,'多选返回ID-带参数' as showname union all select 34 as showid,'多选返回名称-带参数' as showname union all select 37 as showid,'富文本编辑框' as showname union all select 96 as showid,'进度条' as showname union all select 97 as showid,'地图定位' as showname union all select 98 as showid,'条码类型' as showname union all select 99 as showid,'图片' as showname union all select 100 as showid,'图片扩展' as showname union all select 101 as showid,'二维码' as showname union all select 102 as showid,'下拉返回ID弹出' as showname union all select 103 as showid,'下拉返回名称弹出' as showname union all select 104 as showid,'多选返回ID弹出' as showname union all select 105 as showid,'多选返回名称弹出' as showname union all select 106 as showid,'单选钮返回ID' as showname union all select 107 as showid,'单选钮返回名称' as showname union all select 108 as showid,'数值型扩展' as showname union all select 109 as showid,'弹出表格单选返回ID' as showname union all select 110 as showid,'弹出表格单选返回名称' as showname union all select 111 as showid,'弹出表格多选返回ID' as showname union all select 112 as showid,'弹出表格多选返回名称' as showname union all select 113 as showid,'下拉返回ID弹出-带参数' as showname union all select 114 as showid,'下拉返回名称弹出-带参数' as showname union all select 115 as showid,'凭证金额' as showname union all select 116 as showid,'模块选择返回ID' as showname union all select 117 as showid,'模块选择返回名称' as showname union all select 118 as showid,'树型下拉返回ID' as showname union all select 119 as showid,'树型下拉返回名称' as showname union all select 120 as showid,'树型下拉返回ID-带参数' as showname union all select 121 as showid,'树型下拉返回名称-带参数' as showname union all select 122 as showid,'树型下拉返回ID末级' as showname union all select 123 as showid,'树型下拉返回名称末级' as showname union all select 124 as showid,'树型下拉返回ID末级-带参数' as showname union all select 125 as showid,'树型下拉返回名称末级-带参数' as showname ");
|
|
comboxEdit.ShowHeader = false;
|
|
comboxEdit.ImmediatePopup = false;
|
|
comboxEdit.SearchMode = SearchMode.AutoFilter;
|
|
comboxEdit.NullText = "";
|
|
comboxEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
|
comboxEdit.AllowNullInput = DefaultBoolean.False;
|
|
comboxEdit.DisplayMember = "showname";
|
|
comboxEdit.ValueMember = "showid";
|
|
comboxEdit.DataSource = ColumnFormat;
|
|
LookUpColumnInfo valueColumn = new LookUpColumnInfo();
|
|
valueColumn.Caption = "ID";
|
|
valueColumn.FieldName = "showid";
|
|
valueColumn.Visible = false;
|
|
LookUpColumnInfo textColumn = new LookUpColumnInfo();
|
|
textColumn.Caption = "名称";
|
|
textColumn.FieldName = "showname";
|
|
comboxEdit.Columns.AddRange(new LookUpColumnInfo[] { valueColumn, textColumn });
|
|
}
|
|
#endregion
|
|
#region 修改表数据初始化
|
|
/// <summary>
|
|
/// <para>说明:初始化修改表列数据</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020年12月28日 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected void InitGridControl()
|
|
{
|
|
//InitColumnData(repositoryItemLookUpEdit1);
|
|
//InitColumnData(repositoryItemLookUpEdit2);
|
|
//InitColumnData(repositoryItemLookUpEdit3);
|
|
//InitColumnData(repositoryItemLookUpEdit4);
|
|
//InitColumnData(repositoryItemLookUpEdit5);
|
|
string[] keys = Key.Split('_');
|
|
if (ERPInfo.Instance.UserName == "管理员" && keys.Count() > 1)
|
|
{
|
|
string ModuleTypes = keys[0];
|
|
string ModuleKey = keys[1];
|
|
int ModelType = ControlType.ModelType(ModuleTypes);
|
|
string tmpsql = string.Empty;
|
|
colTable = string.Empty;
|
|
keyField = string.Empty;
|
|
stepCode = string.Empty;
|
|
//DXMenuItem item = sender as DXMenuItem;
|
|
//GridView grv = item.Tag as GridView;
|
|
//基础档案主表
|
|
if (ModelType == 1 || ModelType == 2)
|
|
{
|
|
colTable = "p_systemwordbooktab";
|
|
tmpsql = "select * from p_systemwordbooktab where formKey='" + ModuleKey + "' order by orderid";
|
|
object obj = SqlHelper.ExecuteScalar(CommandType.Text, tmpsql);
|
|
if (obj != null)
|
|
{
|
|
gridColumn37.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn37.DisplayFormat.FormatString = "0.#";
|
|
keyField = "formKey";
|
|
ObjGridcontrol = gcMain;
|
|
ObjGridView = gvMain;
|
|
gcMain.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit1);
|
|
InitColumnData2(repositoryItemLookUpEdit1_2);
|
|
}
|
|
}
|
|
if (ModelType == 2 && string.IsNullOrEmpty(keyField))
|
|
{
|
|
colTable = "p_systemDlltabDetailGrid";
|
|
tmpsql = "select top 1 orderid from p_systemDlltabDetailGrid where detailKey='" + ModuleKey + "' order by orderid";
|
|
object obj = SqlHelper.ExecuteScalar(CommandType.Text, tmpsql);
|
|
if (obj != null)
|
|
{
|
|
|
|
gridColumn40.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn40.DisplayFormat.FormatString = "0.#";
|
|
keyField = "detailKey";
|
|
ObjGridcontrol = gcMain2;
|
|
ObjGridView = gvMain2;
|
|
gcMain2.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit2);
|
|
InitColumnData2(repositoryItemLookUpEdit2_2);
|
|
}
|
|
}
|
|
////单据明细
|
|
if (ModelType == 3)
|
|
{
|
|
gridColumn34.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn34.DisplayFormat.FormatString = "0.#";
|
|
colTable = "p_systembillDetail";
|
|
keyField = "typecode";
|
|
ModuleKey = SysModel.ModuleCode;
|
|
ObjGridcontrol = gcMain3;
|
|
ObjGridView = gvMain3;
|
|
gcMain3.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit3);
|
|
InitColumnData2(repositoryItemLookUpEdit3_2);
|
|
}
|
|
////单据来源主信息
|
|
if (ModelType == 4)
|
|
{
|
|
gridColumn33.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn33.DisplayFormat.FormatString = "0.#";
|
|
colTable = "p_systembillsourcegrid";
|
|
keyField = "sourcekey";
|
|
ObjGridcontrol = gcMain4;
|
|
ObjGridView = gvMain4;
|
|
gcMain4.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit4);
|
|
InitColumnData2(repositoryItemLookUpEdit4_2);
|
|
}
|
|
////单据来源明细信息
|
|
if (ModelType == 5)
|
|
{
|
|
gridColumn33.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn33.DisplayFormat.FormatString = "0.#";
|
|
colTable = "p_systembillsourcedetail";
|
|
keyField = "sourcekey";
|
|
ObjGridcontrol = gcMain4;
|
|
ObjGridView = gvMain4;
|
|
gcMain4.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit4);
|
|
InitColumnData2(repositoryItemLookUpEdit4_2);
|
|
}
|
|
//单据审核列表
|
|
if (ModelType == 6)
|
|
{
|
|
gridColumn43.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn43.DisplayFormat.FormatString = "0.#";
|
|
colTable = "p_systembillstepgrid";
|
|
keyField = "typeCode";
|
|
if (!string.IsNullOrEmpty(ModuleKey) && keys.Length == 5)
|
|
{
|
|
ModuleKey = keys[2];
|
|
stepCode = keys[3];
|
|
}
|
|
ObjGridcontrol = gcMain5;
|
|
ObjGridView = gvMain5;
|
|
gcMain5.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit5);
|
|
InitColumnData2(repositoryItemLookUpEdit5_2);
|
|
}
|
|
//基础档案审核列表
|
|
if (ModelType == 7)
|
|
{
|
|
gridColumn43.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn43.DisplayFormat.FormatString = "0.#";
|
|
colTable = "p_systemdlltabflowstepgrid";
|
|
keyField = "typeCode";
|
|
if (!string.IsNullOrEmpty(ModuleKey) && keys.Length == 5)
|
|
{
|
|
ModuleKey = keys[2];
|
|
stepCode = keys[3];
|
|
}
|
|
ObjGridcontrol = gcMain5;
|
|
ObjGridView = gvMain5;
|
|
gcMain5.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit5);
|
|
InitColumnData2(repositoryItemLookUpEdit5_2);
|
|
}
|
|
// 单据审核附加信息
|
|
if (ModelType == 8)
|
|
{
|
|
gridColumn33.DisplayFormat.FormatType = FormatType.Custom;
|
|
gridColumn33.DisplayFormat.FormatString = "0.#";
|
|
colTable = "p_systembillauditAttachDetail";
|
|
keyField = "attachKey";
|
|
ObjGridcontrol = gcMain4;
|
|
ObjGridView = gvMain4;
|
|
gcMain4.Visible = true;
|
|
InitColumnData(repositoryItemLookUpEdit4);
|
|
InitColumnData2(repositoryItemLookUpEdit4_2);
|
|
}
|
|
if (ModelType != 0 && !string.IsNullOrEmpty(keyField))
|
|
{
|
|
string sqlValue = string.Format("select * from {0} where {1}='{2}' order by orderid", colTable, keyField, ModuleKey);
|
|
if (ModelType == 7 || ModelType == 6)
|
|
sqlValue = string.Format("select * from {0} where {1}='{2}' and stepCode='{3}' order by orderid", colTable, keyField, ModuleKey, stepCode);
|
|
this.ObjGridcontrol.DataSource = SqlHelper.ExecuteDataTable(sqlValue);
|
|
if (ObjGridcontrol == gcMain) username = "username1";
|
|
this.ObjGridView.CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(OnGridViewCustomDrawRowIndicator);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 事件相关
|
|
#region 模糊查询事件
|
|
/// <summary>
|
|
/// <para>说明:用户值改变后</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-12-28 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnUserEditValueChanged(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
//【TextEdit】判断是否为空
|
|
if (lab_search.EditText.ToString() != "")
|
|
{
|
|
string txtid = lab_search.EditText.Trim().ToString();
|
|
|
|
//grv是gridview的名字,【开始模糊查询】
|
|
ObjGridView.ActiveFilter.Add(null, new DevExpress.XtraGrid.Columns.ColumnFilterInfo(string.Format("fieldname like '%{0}%' Or {1} like '%{0}%'", txtid, username)));
|
|
}
|
|
else
|
|
{
|
|
//表示清除模糊查询
|
|
ObjGridView.ActiveFilter.Clear();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
#endregion
|
|
#region 序号生成事件
|
|
/// <summary>
|
|
/// <para>说明:生成序号</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-12-31 </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="RowIndicatorCustomDrawEventArgs"/> instance containing the event data.</param>
|
|
protected virtual void OnGridViewCustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
|
|
if (e.Info.IsRowIndicator)
|
|
{
|
|
if (e.RowHandle >= 0)
|
|
{
|
|
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 按钮事件相关
|
|
#region 保存按钮执行事件
|
|
/// <summary>
|
|
/// <para>说明:执行保存事件</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020年12月28日 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void OnbtnSaveClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (isAllUpda.EditText == "1")
|
|
{
|
|
if (dictionary.Count > 0)
|
|
{
|
|
foreach (string item in dictionary.Keys)
|
|
{
|
|
DataRow itemRow = dictionary[item];
|
|
string updateSql = "update {0} set {1} where {2}='{3}';";
|
|
string updateFields = string.Empty;
|
|
string BaseSql = string.Empty;
|
|
foreach (GridColumn column in ObjGridView.Columns)
|
|
{
|
|
updateFields += string.Format("[{0}]='{1}',", column.FieldName, (itemRow[column.FieldName] + "").Replace("'", "''"));
|
|
}
|
|
updateFields = updateFields.TrimEnd(',');
|
|
if (!string.IsNullOrEmpty(updateFields))
|
|
{
|
|
BaseSql = string.Format(updateSql, colTable, updateFields, "fieldname", item);
|
|
if (SqlHelper.ExecuteNonQuery(BaseSql) > 0)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SaveSuccess);
|
|
}
|
|
}
|
|
}
|
|
dictionary.Clear();
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show("请先预览会一并修改的模块!");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.ObjGridcontrol.NewGridSaveData(colTable, ObjGridView);
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
#region 预览功能按钮点击事件
|
|
/// <summary>
|
|
/// <para>说明:执行预览所有修改字段功能</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020年12月29日 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void OnbtnPreview(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
List<string> mList = new List<string>();
|
|
DataRow[] modifiedRows = (ObjGridcontrol.DataSource as DataTable).Rows.Cast<DataRow>().Where(x => x.RowState == DataRowState.Modified || x.RowState == DataRowState.Added).ToArray();
|
|
string modified = string.Empty;
|
|
dictionary.Clear();
|
|
if (modifiedRows == null || modifiedRows.Length == 0)
|
|
{
|
|
MessageUtil.Show("未发现修改的数据!");
|
|
return;
|
|
}
|
|
foreach (DataRow item in modifiedRows)
|
|
{
|
|
modified += "'" + item["fieldname"] + "'" + ",";
|
|
dictionary.Add(item["fieldname"] + "", item);
|
|
}
|
|
modified = modified.TrimEnd(',');
|
|
PreviewFrom previewFrom = new PreviewFrom();
|
|
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from {0} where {1} in ({2}) order by orderid", colTable, "fieldname", modified));
|
|
previewFrom.iniControls(dt, colTable);
|
|
previewFrom.ShowDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
LogUtil.WriteError("预览修改字段出错!", ex);
|
|
//MessageUtil.Show("预览修改字段出错!" + ex);
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
}
|
|
} |