1123 lines
47 KiB
C#
1123 lines
47 KiB
C#
/******************************
|
|
* 说明:PubSpec分类模块
|
|
* 创建人:龚宇超
|
|
* 创建日期:2018-01-02
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
******************************/
|
|
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.Model;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Util;
|
|
using Lskj.Data;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Business;
|
|
using Lskj.Core;
|
|
|
|
namespace Lskj.PubSpec2
|
|
{
|
|
public partial class FrmMain : BaseForm
|
|
{
|
|
private bool _existsPid = false;
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
private string _parmaryKey;
|
|
/// <summary>
|
|
/// 左侧树
|
|
/// </summary>
|
|
private DataRow _leftTreeRow;
|
|
/// <summary>
|
|
/// 表格列
|
|
/// </summary>
|
|
private DataTable _gridColumns;
|
|
|
|
/// <summary>
|
|
/// 模块对象
|
|
/// </summary>
|
|
public DynamicModel Model;
|
|
/// <summary>
|
|
/// 系统对象
|
|
/// </summary>
|
|
public ModuleModel SysModel;
|
|
|
|
public FrmMain()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:窗口加载</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </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 override void OnLoad(EventArgs e)
|
|
{
|
|
WaitForm.ShowForm();
|
|
|
|
try
|
|
{
|
|
this.Model.Privilege = this.Model.Privilege.Equals("3") ? "1" : Model.ModuleId > 0 ? BaseImpl.GetUserPurviewsByMenuId(Model.ModuleId + "") + "" : BaseImpl.GetUserPurviewsByMenuCode(Model.ModuleCode) + "";
|
|
if (!this.Model.HasPrivilege())
|
|
{
|
|
MessageUtil.Show(ResourceKeys.UnPurview);
|
|
this.Close();
|
|
}
|
|
else
|
|
{
|
|
this._parmaryKey = BaseModuleImpl.GetBasePrimaryKey(this.Model.ModuleCode);
|
|
this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
|
|
|
|
this.treeLeft.TreeInhibitSort = this.SysModel.TreeInhibitSort;
|
|
|
|
this.gcMain.GridView.OptionsBehavior.Editable = this.SysModel.ModifyEnable;
|
|
//if (BaseImpl.HasExistsTable("p_systemTreeNodeSetTab"))
|
|
//{
|
|
// DataRow treeNodedr = BaseImpl.TreeNodeSetTab(this.SysModel.MenuTable);
|
|
// string tabname = treeNodedr["treeTable"] + "";
|
|
// if (treeNodedr != null && BaseImpl.HasExistsColumn(tabname, "pid"))
|
|
// {
|
|
// SqlHelper.ExecuteNonQuery(String.Format("ALTER TABLE {0} DROP COLUMN orderid,pid", tabname));
|
|
// }
|
|
//}
|
|
if (Model.HasReadPrivilege())
|
|
{
|
|
this.gcMain.GridView.OptionsBehavior.Editable = false;
|
|
}
|
|
if (this.InitializeTreeNode())
|
|
{
|
|
this.InitializeTreeView();
|
|
}
|
|
this.InitializeGridView();
|
|
}
|
|
|
|
if (SystemInfo.Instance.HideHelpDocument)
|
|
{
|
|
//隐藏帮助文档按钮
|
|
this.simpleButton1.Visible = false;
|
|
this.btnShowAll.Location = new Point(this.btnShowAll.Location.X + simpleButton1.Width, this.btnShowAll.Location.Y);
|
|
|
|
}
|
|
|
|
this.InitlizeSpiltLocation();
|
|
this.scc_container.SplitterMoved += new System.EventHandler(this.OnSplitterMoved);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
//MessageUtil.Show(ex.StackTrace);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
|
WaitForm.HideForm();
|
|
this.scc_container.Visible = true;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:初始化树节点调用模块</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private bool InitializeTreeNode(int i = 1)
|
|
{
|
|
bool isComplete = true;
|
|
// 验证删除存储过程
|
|
string tipMsg = string.Empty;
|
|
|
|
int result = BaseImpl.ReBuildTreeNode(Model.ModuleCode, i, out tipMsg);
|
|
if (result != 1)
|
|
{
|
|
MessageUtil.Show(tipMsg);
|
|
isComplete = false;
|
|
}
|
|
return isComplete;
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:初始化树</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void InitializeTreeView()
|
|
{
|
|
if (this.Model.ModuleCode != "A006101")
|
|
{
|
|
this._leftTreeRow = BaseModuleImpl.GetBaseLeftTreeField(this.Model.ModuleCode);
|
|
if (this._leftTreeRow != null)
|
|
{
|
|
string fieldsql = this._leftTreeRow["fieldsql"] + "";
|
|
string specialId = string.Empty;
|
|
this.treeLeft.TreeView.CheckBoxes = false;
|
|
this.treeLeft.TreeNodeKeyField = this._leftTreeRow["fieldsqlid"] + "";
|
|
this.treeLeft.TreeNodeTextField = this._leftTreeRow["fieldsqlname"] + "";
|
|
this.treeLeft.TreeNodeSelectAfter += new TreeViewEventHandler(OnTreeNodeSelectAfter);
|
|
//if (BaseImpl.HasExistsTable("p_systemTreeNodeSetTab"))
|
|
//{
|
|
// DataRow treeNodedr = BaseImpl.TreeNodeSetTab(this.SysModel.MenuTable);
|
|
// if (treeNodedr != null)
|
|
// {
|
|
// specialId = treeNodedr["treeIdField"] + "";
|
|
// }
|
|
//}
|
|
DataTable dt = BaseImpl.GetDataTableResult(fieldsql);
|
|
if (!string.IsNullOrEmpty(specialId) && dt.Columns.Contains("pid") && dt.Columns.Contains("orderid") && dt.Columns.Contains(specialId))
|
|
{
|
|
this.btnDataChange.Enabled = true;
|
|
// 存在拖拽树节点绑定方式则采用父节点绑定树
|
|
this._existsPid = true;
|
|
this.treeLeft.BindTreeView(BaseImpl.GetDataTableResult(fieldsql), specialId);
|
|
Lskj.Control.TreeViewEx.DragTreeNodeEventHandler dragEvent = new TreeViewEx.DragTreeNodeEventHandler(DragTreeNodeEvent);
|
|
this.treeLeft.EnableTreeNodeDrag(dragEvent);
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show("数据加载异常!请检查配置!");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (SysModel != null)
|
|
{
|
|
string sql = SysModel.MenuSql;
|
|
sql = sql + " order by speciesNo";
|
|
this.treeLeft.TreeView.CheckBoxes = false;
|
|
this.treeLeft.TreeNodeKeyField = "SpeciesNo";
|
|
this.treeLeft.TreeNodeTextField = "SpeciesName";
|
|
this.treeLeft.TreeNodeSelectAfter += new TreeViewEventHandler(OnTreeNodeSelectAfter);
|
|
this.treeLeft.BindSpecialTreeView(BaseImpl.GetDataTableResult(sql));
|
|
}
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:初始化表格</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void InitializeGridView()
|
|
{
|
|
this.gcMain.Model = this.Model;
|
|
this._gridColumns = BaseModuleImpl.GetBaseGridColumns(this.Model.ModuleCode);
|
|
|
|
GridDragTree dragTree = new GridDragTree(this.gcMain.GridView, this.treeLeft.TreeView);
|
|
dragTree.CanDragParentNode = true;
|
|
dragTree.OnDragComplete += new GridDragTreeCompleteEventHandler(OnDragCompleted);
|
|
|
|
this.gcMain.IsSpecModel = true;
|
|
this.gcMain.SetEditColumns(this._gridColumns);
|
|
this.gcMain.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(this.Model.ModuleCode));
|
|
this.gcMain.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(this.Model.ModuleCode), this.Model, OnGridViewRightCallBack, null);
|
|
this.SearchLastGridView();
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:查询GridView数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void SearchLastGridView(string parentValue = "")
|
|
{
|
|
try
|
|
{
|
|
string sqlValue = string.Empty;
|
|
WaitForm.ShowForm();
|
|
|
|
int focusRowHandle = this.gcMain.GridView.FocusedRowHandle;
|
|
if (this.Model.ModuleCode != "A006101")
|
|
{
|
|
if (_existsPid)
|
|
{
|
|
sqlValue = string.IsNullOrWhiteSpace(parentValue)
|
|
? this.SysModel.MenuSql
|
|
: this.SysModel.MenuSql + string.Format(" and pid='{1}' order by {0}", "orderid", parentValue);
|
|
}
|
|
else
|
|
{
|
|
sqlValue = string.IsNullOrWhiteSpace(parentValue)
|
|
? this.SysModel.MenuSql
|
|
: this.SysModel.MenuSql + string.Format(" and {0} like '{1}__' order by {0}", _existsPid ? "pid" : _leftTreeRow["fieldsqlid"] + "", parentValue);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
sqlValue = string.IsNullOrWhiteSpace(parentValue)
|
|
? this.SysModel.MenuSql
|
|
: this.SysModel.MenuSql + string.Format(" and {0} like '{1}___' order by {0}", "SpeciesNo", parentValue);
|
|
}
|
|
|
|
this.gcMain.SetGridViewDataSource(BaseImpl.GetDataTableResult(sqlValue));
|
|
this.gcMain.GridView.SelectRowHandler(focusRowHandle);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
//MessageUtil.Show(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:树结构拖拽同级完成事件</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-12-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void DragTreeNodeEvent(TreeNode Parent)
|
|
{
|
|
try
|
|
{
|
|
// 更新同级拖拽节点父节点
|
|
string ParentNo = Parent.Tag as string;
|
|
//BaseImpl.ExecSqlValue(string.Format("update {0} set pid='{1}' where {2}='{3}'", this.SysModel.MenuTable, afterNo, this.treeLeft.TreeNodeKeyField, beforeNo));
|
|
int i = Parent.Nodes.Count - 1;
|
|
string orderid = BaseImpl.GetResult(string.Format("select cast(isnull(max(orderid),0) as int) orderid from {0} where pid='{1}'", this.SysModel.MenuTable, ParentNo)) + "";
|
|
if (string.IsNullOrEmpty(orderid)) orderid = "1";
|
|
int nodeOrder = int.Parse(orderid);
|
|
foreach (TreeNode nodes in Parent.Nodes)
|
|
{
|
|
int sortOrder = nodeOrder - i;
|
|
BaseImpl.ExecSqlValue(string.Format("update {0} set orderid='{1}' where {3}='{2}'", SysModel.MenuTable, sortOrder, nodes.Tag as string, this.treeLeft.TreeNodeKeyField));
|
|
i--;
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//MessageUtil.Show(ex.Message);
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:保存Grid数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-03 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
|
private void AddGridData(string parentValue)
|
|
{
|
|
string parentText = "新增分类";
|
|
string fieldValue = string.Empty;
|
|
string tableName = this.SysModel.MenuTable;
|
|
string Autogrowcolumn = BaseImpl.GetResult(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", tableName)) + "";
|
|
if (string.IsNullOrEmpty(tableName))
|
|
{
|
|
MessageUtil.Show(ResourceKeys.MenuTableNameIsNull);
|
|
return;
|
|
}
|
|
|
|
string insertSql = "insert into {0}({1}) values({2});";
|
|
string insertFields = string.Empty;
|
|
string insertValues = string.Empty;
|
|
|
|
DataColumnCollection columns = BaseImpl.GetTableColumns(tableName).Columns;
|
|
foreach (DataColumn col in columns)
|
|
{
|
|
// 区分大小写匹配列
|
|
DataRow hasContainRow = _gridColumns.Rows.Cast<DataRow>().FirstOrDefault(x => x["fieldname"] + "" == col.ColumnName);
|
|
if (hasContainRow != null)
|
|
{
|
|
string defaultValue = BaseImpl.GetDefaultValue(hasContainRow["defaultdate"] + "");
|
|
if (Autogrowcolumn.ToLower() == col.ColumnName.ToLower())
|
|
continue;
|
|
if (col.ColumnName != _parmaryKey)
|
|
fieldValue = defaultValue;
|
|
|
|
insertFields += col.ColumnName + ",";
|
|
|
|
if (col.ColumnName.Equals(treeLeft.TreeNodeKeyField))
|
|
insertValues += "'" + parentValue + "',";
|
|
else if (col.ColumnName.Equals(treeLeft.TreeNodeTextField))
|
|
insertValues += "'" + parentText + "',";
|
|
else
|
|
insertValues += string.IsNullOrWhiteSpace(defaultValue) ? "NULL," : "'" + defaultValue + "',";
|
|
}
|
|
}
|
|
|
|
|
|
if (_existsPid)
|
|
{
|
|
insertFields += insertFields.Contains("pid,") ? "" : "pid,";
|
|
insertValues += "'" + this.treeLeft.TreeView.SelectedNode.Tag + "" + "',";
|
|
|
|
|
|
string orderid = BaseImpl.GetResult(string.Format("select cast(isnull(max(orderid),0) as int)+1 orderid from {0} where pid='{1}'", this.SysModel.MenuTable, this.treeLeft.TreeView.SelectedNode.Tag + "")) + "";
|
|
if (string.IsNullOrEmpty(orderid)) orderid = "1";
|
|
insertFields += insertFields.Contains("orderid,") ? "" : "orderid,";
|
|
insertValues += "'" + orderid + "',";
|
|
}
|
|
|
|
insertFields = insertFields.TrimEnd(',');
|
|
insertValues = insertValues.TrimEnd(',');
|
|
|
|
BaseSaveModel model = new BaseSaveModel()
|
|
{
|
|
MenuCode = this.Model.ModuleCode,
|
|
TableName = tableName,
|
|
KeyField = _parmaryKey,
|
|
BaseSaveType = SaveType.Add,
|
|
FieldValue = fieldValue,
|
|
BaseSql = string.Format(insertSql, tableName, insertFields, insertValues)
|
|
};
|
|
|
|
List<BaseSaveModel> mList = new List<BaseSaveModel>();
|
|
mList.Add(model);
|
|
|
|
try
|
|
{
|
|
string retuenMsg = "";
|
|
// 批量保存数据
|
|
if (BaseModuleImpl.SaveBaseGridData(mList))
|
|
{
|
|
//MessageUtil.Show(ResourceKeys.SaveSuccess);
|
|
|
|
TreeNode selectedNode = this.treeLeft.TreeView.SelectedNode;
|
|
TreeNode treeNode = selectedNode.Nodes.Add(parentValue, parentText);
|
|
treeNode.Tag = parentValue;
|
|
selectedNode.Expand();
|
|
|
|
this.SearchLastGridView(this.treeLeft.GetSelectNodeValue());
|
|
}
|
|
else
|
|
{
|
|
if (mList != null && mList.Count > 0)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SaveFault + mList[0].FaultMsg);
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SaveFault);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SaveFault);
|
|
//LogUtil.WriteError(ResourceKeys.BaseModule, ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:更新数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-04 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void UpdateGridData()
|
|
{
|
|
string tableName = this.SysModel.MenuTable;
|
|
string Autogrowcolumn = BaseImpl.GetResult(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", tableName)) + "";
|
|
if (string.IsNullOrEmpty(tableName))
|
|
{
|
|
MessageUtil.Show(ResourceKeys.MenuTableNameIsNull);
|
|
return;
|
|
}
|
|
List<BaseSaveModel> mList = new List<BaseSaveModel>();
|
|
DataRow[] modifiedRows = (gcMain.GridControl.DataSource as DataTable)
|
|
.Rows
|
|
.Cast<DataRow>()
|
|
.Where(x => x.RowState == DataRowState.Modified || x.RowState == DataRowState.Added)
|
|
.ToArray();
|
|
|
|
if (modifiedRows == null || modifiedRows.Length == 0)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.UnUpdateData);
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
DataColumnCollection columns = BaseImpl.GetTableColumns(tableName).Columns;
|
|
|
|
foreach (DataRow row in modifiedRows)
|
|
{
|
|
string updateSql = "update {0} set {1} where {2}='{3}';";
|
|
string updateFields = string.Empty;
|
|
|
|
BaseSaveModel model = new BaseSaveModel()
|
|
{
|
|
MenuCode = this.Model.ModuleCode,
|
|
TableName = tableName,
|
|
KeyField = _parmaryKey
|
|
};
|
|
|
|
foreach (DataColumn col in columns)
|
|
{
|
|
// 区分大小写匹配列
|
|
DataRow hasContainRow = _gridColumns.Rows.Cast<DataRow>().FirstOrDefault(x => x["fieldname"] + "" == col.ColumnName);
|
|
if (Autogrowcolumn.ToLower() == col.ColumnName.ToLower())
|
|
continue;
|
|
if (hasContainRow != null && col.ColumnName != _parmaryKey)
|
|
{
|
|
if (row.RowState == DataRowState.Modified)
|
|
{
|
|
updateFields += string.Format("{0}='{1}',", col.ColumnName, row[col.ColumnName]);
|
|
}
|
|
}
|
|
}
|
|
updateFields = updateFields.TrimEnd(',');
|
|
|
|
if (!string.IsNullOrEmpty(updateFields))
|
|
{
|
|
model.FieldValue = row[_parmaryKey] + "";
|
|
model.BaseSaveType = SaveType.Update;
|
|
model.BaseSql = string.Format(updateSql, tableName, updateFields, _parmaryKey, row[_parmaryKey]);
|
|
}
|
|
mList.Add(model);
|
|
}
|
|
|
|
try
|
|
{
|
|
string retuenMsg = "";
|
|
// 批量保存数据
|
|
if (BaseModuleImpl.SaveBaseGridData(mList))
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SaveSuccess);
|
|
|
|
// 更新左侧树结构
|
|
try
|
|
{
|
|
if (this.gcMain.GridView.Columns.ColumnByName(this.treeLeft.TreeNodeKeyField) != null &&
|
|
this.gcMain.GridView.Columns.ColumnByName(this.treeLeft.TreeNodeTextField) != null)
|
|
{
|
|
foreach (DataRow item in modifiedRows)
|
|
{
|
|
string nodeNo = item[this.treeLeft.TreeNodeKeyField] + "";
|
|
string nodeName = item[this.treeLeft.TreeNodeTextField] + "";
|
|
|
|
TreeNode[] nodes = this.treeLeft.TreeView.Nodes.Find(nodeNo, true);
|
|
|
|
if (nodes != null && nodes.Count() > 0)
|
|
{
|
|
nodes[0].Text = nodeName;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
this.SearchLastGridView(this.treeLeft.GetSelectNodeValue());
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SaveFault);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//MessageUtil.Show(ResourceKeys.SaveFault);
|
|
LogUtil.WriteError(ResourceKeys.BaseModule, ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:更新SpeciesNo</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期: </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void UpdateSpeciesNo(TreeNode selectNode, TreeNode node, string parentNode, string curNode, bool isChild = false)
|
|
{
|
|
DataTable table = BaseImpl.GetDataTableResult(string.Format("select * from {0} where ({1} like '{2}__' and {1}<>'{2}')", this.SysModel.MenuTable, this.treeLeft.TreeNodeKeyField, parentNode));
|
|
|
|
int index = 1;
|
|
string nextSpecNo = string.Empty;
|
|
|
|
|
|
if (table.Rows.Count == 0)
|
|
{
|
|
nextSpecNo = parentNode + "01";
|
|
}
|
|
else
|
|
{
|
|
foreach (DataRow item in table.Rows)
|
|
{
|
|
string speciesNo = item[this.treeLeft.TreeNodeKeyField] + "";
|
|
nextSpecNo = "0000" + (Convert.ToInt32(parentNode) + (index < 10 ? ("0" + index) : index + ""));
|
|
nextSpecNo = nextSpecNo.Substring(nextSpecNo.Length - speciesNo.Length, speciesNo.Length);
|
|
|
|
DataRow rowItem = table.Rows.Cast<DataRow>().FirstOrDefault(x => nextSpecNo.Equals(x[this.treeLeft.TreeNodeKeyField] + ""));
|
|
if (rowItem == null)
|
|
{
|
|
break;
|
|
}
|
|
index++;
|
|
}
|
|
}
|
|
|
|
if (index > table.Rows.Count && table.Rows.Count > 0)
|
|
{
|
|
string speciesNo = table.Rows[0][this.treeLeft.TreeNodeKeyField] + "";
|
|
nextSpecNo = "0000" + (Convert.ToInt32(parentNode) + (index < 10 ? ("0" + index) : index + ""));
|
|
nextSpecNo = nextSpecNo.Substring(nextSpecNo.Length - speciesNo.Length, speciesNo.Length);
|
|
}
|
|
|
|
if (isChild)
|
|
{
|
|
BaseImpl.ExecSqlValue(string.Format("update {0} set {1}='{2}',pid='{4}' where {1}='{3}'", this.SysModel.MenuTable, this.treeLeft.TreeNodeKeyField, nextSpecNo, curNode, parentNode));
|
|
}
|
|
else
|
|
{
|
|
BaseImpl.ExecSqlValue(string.Format("update {0} set {1}='{2}' where {1}='{3}'", this.SysModel.MenuTable, this.treeLeft.TreeNodeKeyField, nextSpecNo, curNode));
|
|
}
|
|
TreeNode[] nodes = this.treeLeft.TreeView.Nodes.Find(curNode, true);
|
|
if (nodes != null && nodes.Count() > 0)
|
|
{
|
|
nodes[0].Tag = nextSpecNo;
|
|
}
|
|
|
|
if (node.Nodes.Count > 0)
|
|
{
|
|
// 更新当前节点下子节点
|
|
foreach (TreeNode child in node.Nodes)
|
|
{
|
|
UpdateSpeciesNo(selectNode, child, nextSpecNo, child.Tag + "", true);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:右键菜单执行后刷新数据,刷新规则按照上一次查询条件刷新</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </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>
|
|
protected void OnGridViewRightCallBack(object sender, EventArgs e)
|
|
{
|
|
this.SearchLastGridView(this.treeLeft.GetSelectNodeValue());
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:表格拖动到树结构</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The e.</param>
|
|
protected void OnDragCompleted(object sender, GridDragTreeArgs e)
|
|
{
|
|
if (e.GridViewSelectRows == null || e.GridViewSelectRows.Length == 0 || e.SelectTreeNode == null) return;
|
|
|
|
if (_existsPid)
|
|
{
|
|
try
|
|
{
|
|
// 更新拖拽节点父节点
|
|
foreach (DataRow item in e.GridViewSelectRows)
|
|
{
|
|
string beforeNo = item[this.treeLeft.TreeNodeKeyField] + "";
|
|
string afterNo = e.SelectTreeNode.Tag + "";
|
|
TreeNode[] nodes = this.treeLeft.TreeView.Nodes.Find(beforeNo, true);
|
|
|
|
// 更新parentid
|
|
BaseImpl.ExecSqlValue(string.Format("update {0} set pid='{1}' where {2}='{3}'", this.SysModel.MenuTable, afterNo, this.treeLeft.TreeNodeKeyField, beforeNo));
|
|
|
|
string orderid = BaseImpl.GetResult(string.Format("select cast(isnull(max(orderid),0) as int)+1 orderid from {0} where pid='{1}'", this.SysModel.MenuTable, afterNo)) + "";
|
|
if (string.IsNullOrEmpty(orderid)) orderid = "1";
|
|
|
|
// 更新序号
|
|
BaseImpl.ExecSqlValue(string.Format("update {0} set orderid='{1}' where {3}='{2}'", SysModel.MenuTable, orderid, beforeNo, this.treeLeft.TreeNodeKeyField));
|
|
|
|
// 左侧树
|
|
if (nodes != null && nodes.Length > 0)
|
|
{
|
|
//// 更新SpeciesNo
|
|
//this.UpdateSpeciesNo(e.SelectTreeNode, nodes[0], afterNo, beforeNo);
|
|
|
|
this.treeLeft.DeleteTreeNode(null, nodes[0]);
|
|
// 增加左侧树节点
|
|
e.SelectTreeNode.Nodes.Add(nodes[0]);
|
|
}
|
|
}
|
|
// 刷新数据
|
|
this.SearchLastGridView(e.SelectTreeNode.Tag + "");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//MessageUtil.Show(ex.Message);
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (MessageUtil.Show(string.Format(ResourceKeys.DragSelectNode, e.SelectTreeNode.Text), MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
int[] records = new int[e.GridViewSelectRows.Length];
|
|
string fieldName = this._leftTreeRow["fieldName"] + "";
|
|
|
|
for (int i = 0; i < e.GridViewSelectRows.Length; i++)
|
|
{
|
|
DataRow item = e.GridViewSelectRows[i];
|
|
try
|
|
{
|
|
records[i] = BaseModuleImpl.UpdateRecord(this.SysModel.MenuTable, fieldName, e.SelectTreeNode.Tag + "", this._parmaryKey, item[this._parmaryKey] + "");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//MessageUtil.Show(ex);
|
|
LogHelper.Instance.WriteError(ex);
|
|
LogUtil.WriteError(ResourceKeys.BaseModule, ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
|
|
int successCount = records.Contains(1) ? records.Where(x => x == 1).Count() : 0;
|
|
int faultCount = records.Contains(0) ? records.Where(x => x == 0).Count() : 0;
|
|
|
|
MessageUtil.Show(string.Format(ResourceKeys.DragSuccessCount, successCount) + "\r\n" + string.Format(ResourceKeys.DragFaultCount, faultCount));
|
|
|
|
this.SearchLastGridView(this.treeLeft.GetSelectNodeValue());
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:树结构选中后</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-03 </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="TreeViewEventArgs"/> instance containing the event data.</param>
|
|
private void OnTreeNodeSelectAfter(object sender, TreeViewEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
//string parentValue = _existsPid ? BaseImpl.GetResult(string.Format("select pid from {0} where {1}='{2}'", this.SysModel.MenuTable, this.treeLeft.TreeNodeKeyField, )) + "" : this.treeLeft.GetSelectNodeValue();
|
|
this.lblSpeciesName.Text = e.Node.Text;
|
|
this.SearchLastGridView(this.treeLeft.GetSelectNodeValue());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:显示所有分类</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </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 OnShowAllButtonClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.SearchLastGridView();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:刷新数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </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 OnRefreshButtonClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.treeLeft.BindTreeView(BaseImpl.GetDataTableResult(this._leftTreeRow["fieldsql"] + ""), this.treeLeft.TreeNodeKeyField);
|
|
this.SearchLastGridView(this.treeLeft.TreeView.TopNode.Tag + "");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:添加数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </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 OnAddButtonClick(object sender, EventArgs e)
|
|
{
|
|
string maxSpeciesNo = "01";
|
|
TreeNode treeNode = null;
|
|
|
|
try
|
|
{
|
|
bool canAdd = string.IsNullOrEmpty(this.SysModel.AddCond);
|
|
if (!canAdd)
|
|
{
|
|
canAdd = Convert.ToBoolean(ReplaceHelper.ReplaceUserInfo(this.SysModel.AddCond));
|
|
}
|
|
|
|
if (canAdd)
|
|
{
|
|
if (this.treeLeft.TreeView.Nodes.Count > 0)
|
|
{
|
|
treeNode = this.treeLeft.TreeView.SelectedNode;
|
|
if (treeNode == null)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SelectTreeNodeIsNull);
|
|
return;
|
|
}
|
|
maxSpeciesNo = BaseSpecImpl.GetMaxSpeciesNo(this.SysModel.MenuTable, this.treeLeft.TreeNodeKeyField, treeNode.Name, this.treeLeft.TreeView.Nodes[0].Name);
|
|
}
|
|
|
|
if ("99".Equals(maxSpeciesNo))
|
|
{
|
|
MessageUtil.Show(ResourceKeys.ChildTreeNodeFlowOver);
|
|
return;
|
|
}
|
|
|
|
this.AddGridData(maxSpeciesNo);
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show(ResourceKeys.DisAddCond);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//MessageUtil.Show(ex);
|
|
LogHelper.Instance.WriteError(ex);
|
|
LogUtil.WriteError(ResourceKeys.BaseModule, ex); string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:删除数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </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 OnDeleteButtonClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
// 检查是否可以删除
|
|
DataRow rowItem = this.gcMain.GridView.GetFocusedDataRow();
|
|
if (rowItem == null)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.SelectDeleteRows);
|
|
return;
|
|
}
|
|
if (MessageUtil.Show(string.Format(ResourceKeys.DeleteRows, 1), MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
string parmaryValue = rowItem[this._parmaryKey] + "";
|
|
|
|
string nodeValue = rowItem[this.treeLeft.TreeNodeKeyField] + "";
|
|
if ("01".Equals(nodeValue))
|
|
{
|
|
MessageUtil.Show(ResourceKeys.UnableToDeleteFirstNode);
|
|
return;
|
|
}
|
|
// 检查当前选中节点是否还存在子节点
|
|
if (_existsPid)
|
|
{
|
|
if (BaseImpl.GetDataTableResult(string.Format("select 1 from {0} where pid='{1}'", this.SysModel.MenuTable, nodeValue)).Rows.Count > 0)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.UnableToDeleteContainerChildsNode);
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (BaseSpecImpl.GetNodeChildCount(this.SysModel.MenuTable, this.treeLeft.TreeNodeKeyField, nodeValue) > 1)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.UnableToDeleteContainerChildsNode);
|
|
return;
|
|
}
|
|
}
|
|
string deleteCond = this.SysModel.DeleteCond;
|
|
bool canDelete = string.IsNullOrEmpty(deleteCond);
|
|
|
|
if (!canDelete)
|
|
{
|
|
// 验证删除条件
|
|
deleteCond = ReplaceHelper.ReplaceRowParam(rowItem, deleteCond);
|
|
canDelete = BaseImpl.GetDefaultValue(deleteCond) == "1";
|
|
}
|
|
if (canDelete)
|
|
{
|
|
// 验证删除存储过程
|
|
string tipMsg = string.Empty;
|
|
|
|
int result = BaseImpl.VerifyCanDelete(this.Model.ModuleCode, parmaryValue, out tipMsg);
|
|
if (result != 1)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.DisDeleteCond + "\r\n" + tipMsg);
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show(ResourceKeys.DisDeleteCond);
|
|
return;
|
|
}
|
|
|
|
// 删除记录
|
|
int execResult = BaseSpecImpl.DeleteNode(this.SysModel.MenuTable, this._parmaryKey, parmaryValue);
|
|
if (execResult == 1)
|
|
{
|
|
TreeNode[] nodes = this.treeLeft.TreeView.Nodes.Find(nodeValue, true);
|
|
if (nodes.Length > 0)
|
|
this.treeLeft.TreeView.Nodes.Remove(nodes[0]);
|
|
|
|
//this.SearchLastGridView(this.treeLeft.GetSelectNodeValue());
|
|
int rowHandle = this.gcMain.GridView.FocusedRowHandle;
|
|
this.gcMain.GridView.DeleteRow(rowHandle);
|
|
MessageUtil.Show(ResourceKeys.DeleteSuccess);
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show(ResourceKeys.DataNotFount);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//MessageUtil.Show(ex);
|
|
LogHelper.Instance.WriteError(ex);
|
|
LogUtil.WriteError(ResourceKeys.BaseModule, ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:保存数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-02 </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 OnSaveButtonClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
DataRow[] nullFields = this._gridColumns.Select("nullable=1");
|
|
if (this.gcMain.GridView.ValidateNullRequired(nullFields))
|
|
{
|
|
this.UpdateGridData();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:导出Excel</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-12 </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>
|
|
private void OnExportClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.gcMain.GridControl.ToExcel(this.Model.FormText);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:手动刷新节点值</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-12-22 </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>
|
|
private void OnDataChage(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (InitializeTreeNode(2))
|
|
{
|
|
MessageUtil.Show("数据转换成功!");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogUtil.WriteError("数据转换出错!", ex);
|
|
//MessageUtil.Show("数据转换出错!" + ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
|
|
}
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
WebBrowserUtil.StartWebBrowser(this.Model.ModuleCode, this.SysModel.MenuText);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置分割条位置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-02-01 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
protected void InitlizeSpiltLocation()
|
|
{
|
|
try
|
|
{
|
|
string htight = IniHelper.Read(string.Format("PubSpec2_Wide_{0}", this.Model.ModuleCode));
|
|
if (!string.IsNullOrEmpty(htight))
|
|
{
|
|
|
|
this.scc_container.SplitterPosition = Convert.ToInt32(htight);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置分割条位置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-02-01 </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>
|
|
protected void OnSplitterMoved(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.Model != null)
|
|
{
|
|
|
|
IniHelper.Write(string.Format("PubSpec2_Wide_{0}", this.Model.ModuleCode), this.scc_container.SplitterPosition + "");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|