5 Commits

Author SHA1 Message Date
cyf 6be6607a40 提交当前本机最新程序 2026-07-16 16:05:38 +08:00
cyf 43ae774164 来源主表拖拽时判断是否为快速拖拽 2026-07-14 18:03:12 +08:00
cyf 326fccf8fe 主界面左侧菜单相关 2026-07-14 18:03:09 +08:00
cyf 5042f2c8c2 主界面左侧菜单相关 2026-07-14 18:03:06 +08:00
cyf 57ff1ea406 主界面左侧菜单相关 2026-07-14 18:03:02 +08:00
48 changed files with 8323 additions and 410 deletions
+4 -4
View File
@@ -38,13 +38,13 @@ namespace NewMyFormDesigner
//myFormDesigner.Password = "DWlserp1101";//XDerp20210411%
//MessageBox.Show(args.Length + "");
//MessageBox.Show(args[0]);
//MessageBox.Show("1:"+args[0]);
//System.Windows.Forms.Clipboard.SetText(args[0]);
//MessageBox.Show(args[1]);
//MessageBox.Show("2:"+args[1]);
//System.Windows.Forms.Clipboard.SetText(args[1]);
//MessageBox.Show(args[2]);
//MessageBox.Show("3:" + args[2]);
//System.Windows.Forms.Clipboard.SetText(args[2]);
//MessageBox.Show(args[3]);
//MessageBox.Show("4:" + args[3]);
//--------------------------------------------
myFormDesigner.FrmKey = args[0];
@@ -1375,6 +1375,18 @@ namespace Lskj.Business.Impl
return GetDataTableResult(sqlValue);
}
/// <summary>
/// 获取基础档案附加信息,用formKey查询
/// </summary>
/// <param name="tabKey"></param>
/// <returns></returns>
public static DataTable GetBaseAttachKey(string tabKey)
{
string sqlValue = string.Format(@"select * from p_SystemdllTabAttach where tabKey='{0}' and ISNULL(isVisible,0)=0 order by orderid", tabKey);
return GetDataTableResult(sqlValue);
}
/// <summary>
/// <para>说明:判断存储过程参数方法</para>
+7 -5
View File
@@ -72,11 +72,14 @@ namespace Lskj.Business.Impl
maxNum += "9";
}
string sqlValue = string.Format("select max(cast({1} as bigint))+1 from {0} where {1} like '{2}{3}'", tableName, parentKey, parentValue, maxdivision);
// SpeciesNo是层级编码,完整编码可能超过bigint范围,只对当前节点编号进行数值运算。
string sqlValue = string.Format("select max(cast(right({1},{4}) as bigint))+1 from {0} where {1} like '{2}{3}'", tableName, parentKey, parentValue, maxdivision, firstNode.Length);
string maxNo = GetResult(sqlValue) + "";
if (string.IsNullOrWhiteSpace(maxNo))
maxNo = parentValue + PrefixNum+"1";
else
maxNo = parentValue + maxNo.PadLeft(firstNode.Length, '0');
maxNo = maxNo.PadLeft(parentValue.Length + firstNode.Length, '0');
if ((PrefixNum + "0").Equals(maxNo.Substring(maxNo.Length - firstNode.Length)))
@@ -87,11 +90,11 @@ namespace Lskj.Business.Impl
return maxNum;
// 取未使用的编号
sqlValue = string.Format("select cast({1} as bigint) as SpeciesNo from {0} where {1} like '{2}{3}' order by {1}", tableName, parentKey, parentValue,maxdivision);
sqlValue = string.Format("select cast(right({1},{4}) as bigint) as SpeciesNo from {0} where {1} like '{2}{3}' order by SpeciesNo", tableName, parentKey, parentValue,maxdivision, firstNode.Length);
DataTable table = GetDataTableResult(sqlValue);
Int64 speciesNo = table.Rows.Count > 0 ? Convert.ToInt64(table.Rows[0]["SpeciesNo"] + "") : 0;
if (speciesNo != Int64.Parse(parentValue + PrefixNum+"1"))
if (speciesNo != 1)
return parentValue +PrefixNum+"1";;
foreach (DataRow item in table.Rows)
@@ -101,8 +104,7 @@ namespace Lskj.Business.Impl
if (rowSpeciesNo != speciesNo + 1)
{
maxNo = (speciesNo + 1).ToString();
maxNo = maxNo.PadLeft(parentValue.Length + firstNode.Length, '0');
maxNo = parentValue + (speciesNo + 1).ToString().PadLeft(firstNode.Length, '0');
break;
}
@@ -328,6 +328,8 @@ namespace Lskj.Business
Instance.EnableSpecialInfoProcess = item.Table.Columns.Contains("EnableSpecialInfoProcess") && !string.IsNullOrEmpty(item["EnableSpecialInfoProcess"] + "") ? "1".Equals(item["EnableSpecialInfoProcess"] + "") : false;
Instance.SourceFilteringMobile = item.Table.Columns.Contains("SourceFilteringMobile") && !string.IsNullOrEmpty(item["SourceFilteringMobile"] + "") ? "1".Equals(item["SourceFilteringMobile"] + "") : false;
Instance.LoginUsername = item.Table.Columns.Contains("LoginUsername") && !string.IsNullOrEmpty(item["LoginUsername"] + "") ? item["LoginUsername"] + "" : "";
Instance.MainLeftShowMode = item.Table.Columns.Contains("MainLeftShowMode") && !string.IsNullOrEmpty(item["MainLeftShowMode"] + "") ? item["MainLeftShowMode"] + "" : "";
Instance.DeadlockPrompt = item.Table.Columns.Contains("DeadlockPrompt") && !string.IsNullOrEmpty(item["DeadlockPrompt"] + "") ? item["DeadlockPrompt"] + "" : "";
}
/// <summary>
/// 高拍仪AccessKey
@@ -1144,6 +1146,14 @@ namespace Lskj.Business
///登录界面,用户名显示字段
/// </summary>
public string LoginUsername;
/// <summary>
/// 主界面左侧树展示模式
/// </summary>
public string MainLeftShowMode;
/// <summary>
/// 死锁提示
/// </summary>
public string DeadlockPrompt;
}
}
@@ -2913,7 +2913,7 @@ namespace Lskj.Control
int[] rows = this.bandedGridView.GetSelectedRows();
// 只判断单元格数目,允许同行多单元格选中
this.pl_buttom.Visible = cells.Length > 1;
this.pl_buttom.Visible = cells.Length > 1 && rows.Length > 1;
if (this.pl_buttom.Visible)
{
+618 -1
View File
@@ -192,6 +192,30 @@ namespace Lskj.Control
/// </summary>
public Dictionary<GridColumnModel, Task<DataTable>> mControlSourceDic = new Dictionary<GridColumnModel, Task<DataTable>>();
/// <summary>
/// 字典搜索框数据源缓存,只用于弹出下拉框时临时绑定,避免表格滚动时控件持有大数据源。
/// </summary>
private Dictionary<string, DataTable> mSpecialReturnSourceDic = new Dictionary<string, DataTable>();
/// <summary>
/// 字典搜索框后台加载任务缓存。
/// </summary>
private Dictionary<string, Task<DataTable>> mSpecialReturnSourceTaskDic = new Dictionary<string, Task<DataTable>>();
/// <summary>
/// 字典搜索框显示文本缓存,表格显示时按单元格值快速转换为显示文本。
/// </summary>
private Dictionary<string, Dictionary<string, string>> mSpecialReturnDisplayDic = new Dictionary<string, Dictionary<string, string>>();
/// <summary>
/// 字典搜索框编辑器缓存,进入编辑状态时再替换为搜索框控件。
/// </summary>
private Dictionary<string, RepositoryItemGridLookUpEdit> mSpecialReturnEditDic = new Dictionary<string, RepositoryItemGridLookUpEdit>();
/// <summary>
/// 字典搜索框显示文本事件是否已绑定。
/// </summary>
private bool mSpecialReturnDisplayEventAttached = false;
/// <summary>
/// 字典搜索框编辑器替换事件是否已绑定。
/// </summary>
private bool mSpecialReturnEditEventAttached = false;
/// <summary>
/// 计算值
/// </summary>
public decimal customSum;
@@ -995,7 +1019,7 @@ namespace Lskj.Control
return;
}
if (!string.IsNullOrEmpty(model.SqlSource) && !ControlType.IsNotLoadData(model.FieldType))
if (!string.IsNullOrEmpty(model.SqlSource) && !ControlType.IsNotLoadData(model.FieldType) && !IsSpecialReturnBox(model.FieldType))
{
Task<DataTable> sourceTask = new Task<DataTable>(() =>
{
@@ -1191,6 +1215,12 @@ namespace Lskj.Control
case ControlType.LabModuleAddRowsText:
InitModuleReturnLine(column, model);
break;
case ControlType.DictionarySearchBoxToId:
case ControlType.DictionarySearchBoxToText:
case ControlType.DictionarySearchBoxToIdParam:
case ControlType.DictionarySearchBoxToTextParam:
InitSpecialReturn(column, model);
break;
default:
break;
}
@@ -1201,6 +1231,567 @@ namespace Lskj.Control
}
}
/// <summary>
/// 初始化字典搜索框。表格显示阶段使用文本编辑器,进入编辑状态时再切换为搜索框。
/// </summary>
private void InitSpecialReturn(GridColumn column, GridColumnModel model)
{
RepositoryItemGridLookUpEdit searchEdit = CreateSpecialReturnSearchEdit(model);
RepositoryItemTextEdit textEdit = new RepositoryItemTextEdit();
gridControl.RepositoryItems.Add(textEdit);
gridControl.RepositoryItems.Add(searchEdit);
column.ColumnEdit = textEdit;
mSpecialReturnEditDic[model.FieldName] = searchEdit;
this.mControlList.Add(model);
StartSpecialReturnSourceTask(model);
if (!mSpecialReturnDisplayEventAttached)
{
this.gridView.CustomColumnDisplayText += GridView_CustomColumnDisplayText_SpecialReturn;
mSpecialReturnDisplayEventAttached = true;
}
if (!mSpecialReturnEditEventAttached)
{
this.gridView.CustomRowCellEditForEditing += GridView_CustomRowCellEditForEditing_SpecialReturn;
mSpecialReturnEditEventAttached = true;
}
}
/// <summary>
/// 判断是否为字典搜索框类型。
/// </summary>
private static bool IsSpecialReturnBox(int fieldType)
{
return fieldType == ControlType.DictionarySearchBoxToId
|| fieldType == ControlType.DictionarySearchBoxToText
|| fieldType == ControlType.DictionarySearchBoxToIdParam
|| fieldType == ControlType.DictionarySearchBoxToTextParam;
}
/// <summary>
/// 判断字典搜索框是否保存显示文本。
/// </summary>
private static bool IsSpecialReturnTextBox(int fieldType)
{
return fieldType == ControlType.DictionarySearchBoxToText
|| fieldType == ControlType.DictionarySearchBoxToTextParam;
}
/// <summary>
/// 判断字典搜索框是否为带参数类型。
/// </summary>
private static bool IsSpecialReturnParamBox(int fieldType)
{
return fieldType == ControlType.DictionarySearchBoxToIdParam
|| fieldType == ControlType.DictionarySearchBoxToTextParam;
}
/// <summary>
/// 创建字典搜索框编辑器。
/// </summary>
private RepositoryItemGridLookUpEdit CreateSpecialReturnSearchEdit(GridColumnModel model)
{
RepositoryItemGridLookUpEdit searchEdit = new RepositoryItemGridLookUpEdit();
if (model.FontSize > 0) searchEdit.View.Appearance.Row.Font = new Font("微软雅黑", model.FontSize);
searchEdit.View.OptionsView.ShowIndicator = false;
searchEdit.View.OptionsView.ColumnAutoWidth = false;
searchEdit.PopupSizeable = true;
searchEdit.PopupResizeMode = ResizeMode.Default;
searchEdit.AllowFocused = true;
searchEdit.ImmediatePopup = true;
searchEdit.ShowFooter = false;
searchEdit.NullText = "";
searchEdit.TextEditStyle = TextEditStyles.Standard;
searchEdit.PopupBorderStyle = PopupBorderStyles.Flat;
searchEdit.AllowNullInput = DefaultBoolean.False;
searchEdit.ShowPopupShadow = true;
searchEdit.DisplayMember = model.TextMember;
searchEdit.ValueMember = IsSpecialReturnTextBox(model.FieldType) ? model.TextMember : model.ValueMember;
searchEdit.Tag = model;
searchEdit.View.Tag = searchEdit;
searchEdit.View.Appearance.HeaderPanel.TextOptions.HAlignment = HorzAlignment.Center;
searchEdit.View.PopupMenuShowing += new PopupMenuShowingEventHandler(OnAutoSearchEditPopupMenuShowing);
searchEdit.KeyDown += OnsearchEditKeyDown;
searchEdit.QueryPopUp += SpecialReturnEdit_QueryPopUp;
searchEdit.CloseUp += SpecialReturnEdit_CloseUp;
searchEdit.Closed += SpecialReturnEdit_Closed;
searchEdit.CustomDisplayText += SpecialReturnEdit_CustomDisplayText;
searchEdit.EditValueChanging += gridLookUpEdit1_EditValueChanging;
searchEdit.View.CustomDrawFilterPanel += OnCustomDrawFilterPanel;
GridColumn valueColumn = new GridColumn();
valueColumn.Name = valueColumn.FieldName = model.ValueMember;
valueColumn.Caption = "编码";
valueColumn.Visible = model.ValueMember.Substring(0, 1) != "_";
GridColumn textColumn = new GridColumn();
textColumn.Name = textColumn.FieldName = model.TextMember;
textColumn.Caption = "名称";
textColumn.Visible = model.TextMember.Substring(0, 1) != "_";
searchEdit.View.Columns.AddRange(new GridColumn[] { valueColumn, textColumn });
return searchEdit;
}
/// <summary>
/// 字典搜索框显示文本事件,表格滚动显示时只查字典,不绑定下拉框大数据源。
/// </summary>
private void GridView_CustomColumnDisplayText_SpecialReturn(object sender, CustomColumnDisplayTextEventArgs e)
{
try
{
GridColumnModel model = e.Column.Tag as GridColumnModel;
if (model == null || !IsSpecialReturnBox(model.FieldType)) return;
string value = e.Value + "";
if (string.IsNullOrWhiteSpace(value)) return;
string displayText = string.Empty;
bool sourceReady = EnsureSpecialReturnSourceReady(model);
if (TryGetSpecialReturnDisplayText(model, value, out displayText))
{
e.DisplayText = displayText;
}
else if (sourceReady)
{
e.DisplayText = string.Empty;
}
}
catch
{
}
}
/// <summary>
/// 字典搜索框编辑器替换事件,只有进入编辑状态时才使用搜索框控件。
/// </summary>
private void GridView_CustomRowCellEditForEditing_SpecialReturn(object sender, CustomRowCellEditEventArgs e)
{
GridColumnModel model = e.Column.Tag as GridColumnModel;
if (model == null || !IsSpecialReturnBox(model.FieldType)) return;
if (mSpecialReturnEditDic.ContainsKey(model.FieldName))
{
RepositoryItemGridLookUpEdit searchEdit = mSpecialReturnEditDic[model.FieldName];
BindSpecialReturnCurrentValue(searchEdit, model, this.gridView.GetRowCellValue(e.RowHandle, e.Column));
e.RepositoryItem = searchEdit;
}
}
/// <summary>
/// 字典搜索框编辑态显示文本事件,避免编辑器未绑定数据源时当前值显示为空。
/// </summary>
private void SpecialReturnEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
{
RepositoryItemGridLookUpEdit edit = sender as RepositoryItemGridLookUpEdit;
if (edit == null || e.Value == null) return;
GridColumnModel model = edit.Tag as GridColumnModel;
if (model == null || !IsSpecialReturnBox(model.FieldType)) return;
string value = e.Value + "";
if (string.IsNullOrWhiteSpace(value)) return;
string displayText = string.Empty;
bool sourceReady = EnsureSpecialReturnSourceReady(model);
if (TryGetSpecialReturnDisplayText(model, value, out displayText))
{
e.DisplayText = displayText;
}
else if (sourceReady)
{
e.DisplayText = string.Empty;
}
}
/// <summary>
/// 字典搜索框弹出事件。普通类型使用缓存数据源,带参数类型按当前行条件重新查询。
/// </summary>
private void SpecialReturnEdit_QueryPopUp(object sender, CancelEventArgs e)
{
try
{
GridLookUpEdit edit = sender as GridLookUpEdit;
if (edit == null) return;
GridColumnModel model = edit.Properties.Tag as GridColumnModel;
if (model == null) return;
CurrentOperColumnKey = Model.ModuleCode + "_" + model.FieldName;
CurrentOperModel = model;
DataTable table = IsSpecialReturnParamBox(model.FieldType) ? GetSpecialReturnParamSourceTable(model) : GetSpecialReturnSourceTable(model);
if (IsSpecialReturnParamBox(model.FieldType))
{
AddSpecialReturnManualData(model, table);
}
edit.Properties.DataSource = table;
AddSpecialReturnViewColumns(edit.Properties, table, model);
SetSpecialReturnPopupWidth(edit.Properties, table, model);
CacheSpecialReturnDisplayValues(model, table);
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex, Model.ModuleCode);
MessageUtil.Show(Message, ex.Message);
}
}
/// <summary>
/// 字典搜索框关闭选择事件,把本次选择结果补入显示字典。
/// </summary>
private void SpecialReturnEdit_CloseUp(object sender, CloseUpEventArgs e)
{
try
{
GridLookUpEdit edit = sender as GridLookUpEdit;
if (edit == null) return;
GridColumnModel model = edit.Properties.Tag as GridColumnModel;
if (model == null || e.Value == null) return;
DataTable table = edit.Properties.DataSource as DataTable;
if (table == null) return;
string value = e.Value + "";
string valueMember = IsSpecialReturnTextBox(model.FieldType) ? model.TextMember : model.ValueMember;
if (!table.Columns.Contains(valueMember) || !table.Columns.Contains(model.TextMember)) return;
DataRow row = table.Rows.Cast<DataRow>().FirstOrDefault(item => (item[valueMember] + "").Equals(value));
if (row != null)
{
GetSpecialReturnDisplayDic(model)[value] = row[model.TextMember] + "";
}
edit.EditValue = e.Value;
GridColumn column = this.gridView.Columns[model.FieldName];
if (column != null)
{
this.gridView.SetFocusedRowCellValue(column, e.Value);
}
this.gridView.PostEditor();
this.gridView.UpdateCurrentRow();
}
catch
{
}
}
/// <summary>
/// 字典搜索框关闭后清空临时数据源,避免编辑器长期持有大量数据。
/// </summary>
private void SpecialReturnEdit_Closed(object sender, ClosedEventArgs e)
{
GridLookUpEdit edit = sender as GridLookUpEdit;
if (edit != null)
{
edit.Properties.DataSource = null;
}
}
/// <summary>
/// 获取字典搜索框初始化数据源,用于普通弹出和显示字典缓存。
/// </summary>
private DataTable GetSpecialReturnSourceTable(GridColumnModel model)
{
string key = model.FieldName;
if (mSpecialReturnSourceDic.ContainsKey(key))
{
return mSpecialReturnSourceDic[key];
}
if (mSpecialReturnSourceTaskDic.ContainsKey(key))
{
DataTable taskTable = mSpecialReturnSourceTaskDic[key].Result;
mSpecialReturnSourceDic[key] = taskTable;
CacheSpecialReturnDisplayValues(model, taskTable);
return taskTable;
}
DataTable table = BaseImpl.GetDataTableResult(model.SqlSource);
mSpecialReturnSourceDic[key] = table;
CacheSpecialReturnDisplayValues(model, table);
return table;
}
/// <summary>
/// 获取带参数字典搜索框弹出数据源,逻辑与原带参数搜索框弹出查询保持一致。
/// </summary>
private DataTable GetSpecialReturnParamSourceTable(GridColumnModel model)
{
DataRow[] dataRows = this.GetViewFocusedDataRows();
DataRow rowItem = dataRows.Count() > 0 ? dataRows[0] : this.gridView.GetFocusedDataRow();
if (rowItem == null && this.ParentControl == null)
{
return GetSpecialReturnSourceTable(model);
}
string sqlValue = model.SqlSource;
if (this.ParentControl != null)
sqlValue = this.ParentControl.ReplaceParentControlValue(sqlValue);
sqlValue = sqlValue.Replace("#", "");
if (rowItem != null)
{
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
}
return MainImpl.GetDataTableResult(sqlValue);
}
/// <summary>
/// 带参数字典搜索框保存文本时,把手动新增的数据追加到本次弹出数据源。
/// </summary>
private void AddSpecialReturnManualData(GridColumnModel model, DataTable table)
{
if (model == null || table == null || !model.SearchBoxAddition || !IsSpecialReturnTextBox(model.FieldType)) return;
if (!this.ManuallyAddData.ContainsKey(model.FieldName)) return;
List<DataRow> dataRows = this.ManuallyAddData[model.FieldName];
foreach (DataRow row in dataRows)
{
DataRow newrow = table.NewRow();
newrow.ItemArray = row.ItemArray;
table.Rows.Add(newrow);
}
}
/// <summary>
/// 后台加载字典搜索框数据源并建立显示字典。
/// </summary>
private void StartSpecialReturnSourceTask(GridColumnModel model)
{
if (model == null || string.IsNullOrWhiteSpace(model.SqlSource) || mSpecialReturnSourceTaskDic.ContainsKey(model.FieldName)) return;
Task<DataTable> sourceTask = new Task<DataTable>(() =>
{
return BaseImpl.GetDataTableResult(model.SqlSource);
});
sourceTask.ContinueWith(task =>
{
if (task.Status != TaskStatus.RanToCompletion || task.Result == null) return;
if (this.IsDisposed || !this.IsHandleCreated) return;
this.BeginInvoke(new MethodInvoker(delegate ()
{
if (this.IsDisposed) return;
mSpecialReturnSourceDic[model.FieldName] = task.Result;
CacheSpecialReturnDisplayValues(model, task.Result);
gridView.Invalidate();
}));
});
mSpecialReturnSourceTaskDic.Add(model.FieldName, sourceTask);
sourceTask.Start(DataTableExtend.SchedulerUtil);
}
/// <summary>
/// 获取字段对应的显示文本字典。
/// </summary>
private Dictionary<string, string> GetSpecialReturnDisplayDic(GridColumnModel model)
{
if (!mSpecialReturnDisplayDic.ContainsKey(model.FieldName))
{
mSpecialReturnDisplayDic[model.FieldName] = new Dictionary<string, string>();
}
return mSpecialReturnDisplayDic[model.FieldName];
}
/// <summary>
/// 确认字典搜索框数据源是否已加载;后台任务已完成但回调未执行时,在这里补建显示字典。
/// </summary>
private bool EnsureSpecialReturnSourceReady(GridColumnModel model)
{
if (model == null) return false;
if (mSpecialReturnSourceDic.ContainsKey(model.FieldName)) return true;
Task<DataTable> sourceTask = null;
if (!mSpecialReturnSourceTaskDic.TryGetValue(model.FieldName, out sourceTask)) return false;
if (!sourceTask.IsCompleted) return false;
if (sourceTask.Status == TaskStatus.RanToCompletion && sourceTask.Result != null)
{
mSpecialReturnSourceDic[model.FieldName] = sourceTask.Result;
CacheSpecialReturnDisplayValues(model, sourceTask.Result);
}
return true;
}
/// <summary>
/// 把数据源中的值和显示文本缓存到字典中。
/// </summary>
private void CacheSpecialReturnDisplayValues(GridColumnModel model, DataTable table)
{
if (table == null || !table.Columns.Contains(model.ValueMember) || !table.Columns.Contains(model.TextMember)) return;
Dictionary<string, string> displayDic = GetSpecialReturnDisplayDic(model);
foreach (DataRow row in table.Rows)
{
string value = IsSpecialReturnTextBox(model.FieldType) ? row[model.TextMember] + "" : row[model.ValueMember] + "";
if (!string.IsNullOrWhiteSpace(value) && !displayDic.ContainsKey(value))
{
displayDic.Add(value, row[model.TextMember] + "");
}
}
}
/// <summary>
/// 根据单元格保存值获取显示文本。
/// </summary>
private string GetSpecialReturnDisplayText(GridColumnModel model, string value)
{
Dictionary<string, string> displayDic = GetSpecialReturnDisplayDic(model);
string[] values = value.Trim(',').Split(',');
StringBuilder result = new StringBuilder();
foreach (string item in values)
{
string key = (item + "").Trim();
if (string.IsNullOrWhiteSpace(key)) continue;
string displayText = string.Empty;
result.Append(displayDic.TryGetValue(key, out displayText) ? displayText : key);
result.Append(",");
}
return result.ToString().TrimEnd(',');
}
/// <summary>
/// 严格按字典获取显示文本,字典中不存在时返回false。
/// </summary>
private bool TryGetSpecialReturnDisplayText(GridColumnModel model, string value, out string displayText)
{
displayText = string.Empty;
Dictionary<string, string> displayDic = GetSpecialReturnDisplayDic(model);
string[] values = value.Trim(',').Split(',');
StringBuilder result = new StringBuilder();
foreach (string item in values)
{
string key = (item + "").Trim();
if (string.IsNullOrWhiteSpace(key)) continue;
string itemText = string.Empty;
if (!displayDic.TryGetValue(key, out itemText)) return false;
result.Append(itemText);
result.Append(",");
}
displayText = result.ToString().TrimEnd(',');
return !string.IsNullOrWhiteSpace(displayText);
}
/// <summary>
/// 进入编辑态时只给当前有效值绑定一行临时数据,避免未弹出下拉框时显示为空。
/// </summary>
private void BindSpecialReturnCurrentValue(RepositoryItemGridLookUpEdit searchEdit, GridColumnModel model, object cellValue)
{
if (searchEdit == null || model == null || cellValue == null) return;
string value = cellValue + "";
if (string.IsNullOrWhiteSpace(value)) return;
string displayText = string.Empty;
bool sourceReady = EnsureSpecialReturnSourceReady(model);
if (!TryGetSpecialReturnDisplayText(model, value, out displayText))
{
if (sourceReady)
{
searchEdit.DataSource = null;
return;
}
displayText = value;
}
DataTable table = new DataTable();
if (!table.Columns.Contains(model.ValueMember)) table.Columns.Add(model.ValueMember);
if (!table.Columns.Contains(model.TextMember)) table.Columns.Add(model.TextMember);
DataRow row = table.NewRow();
row[model.ValueMember] = IsSpecialReturnTextBox(model.FieldType) ? displayText : value;
row[model.TextMember] = displayText;
table.Rows.Add(row);
searchEdit.DataSource = table;
}
/// <summary>
/// 根据弹出数据源补充搜索框显示列。
/// </summary>
private void AddSpecialReturnViewColumns(RepositoryItemGridLookUpEdit searchEdit, DataTable table, GridColumnModel model)
{
if (searchEdit == null || table == null) return;
foreach (DataColumn dcol in table.Columns)
{
if (string.IsNullOrEmpty(dcol.ColumnName) || dcol.ColumnName.Substring(0, 1) == "_") continue;
if (searchEdit.View.Columns.FirstOrDefault(item => item.FieldName == dcol.ColumnName) != null) continue;
GridColumn otherColumn = new GridColumn();
otherColumn.Name = otherColumn.FieldName = otherColumn.Caption = dcol.ColumnName;
otherColumn.Visible = true;
searchEdit.View.Columns.Add(otherColumn);
}
}
/// <summary>
/// 设置字典搜索框弹出宽度,规则与普通自动搜索框保持一致。
/// </summary>
private void SetSpecialReturnPopupWidth(RepositoryItemGridLookUpEdit searchEdit, DataTable table, GridColumnModel model)
{
if (searchEdit == null || table == null || model == null) return;
int popWidth = 0;
string[] columnsWidth = !string.IsNullOrWhiteSpace(model.LookUpFieldsWidth) ? model.LookUpFieldsWidth.Trim().TrimEnd(',').Split(',') : null;
if (columnsWidth != null && columnsWidth.Length > 0)
{
int columnWidthIndex = 0;
foreach (DataColumn dcol in table.Columns)
{
if (!string.IsNullOrEmpty(dcol.ColumnName) && dcol.ColumnName.Substring(0, 1) != "_")
{
GridColumn gCol = searchEdit.View.Columns.FirstOrDefault(x => x.FieldName == dcol.ColumnName);
if (gCol != null)
{
int width = 0;
if (columnWidthIndex < columnsWidth.Length)
{
string widthStr = columnsWidth[columnWidthIndex];
width = int.TryParse(widthStr, out width) ? width : GraphicsText.GetTextWidth(gCol.Caption);
}
else
{
width = GraphicsText.GetTextWidth(gCol.Caption);
int maxWidth = CalcMaxColumnWidth(table, gCol.Name);
width = width > maxWidth ? width : maxWidth;
}
gCol.Width = width;
popWidth += gCol.Width;
}
}
columnWidthIndex++;
}
}
else
{
foreach (DataColumn dcol in table.Columns)
{
if (string.IsNullOrEmpty(dcol.ColumnName) || dcol.ColumnName.Substring(0, 1) == "_") continue;
GridColumn gCol = searchEdit.View.Columns.FirstOrDefault(x => x.FieldName == dcol.ColumnName);
if (gCol != null)
{
int columnWidth = GraphicsText.GetTextWidth(gCol.Caption);
gCol.Width = CalcMaxColumnWidth(table, gCol.Name);
gCol.Width = columnWidth > gCol.Width ? columnWidth : gCol.Width;
popWidth += gCol.Width;
}
}
}
if (model.LookUpWidth > 0)
{
popWidth = model.LookUpWidth + 5;
}
searchEdit.PopupFormSize = new Size(popWidth, searchEdit.PopupFormSize.Height);
}
/// <summary>
@@ -1457,6 +2048,7 @@ namespace Lskj.Control
{
if (this.DisableFieldSources && item.isVislble) continue;
if (ControlType.IsNotLoadData(item.FieldType)) continue;
if (IsSpecialReturnBox(item.FieldType)) continue;
if (UpdateColumnRefresh && !string.IsNullOrWhiteSpace(UpdateColumns) && !UpdateColumns.Split(',').Contains(item.FieldName)) continue;
if (!string.IsNullOrWhiteSpace(item.SqlSource))
{
@@ -4573,6 +5165,11 @@ namespace Lskj.Control
if (SystemInfo.Instance.DisableCellAutoFiltering && edit.Properties != null) edit.Properties.AutoComplete = false;//设置是否启用自动完成功能
RepositoryItemGridLookUpEdit searchEdit = edit.Properties;
DataTable dt = (searchEdit.DataSource as DataTable);
GridColumnModel model = searchEdit.Tag as GridColumnModel;
if (dt == null && model != null && IsSpecialReturnBox(model.FieldType))
{
return;
}
BeginInvoke(new MethodInvoker(delegate ()
{
FilterLookup(sender, e.NewValue + "");
@@ -8165,6 +8762,8 @@ namespace Lskj.Control
Tag = normalCol,
OptionsColumn = { AllowEdit = normalCol.Edit, FixedWidth = true }
};
col.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
col.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
if (!normalCol.Edit)
{
col.AppearanceHeader.Options.UseForeColor = true;
@@ -8213,6 +8812,7 @@ namespace Lskj.Control
BandedGridColumn subColumn = new BandedGridColumn
{
Name = dynamicFieldName,
FieldName = dynamicFieldName,
Caption = subCaption,
Width = subField.Width,
@@ -8222,6 +8822,8 @@ namespace Lskj.Control
MaxWidth = subField.Width,
OptionsColumn = { AllowEdit = subField.Edit, FixedWidth = true }
};
subColumn.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
subColumn.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
if (!subField.Edit)
{
subColumn.AppearanceHeader.Options.UseForeColor = true;
@@ -8302,6 +8904,8 @@ namespace Lskj.Control
Tag = normalCol,
OptionsColumn = { AllowEdit = normalCol.Edit, FixedWidth = true }
};
col.OptionsFilter.AutoFilterCondition = DevExpress.XtraTreeList.Columns.AutoFilterCondition.Contains;
col.OptionsFilter.FilterPopupMode = DevExpress.XtraTreeList.FilterPopupMode.CheckedList;
if (!normalCol.Edit)
{
col.AppearanceHeader.Options.UseForeColor = true;
@@ -8355,6 +8959,7 @@ namespace Lskj.Control
DevExpress.XtraTreeList.Columns.TreeListColumn subColumn = new DevExpress.XtraTreeList.Columns.TreeListColumn
{
Name = dynamicFieldName,
FieldName = dynamicFieldName,
Caption = subCaption,
Width = subField.Width,
@@ -8363,6 +8968,8 @@ namespace Lskj.Control
MinWidth = subField.Width,
OptionsColumn = { AllowEdit = subField.Edit, FixedWidth = true }
};
subColumn.OptionsFilter.AutoFilterCondition = DevExpress.XtraTreeList.Columns.AutoFilterCondition.Contains;
subColumn.OptionsFilter.FilterPopupMode = DevExpress.XtraTreeList.FilterPopupMode.CheckedList;
if (!subField.Edit)
{
subColumn.AppearanceHeader.Options.UseForeColor = true;
@@ -9252,6 +9859,16 @@ namespace Lskj.Control
{
this.mLoading = false;
mControlSourceDic.Clear();
mSpecialReturnSourceDic.Clear();
mSpecialReturnSourceTaskDic.Clear();
mSpecialReturnDisplayDic.Clear();
foreach (GridColumnModel model in mControlList)
{
if (IsSpecialReturnBox(model.FieldType))
{
StartSpecialReturnSourceTask(model);
}
}
SetColumnsSource(UpdateColumnRefresh);
}
+65 -1
View File
@@ -18,6 +18,7 @@ using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using Lskj.Control.Model;
using Lskj.Business.Impl;
namespace Lskj.Control
{
@@ -51,12 +52,48 @@ namespace Lskj.Control
/// </summary>
/// <value>The label.</value>
public Label Label { get { return lblText; } }
/// <summary>
/// The contro object
/// </summary>
public MyControl ControlObj;
/// <summary>
/// 数据源
/// </summary>
public string SourceSQL = string.Empty;
/// <summary>
/// 是否带参数
/// </summary>
public bool Isparameters = false;
public LabelComboxEdit()
{
InitializeComponent();
// 绑定事件
txtEdit.QueryPopUp += TxtEdit_QueryPopUp;
}
private void TxtEdit_QueryPopUp(object sender, CancelEventArgs e)
{
this.RefreshData();
}
public void RefreshData()
{
if (Isparameters && !string.IsNullOrWhiteSpace(this.SourceSQL) && this.ControlObj != null)
{
string oldValue = this.EditValue;
string sqlValue = this.ControlObj.ReplaceControlValue(this.SourceSQL);
sqlValue = sqlValue.Replace("#", "");
DataTable table = BaseImpl.GetDataTableResult(sqlValue);
this.SetDataSource(table, true);
this.EditText = oldValue;
}
}
/// <summary>
/// <para>说明:设置控件显示文本</para>
@@ -261,9 +298,25 @@ namespace Lskj.Control
/// </summary>
/// <param name="dataSource">数据源</param>
public void SetDataSource(DataTable dataSource)
{
SetDataSource(dataSource, false);
}
/// <summary>
/// <para>说明:设置数据源</para>
/// </summary>
/// <param name="dataSource">数据源</param>
/// <param name="clearBeforeBind">绑定前是否清空原数据源</param>
public void SetDataSource(DataTable dataSource, bool clearBeforeBind)
{
try
{
if (clearBeforeBind)
{
ClearDataSource();
}
if (dataSource == null) return;
foreach (DataRow item in dataSource.Rows)
{
ComboBoxModel model = new ComboBoxModel
@@ -282,6 +335,17 @@ namespace Lskj.Control
}
}
/// <summary>
/// 清空下拉数据源和已选项,避免带参数下拉每次弹出重复追加。
/// </summary>
private void ClearDataSource()
{
this._sources.Clear();
this.txtEdit.SelectedItem = null;
this.txtEdit.EditValue = null;
this.txtEdit.Properties.Items.Clear();
}
/// <summary>
/// 背景颜色
/// </summary>
@@ -347,4 +411,4 @@ namespace Lskj.Control
}
}
}
+21 -1
View File
@@ -203,9 +203,29 @@ namespace Lskj.Control
}
set
{
this.txtEdit.Text = value;
//this.txtEdit.Text = value;
this.txtEdit.Text = NormalizeMemoText(value);
}
}
/// <summary>
/// 处理换行 (\n的换行不会生效,必须要\r\n才行。这里会把\n转成\r\n)
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
private static string NormalizeMemoText(string value)
{
if (string.IsNullOrEmpty(value)) return value;
return value
.Replace("\r\n", "\n") // 先把 CRLF 压成 LF
.Replace("\r", "\n") // 再把单独 CR 压成 LF
.Replace("\n", Environment.NewLine); // 最后统一成 Windows CRLF
}
/// <summary>
/// <para>说明:设置控件提示文本</para>
/// <para>创建人:龚宇超</para>
+12 -4
View File
@@ -493,13 +493,21 @@ namespace Lskj.Control.Model
/// <summary>
/// 测试特殊搜索框返回id
/// 快速搜索框返回id(字典模式)
/// </summary>
public const int SpecialSearchBoxToId = 181;
public const int DictionarySearchBoxToId = 181;
/// <summary>
/// 测试特殊搜索框返回text
/// 快速搜索框返回text(字典模式)
/// </summary>
public const int SpecialSearchBoxToText = 182;
public const int DictionarySearchBoxToText = 182;
/// <summary>
/// 快速搜索框返回id 带参数(字典模式)
/// </summary>
public const int DictionarySearchBoxToIdParam = 183;
/// <summary>
/// 快速搜索框返回text 带参数(字典模式)
/// </summary>
public const int DictionarySearchBoxToTextParam = 184;
/// <summary>
/// <para>说明:是否为Value类型</para>
@@ -423,7 +423,10 @@ namespace Lskj.Control.Model
this._bandTitle = item.Table.Columns.Contains("bandTitle") ? item["bandTitle"] + "" : string.Empty;
this._bandFields = item.Table.Columns.Contains("bandFields") ? item["bandFields"] + "" : string.Empty;
this._fieldtype = item.Table.Columns.Contains("fieldsqltag") && !string.IsNullOrWhiteSpace(item["fieldsqltag"] + "") ? Convert.ToInt32(item["fieldsqltag"] + "") : 0;
//if (this._fieldtype == 5 || this._fieldtype == 15)
//{
// _fieldtype = 181;
//}
this._sqlSource = item.Table.Columns.Contains("fieldsql") && !string.IsNullOrWhiteSpace(item["fieldsql"] + "") ? item["fieldsql"] + "" : string.Empty;
this._valueMember = item.Table.Columns.Contains("fieldsqlid") && !string.IsNullOrWhiteSpace(item["fieldsqlid"] + "") ? item["fieldsqlid"] + "" : "dm";
this._textMember = item.Table.Columns.Contains("fieldsqlname") && !string.IsNullOrWhiteSpace(item["fieldsqlname"] + "") ? item["fieldsqlname"] + "" : "mc";
+12 -1
View File
@@ -3048,7 +3048,18 @@ namespace Lskj.Control.Model
/// <summary>
/// 快速导入
/// </summary>
/// <param name="gridView"></param>
/// <param name="SysModel"></param>
/// <param name="parmaryKey"></param>
/// <param name="leftField"></param>
/// <param name="leftValue"></param>
/// <param name="ImportReturnName"></param>
/// <param name="ImportReturnValue"></param>
/// <param name="ParentGridEx"></param>
/// <returns></returns>
public static bool QuickImport(this GridView gridView, ModuleModel SysModel, string parmaryKey, string leftField, string leftValue, List<string> ImportReturnName, List<string> ImportReturnValue, GridControlEx ParentGridEx = null)
{
OpenFileDialog dialog = new OpenFileDialog();
@@ -485,6 +485,12 @@ namespace Lskj.Control.Model
{
tipOnlyOne = false;
string prompt = ReplaceHelper.ReplaceRowParam(rowData, model.BeforeMsg);
if (model.Mergeexec)
{
//替换[],替换的是多选行中的数据
prompt = ReplaceHelper.ReplaceRowParam(rows, prompt.Replace("[", "{").Replace("]", "}"), "", "");
}
if (prompt.StartsWith("@") || prompt.StartsWith("!"))
{
prompt = BaseImpl.GetDefaultValue(prompt);
@@ -42,6 +42,14 @@ namespace Lskj.Control.Model
{
int[] mSelectRows = this._gridView.GetSelectedRows();
if (mSelectRows == null || mSelectRows.Length == 0) return;
DataRow[] dataRows = new DataRow[mSelectRows.Length];
for (int i = 0; i < mSelectRows.Length; i++)
{
dataRows[i] = this._gridView.GetDataRow(mSelectRows[i]);
}
DataRow mSelectRow = this._gridView.GetDataRow(mSelectRows[0]);
this._gridView.UpdateCurrentRow();
this._gridView.ShowEditor();
@@ -127,6 +135,13 @@ namespace Lskj.Control.Model
cond = _control.ReplaceParentControlValue(model.MenuCond);
}
cond = ReplaceHelper.ReplaceRowParam(selectRow, model.MenuCond);
if (model.Mergeexec&& cond.StartsWith("@"))
{
//替换[],替换的是多选行中的数据
cond = ReplaceHelper.ReplaceRowParam(dataRows, cond.Replace("[", "{").Replace("]", "}"), "", "");
}
if (this._gridView != null)
{
if (cells != null && cells.Length > 0 && cond.Contains("{COLUMN_"))
@@ -134,37 +134,69 @@ namespace Lskj.Control.Model.MenuStrip
{
try
{
string cond = string.Empty;
if (this._control != null)
cond = _control.ReplaceParentControlValue(model.MenuCond);
cond = ReplaceHelper.ReplaceRowParam(mSelectRow, model.MenuCond);
if (this._treeView != null)
bool condResult = false;
StringBuilder condBuilder = new StringBuilder();
StringBuilder sqlCondBuilder = new StringBuilder();
List<TreeListCell> cells = this._treeView != null ? this._treeView.GetSelectedCells() : null;
DataRow focusedRow = this.TreeGridControlObj.GetViewFocusedDataRow();
foreach (DataRow selectRow in mSelectRows)
{
List<TreeListCell> cells = this._treeView.GetSelectedCells();
if (selectRow == null) continue;
string cond = string.Empty;
if (this._control != null)
cond = _control.ReplaceParentControlValue(model.MenuCond);
cond = ReplaceHelper.ReplaceRowParam(selectRow, model.MenuCond);
if (model.Mergeexec && cond.StartsWith("@"))
{
//替换[],替换的是多选行中的数据
cond = ReplaceHelper.ReplaceRowParam(mSelectRows, cond.Replace("[", "{").Replace("]", "}"), "", "");
}
if (cells != null && cells.Count > 0 && cond.Contains("{COLUMN_"))
{
TreeListCell cell = cells[0];
DataRow focusedRow = this.BaseGridView.GetFocusedDataRow();
string colValue = focusedRow == null || !focusedRow.Table.Columns.Contains(cell.Column.Name) ? "" : focusedRow[cell.Column.Name] + "";
cond = cond.ReplaceColumnParam(cell.Column.Name, cell.Column.Caption, colValue);
}
}
if (ControlObj != null)
cond = ControlObj.ReplaceParentControlValue(cond);
//cms.Enabled = ReplaceHelper.EvalCond(cond);
if (ControlObj != null)
cond = ControlObj.ReplaceParentControlValue(cond);
if (cond.StartsWith("@"))
{
sqlCondBuilder.Append($"({cond.TrimStart('@')}) = '1' and ");
}
else
{
condBuilder.Append($"({cond}) and ");
}
}
string condStr = "";
if (model.MenuCond.StartsWith("@"))
{
condStr = $"@if({sqlCondBuilder.ToString().TrimEnd().TrimEnd('d', 'n', 'a')}) begin select '1' end else begin select '0' end";
}
else
{
condStr = condBuilder.ToString().TrimEnd().TrimEnd('d', 'n', 'a');
}
condResult = ValidateCond(condStr, null);
//cms.Enabled = ReplaceHelper.EvalCond(cond);
if (model.ForbiddenDisplay)
{
cms.Visible = ValidateCond(cond, null);
cms.Visible = condResult;
}
cms.Enabled = ValidateCond(cond, null); ;
cms.Enabled = condResult;
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(ResourceKeys.SetRightMenuCondFault + "\r\n" + Message);
e.Cancel = true;
break;
}
}
+8 -4
View File
@@ -26,6 +26,10 @@ namespace Lskj.Control
/// </summary>
public sealed class MessageUtil
{
public static string Prompt = string.IsNullOrWhiteSpace(SystemInfo.Instance.DeadlockPrompt) ? "网络连接超时,请稍候再试!" : SystemInfo.Instance.DeadlockPrompt;
/// <summary>
/// <para>说明:弹出Ok对话框</para>
/// <para>创建人:龚宇超</para>
@@ -51,7 +55,7 @@ namespace Lskj.Control
}
if (!string.IsNullOrEmpty(msg) && msg.Contains("与另一个进程被死锁在")&& !SystemInfo.Instance.PromptDeadlock)
msg = "网络连接超时,请稍候再试!";
msg = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
msg = Business.Impl.LanguageTranslation.GetTranslatedText(msg);
@@ -87,7 +91,7 @@ namespace Lskj.Control
if (!string.IsNullOrEmpty(errorMessage) && errorMessage.Contains("与另一个进程被死锁在") && !SystemInfo.Instance.PromptDeadlock)
{
errorMessage = "网络连接超时,请稍候再试!";
errorMessage = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
errorMessage = Business.Impl.LanguageTranslation.GetTranslatedText(errorMessage);
@@ -162,7 +166,7 @@ namespace Lskj.Control
{
string msg = ex == null ? ResourceKeys.UnKownErrorTip : ex.StackTrace;
if (!string.IsNullOrEmpty(msg) && msg.Contains("与另一个进程被死锁在") && !SystemInfo.Instance.PromptDeadlock)
msg = "网络连接超时,请稍候再试!";
msg = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
msg = Business.Impl.LanguageTranslation.GetTranslatedText(msg);
@@ -173,7 +177,7 @@ namespace Lskj.Control
{
string msg = ex == null ? ResourceKeys.UnKownErrorTip : ex.Message; //ResourceKeys.SystemErrorTip + "\r\n" + ex.Message + "\r\n" + ex.StackTrace;
if (!string.IsNullOrEmpty(msg) && msg.Contains("与另一个进程被死锁在") && !SystemInfo.Instance.PromptDeadlock)
msg = "网络连接超时,请稍候再试!";
msg = Prompt;
if (Business.Impl.LanguageTranslation.Translatable)
{
msg = Business.Impl.LanguageTranslation.GetTranslatedText(msg);
+63 -4
View File
@@ -1503,7 +1503,31 @@ namespace Lskj.Control.Model
// 下拉框
LabelComboxEdit comboxEdit = ctr as LabelComboxEdit;
comboxEdit.SetDataSource(table);
comboxEdit.TextEdit.SelectedIndex = 0;
if (comboxEdit.Isparameters)
{
List<string> condition = ReplaceHelper.GetParamFields(model.SourceSql);
foreach (string item in condition)
{
string filename = item.Trim('{', '}');
if (ParaContrlsDic.ContainsKey(filename))
{
if (!ParaContrlsDic[filename].Contains(model.FieldName))
{
ParaContrlsDic[filename].Add(model.FieldName);
}
}
else
{
ParaContrlsDic[filename] = new List<string>() { model.FieldName };
}
}
}
else
{
//默认选中第一个,如果设置了带参数,就不默认选中
comboxEdit.TextEdit.SelectedIndex = 0;
}
break;
case ControlType.LabAutoCompleteValue:
case ControlType.LabAutoCompleteText:
@@ -3829,6 +3853,7 @@ namespace Lskj.Control.Model
if (rowItem == null) return;
foreach (ControlModel model in this.ControlModels)
{
selectModel = model;
if (rowItem.Table.Columns.Contains(model.FieldName))
@@ -3859,6 +3884,8 @@ namespace Lskj.Control.Model
{
SetControlValue(model, "****");
}
}
}
catch (Exception ex)
@@ -4212,6 +4239,27 @@ namespace Lskj.Control.Model
model.FieldType = 161;
model.IsRadio = true;
}
//快速搜索框在控件中转成普通搜索框
if (model.FieldType == 181 || model.FieldType == 182 || model.FieldType == 183 || model.FieldType == 184)
{
switch (model.FieldType)
{
case ControlType.DictionarySearchBoxToId:
model.FieldType = 5;
break;
case ControlType.DictionarySearchBoxToText:
model.FieldType = 6;
break;
case ControlType.DictionarySearchBoxToIdParam:
model.FieldType = 15;
break;
case ControlType.DictionarySearchBoxToTextParam:
model.FieldType = 16;
break;
}
}
return model;
}
@@ -4340,6 +4388,13 @@ namespace Lskj.Control.Model
comboxEdit.ValueMember = ControlType.LabComboxValue == model.FieldType || ControlType.LabComboxValueParam == model.FieldType ? model.ValueMember : model.TextMember;
comboxEdit.ValueField = model.ValueMember;
comboxEdit.TextField = model.TextMember;
if (ControlType.LabComboxValueParam == model.FieldType || ControlType.LabComboxTextParam == model.FieldType)
{
comboxEdit.ControlObj = this;
comboxEdit.SourceSQL = model.SourceSql;
comboxEdit.Isparameters = true;
}
//comboxEdit.SetDataSource(dataSource);
// 假如为报表模式并且没有默认值,默认选择第一条记录
if (model.IsSearchControl && string.IsNullOrEmpty(model.DefaultValue))
@@ -5426,6 +5481,10 @@ namespace Lskj.Control.Model
{
labelAutoGridLook.HandPopupSqlValue(labelAutoGridLook.SourceSQL);
}
if (baseUserControl is LabelComboxEdit labelComboxEdit)
{
labelComboxEdit.RefreshData();
}
}
}
}
@@ -6415,10 +6474,10 @@ namespace Lskj.Control.Model
if (rowItem == null) return;
foreach (ControlModel model in this.ControlModels)
{
if (rowItem.Table.Columns.Contains(model.FieldName)&&!string.IsNullOrWhiteSpace(model.DefaultValue))
if (rowItem.Table.Columns.Contains(model.FieldName) && !string.IsNullOrWhiteSpace(model.DefaultValue))
{
string DefaultValue = ReplaceHelper.ReplaceUserInfo(model.DefaultValue);
if (!DefaultValue.Equals(rowItem[model.FieldName] + ""))
if (!DefaultValue.Equals(rowItem[model.FieldName] + ""))
{
BaseUserControl baseControl = FindControl(model.FieldName);
if (baseControl == null) continue;
@@ -6432,7 +6491,7 @@ namespace Lskj.Control.Model
// baseControl.ForeColor = ColorTranslator.FromHtml("#000000");
// baseControl.ContentBold = false;
//}
}
}
}
}
}
+50 -6
View File
@@ -124,12 +124,19 @@ namespace Lskj.Control.Model
form.IsMdiContainer = true;
form.WindowState = System.Windows.Forms.FormWindowState.Maximized;
design.ReportObj.Prepare();
design.ReportObj.Design(form);
design.ReportObj.Designer.BorderStyle = BorderStyle.None;
design.ReportObj.Designer.cmdPreview.CustomAction += OnCustomAction;
try
{
design.ReportObj.Prepare();
design.ReportObj.Design(form);
design.ReportObj.Designer.BorderStyle = BorderStyle.None;
design.ReportObj.Designer.cmdPreview.CustomAction += OnCustomAction;
form.ShowDialog();
form.ShowDialog();
}
finally
{
ReleaseFastReportDesignerResource(design);
}
}
}
@@ -156,13 +163,50 @@ namespace Lskj.Control.Model
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
design.ReportObj.Design();
if (design != null && design.ReportObj != null)
{
design.ReportObj.Design();
}
WaitForm.HideForm();
}
}
private static void ReleaseFastReportDesignerResource(FrmFastReportDesign design)
{
try
{
if (design != null && design.ReportObj != null && design.ReportObj.Designer != null)
{
try
{
design.ReportObj.Designer.StopAutoSave();
}
catch
{
}
try
{
design.ReportObj.Designer.cmdPreview.CustomAction -= OnCustomAction;
}
catch
{
}
}
if (design != null && design.ReportObj != null)
{
design.ReportObj.Dispose();
design.ReportObj = null;
}
}
catch
{
}
}
private static void OnCustomAction(object sender, EventArgs e)
{
FastReport.Design.StandardDesigner.DesignerControl design = sender as FastReport.Design.StandardDesigner.DesignerControl;
+1 -1
View File
@@ -1882,7 +1882,7 @@ namespace Lskj.Control
/// </summary>
public void InitializeTab()
{
DataTable table = BaseModuleImpl.GetBaseAttach(this.Model.ModuleCode);//查看是否有附加模块
DataTable table = BaseModuleImpl.GetBaseAttachKey(this.SysModel.FormKey);//查看是否有附加模块
if (table.Rows.Count > 0)
{
XtraTabPage MainTableTab = new XtraTabPage();
+5 -4
View File
@@ -28,14 +28,15 @@
/// </summary>
private void InitializeComponent()
{
this.pm_print = new DevExpress.XtraBars.PopupMenu();
this.barManager1 = new DevExpress.XtraBars.BarManager();
this.components = new System.ComponentModel.Container();
this.pm_print = new DevExpress.XtraBars.PopupMenu(this.components);
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
this.pm_oper = new DevExpress.XtraBars.PopupMenu();
this.pm_common = new DevExpress.XtraBars.PopupMenu();
this.pm_oper = new DevExpress.XtraBars.PopupMenu(this.components);
this.pm_common = new DevExpress.XtraBars.PopupMenu(this.components);
this.grouptip = new System.Windows.Forms.GroupBox();
this.TipsPanel = new System.Windows.Forms.Panel();
this.scc_container = new DevExpress.XtraEditors.SplitContainerControl();
+56 -10
View File
@@ -300,14 +300,18 @@ namespace Lskj.FastReportDesign
{
if (ERPInfo.Instance.IsUserManager || SystemInfo.Instance.PrintTemplate.Split(',').Contains(ERPInfo.Instance.UserName))
{
this.ReportObj.Prepare();
this.ReportObj.Design(form);
this.ReportObj.Designer.BorderStyle = BorderStyle.None;
this.ReportObj.Designer.cmdPreview.CustomAction += OnCustomAction;
form.ShowDialog();
//this.ReportObj.Design(form);
//this.ReportObj.Designer.cmdPreview.CustomAction += OnCustomAction;
//form.ShowDialog();
try
{
this.ReportObj.Prepare();
this.ReportObj.Design(form);
this.ReportObj.Designer.BorderStyle = BorderStyle.None;
this.ReportObj.Designer.cmdPreview.CustomAction += OnCustomAction;
form.ShowDialog();
}
finally
{
ReleaseDesignerResource();
}
}
else
{
@@ -349,11 +353,53 @@ namespace Lskj.FastReportDesign
MessageUtil.Show(Message, ex.Message);
//MessageUtil.Show(ex);
this.ReportObj.Design();
if (this.ReportObj != null)
{
this.ReportObj.Design();
}
WaitForm.HideForm();
}
}
private void ReleaseDesignerResource()
{
try
{
if (this.ReportObj != null && this.ReportObj.Designer != null)
{
try
{
this.ReportObj.Designer.StopAutoSave();
}
catch
{
}
try
{
this.ReportObj.Designer.cmdPreview.CustomAction -= OnCustomAction;
}
catch
{
}
}
if (form != null && !form.IsDisposed)
{
form.Dispose();
}
if (this.ReportObj != null)
{
this.ReportObj.Dispose();
this.ReportObj = null;
}
}
catch
{
}
}
private void OnCustomAction(object sender, EventArgs e)
{
FastReport.Design.StandardDesigner.DesignerControl design = sender as FastReport.Design.StandardDesigner.DesignerControl;
@@ -402,4 +448,4 @@ namespace Lskj.FastReportDesign
}
}
}
}
+28
View File
@@ -267,6 +267,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lskj.PubGroupSettings", "..
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lskj.Main", "..\Lskj.Main\Lskj.Main.csproj", "{BCA1E2B3-C4AB-4D2C-B519-3DCFDB5B83D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lskj.PubCodeDesign", "..\Lskj.PubCodeDesign\Lskj.PubCodeDesign.csproj", "{552308D8-450C-4ECA-9A3E-543AF0F8E150}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lskj.PubBillManagement", "..\Lskj.PubBillManagement\Lskj.PubBillManagement.csproj", "{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1713,6 +1717,30 @@ Global
{BCA1E2B3-C4AB-4D2C-B519-3DCFDB5B83D6}.Release|Mixed Platforms.Build.0 = Release|x86
{BCA1E2B3-C4AB-4D2C-B519-3DCFDB5B83D6}.Release|x86.ActiveCfg = Release|x86
{BCA1E2B3-C4AB-4D2C-B519-3DCFDB5B83D6}.Release|x86.Build.0 = Release|x86
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Debug|Any CPU.Build.0 = Debug|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Debug|x86.ActiveCfg = Debug|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Debug|x86.Build.0 = Debug|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Release|Any CPU.ActiveCfg = Release|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Release|Any CPU.Build.0 = Release|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Release|x86.ActiveCfg = Release|Any CPU
{552308D8-450C-4ECA-9A3E-543AF0F8E150}.Release|x86.Build.0 = Release|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Debug|x86.ActiveCfg = Debug|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Debug|x86.Build.0 = Debug|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Release|Any CPU.Build.0 = Release|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Release|x86.ActiveCfg = Release|Any CPU
{6CE319BA-1253-41F2-8B59-8173FD7BE3F3}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+474 -32
View File
@@ -129,6 +129,12 @@ namespace Lskj.Main.Control
/// 缓存分组控件
/// </summary>
private Dictionary<string, Panel> _groupItems = new Dictionary<string, Panel>();
private TreeView _leftGroupTreeView;
private ImageList _leftGroupTreeIcons;
private Panel _leftGroupSeparator;
private const string LeftGroupTreeNodeTypeMenu = "menu";
private const string LeftGroupTreeNodeTypeGroup = "group";
private const int GroupControlTopPadding = 8;
/// <summary>
/// 缓存右上菜单控件
/// </summary>
@@ -301,7 +307,7 @@ namespace Lskj.Main.Control
if (HiddenAccountSet && (SystemInfo.Instance.DefaultMainTag == 3 || SystemInfo.Instance.DefaultMainTag == 4))
{
pl_top_right.Width = pl_top_right.Width - this.label1.Left - this.label1.Width;
this.lblMenuTitle.Location= new Point(this.button3.Left , this.lblMenuTitle.Top);
this.lblMenuTitle.Location = new Point(this.button3.Left, this.lblMenuTitle.Top);
}
if (SystemInfo.Instance.HideSkin)
{
@@ -332,7 +338,10 @@ namespace Lskj.Main.Control
{
this.SetMenus();
this.SetSearchMenus();
this.tv_left.Visible = false;
if (!CanUseLeftGroupTreeMenu())
{
this.tv_left.Visible = false;
}
}
if (SystemInfo.Instance.DefaultMainTag == 3 || SystemInfo.Instance.DefaultMainTag == 4)
{
@@ -671,6 +680,385 @@ namespace Lskj.Main.Control
return ctr is Form ? ctr as Form : GetParent(ctr.Parent);
}
private DataTable CreateLeftGroupTreeTable()
{
DataTable table = new DataTable();
table.Columns.Add("nodekey");
table.Columns.Add("parentkey");
table.Columns.Add("nodetext");
table.Columns.Add("nodetype");
table.Columns.Add("menustruct");
table.Columns.Add("groupkey");
table.Columns.Add("sortno", typeof(int));
table.Columns.Add("iconindex", typeof(int));
return table;
}
private void AddLeftGroupTreeNode(DataTable table, string nodeKey, string nodeText, string nodeType, string menuStruct, string groupKey)
{
if (table == null || string.IsNullOrWhiteSpace(nodeKey)) return;
if (table.Rows.Cast<DataRow>().Any(n => (n["nodekey"] + "").Equals(nodeKey))) return;
DataRow row = table.NewRow();
row["nodekey"] = nodeKey;
row["parentkey"] = nodeType.Equals(LeftGroupTreeNodeTypeGroup) ? menuStruct : string.Empty;
row["nodetext"] = nodeText;
row["nodetype"] = nodeType;
row["menustruct"] = menuStruct;
row["groupkey"] = groupKey;
row["sortno"] = table.Rows.Count + 1;
row["iconindex"] = table.Rows.Count;
table.Rows.Add(row);
}
private string GetGroupTreeKey(string menuStruct, int groupIndex)
{
return string.Format("{0}|{1:00}", menuStruct, groupIndex);
}
private string GetLeftGroupTreeDefaultNode(DataTable treeTable, string defaultParentMenu)
{
if (treeTable == null || treeTable.Rows.Count == 0) return string.Empty;
DataRow defaultParentRow = treeTable.Rows.Cast<DataRow>()
.FirstOrDefault(n => (n["nodetype"] + "").Equals(LeftGroupTreeNodeTypeMenu) && (n["menustruct"] + "").Equals(defaultParentMenu));
if (defaultParentRow != null)
{
return defaultParentRow["nodekey"] + "";
}
DataRow firstParentRow = treeTable.Rows.Cast<DataRow>()
.FirstOrDefault(n => (n["nodetype"] + "").Equals(LeftGroupTreeNodeTypeMenu));
if (firstParentRow != null) return firstParentRow["nodekey"] + "";
return treeTable.Rows[0]["nodekey"] + "";
}
private string GetGroupCaptionText(string groupCaption)
{
if (string.IsNullOrWhiteSpace(groupCaption)) return string.Empty;
return groupCaption.Length > 2 ? groupCaption.Remove(0, 2) : groupCaption;
}
private TreeView GetLeftGroupTreeView()
{
if (_leftGroupTreeView != null) return _leftGroupTreeView;
_leftGroupTreeView = new TreeView
{
Dock = DockStyle.Fill,
BorderStyle = BorderStyle.None,
BackColor = Color.FromArgb(250, 253, 255),
DrawMode = TreeViewDrawMode.Normal,
Font = new Font("微软雅黑", 10F),
ForeColor = Color.FromArgb(38, 73, 98),
HideSelection = false,
Indent = 20,
ImageList = GetLeftGroupTreeIcons(),
ItemHeight = 29,
LineColor = Color.FromArgb(198, 214, 226),
ShowLines = false,
ShowPlusMinus = false,
ShowRootLines = false
};
_leftGroupTreeView.NodeMouseClick += OnLeftGroupTreeViewNodeMouseClick;
return _leftGroupTreeView;
}
private Panel GetLeftGroupSeparator()
{
if (_leftGroupSeparator != null) return _leftGroupSeparator;
_leftGroupSeparator = new Panel
{
Dock = DockStyle.Left,
Width = 2,
BackColor = Color.FromArgb(198, 214, 226),
Margin = Padding.Empty
};
return _leftGroupSeparator;
}
private void SetLeftGroupSeparatorVisible(bool visible)
{
Panel separator = GetLeftGroupSeparator();
this.FirstMain.SuspendLayout();
try
{
if (!this.FirstMain.Controls.Contains(separator))
{
this.FirstMain.Controls.Add(separator);
}
this.FirstMain.Controls.SetChildIndex(this.pl_center_main, 0);
this.FirstMain.Controls.SetChildIndex(separator, 1);
this.FirstMain.Controls.SetChildIndex(this.pl_center_left, 2);
separator.Visible = visible;
}
finally
{
this.FirstMain.ResumeLayout();
}
}
private bool CanUseLeftGroupTreeMenu()
{
return "1".Equals((SystemInfo.Instance.MainLeftShowMode + "").Trim()) && this._allMenus.Columns.Contains("groupcaption") && !isFlowLayout;
}
private void ResetLeftMenuBarPanel()
{
SetLeftGroupSeparatorVisible(false);
this.pl_center_left.Padding = new Padding(4);
this.pl_center_left.BackColor = Color.FromArgb(10, 87, 167);
if (_leftGroupTreeView != null && this.pl_center_left.Controls.Contains(_leftGroupTreeView))
{
this.pl_center_left.Controls.Remove(_leftGroupTreeView);
}
if (this.pl_center_left.Controls.Contains(this.tv_left))
{
this.tv_left.Visible = false;
}
}
private ImageList GetLeftGroupTreeIcons()
{
if (_leftGroupTreeIcons != null) return _leftGroupTreeIcons;
_leftGroupTreeIcons = new ImageList();
_leftGroupTreeIcons.ColorDepth = ColorDepth.Depth32Bit;
_leftGroupTreeIcons.ImageSize = new Size(18, 18);
string iconPath = PubUtil.MainTreeviewImagePath;
if (Directory.Exists(iconPath))
{
string[] files = Directory.GetFiles(iconPath, "*.png").OrderBy(n => n).ToArray();
foreach (string file in files)
{
using (Image image = ImageHelper.ReadImage(file))
{
if (image != null)
{
_leftGroupTreeIcons.Images.Add(new Bitmap(image));
}
}
}
}
if (_leftGroupTreeIcons.Images.Count == 0)
{
_leftGroupTreeIcons.Images.Add(new Bitmap(18, 18));
}
return _leftGroupTreeIcons;
}
private void BindLeftGroupTreeView(DataTable treeTable, string defaultNode)
{
TreeView treeView = GetLeftGroupTreeView();
treeView.BeginUpdate();
treeView.Nodes.Clear();
Dictionary<string, TreeNode> nodeMap = new Dictionary<string, TreeNode>();
List<DataRow> rows = treeTable.Rows.Cast<DataRow>()
.OrderBy(n => Convert.ToInt32(n["sortno"]))
.ToList();
int iconCount = GetLeftGroupTreeIcons().Images.Count;
foreach (DataRow row in rows)
{
TreeNode node = new TreeNode(row["nodetext"] + "");
int iconIndex = 0;
int.TryParse(row["iconindex"] + "", out iconIndex);
iconIndex = Math.Abs(iconIndex) % iconCount;
node.ImageIndex = iconIndex;
node.SelectedImageIndex = iconIndex;
node.Name = row["nodekey"] + "";
node.Tag = row;
nodeMap[node.Name] = node;
}
foreach (DataRow row in rows)
{
string nodeKey = row["nodekey"] + "";
string parentKey = row["parentkey"] + "";
TreeNode node = nodeMap[nodeKey];
if (!string.IsNullOrEmpty(parentKey) && nodeMap.ContainsKey(parentKey))
{
nodeMap[parentKey].Nodes.Add(node);
}
else
{
treeView.Nodes.Add(node);
}
}
treeView.CollapseAll();
FocusLeftGroupTreeNode(defaultNode);
treeView.EndUpdate();
}
private void FocusLeftGroupTreeNode(string nodeKey)
{
if (_leftGroupTreeView == null || string.IsNullOrEmpty(nodeKey)) return;
TreeNode node = FindLeftGroupTreeNode(_leftGroupTreeView.Nodes, nodeKey);
if (node == null) return;
_leftGroupTreeView.SelectedNode = node;
}
private TreeNode FindLeftGroupTreeNode(TreeNodeCollection nodes, string nodeKey)
{
foreach (TreeNode node in nodes)
{
if (node.Name.Equals(nodeKey)) return node;
TreeNode childNode = FindLeftGroupTreeNode(node.Nodes, nodeKey);
if (childNode != null) return childNode;
}
return null;
}
private void OnLeftGroupTreeViewNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
try
{
TreeView treeView = sender as TreeView;
if (treeView == null || e.Node == null || e.Button != MouseButtons.Left) return;
treeView.SelectedNode = e.Node;
if (e.Node.Nodes.Count > 0)
{
e.Node.Toggle();
}
OnLeftGroupTreeRowClick(e.Node.Tag as DataRow);
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
private void BindLeftGroupTreeMenu(DataTable treeTable, string defaultParentMenu)
{
if (treeTable == null || treeTable.Rows.Count == 0) return;
string expandNode = GetLeftGroupTreeDefaultNode(treeTable, defaultParentMenu);
this.pl_center_left.Controls.Clear();
this.pl_center_left.Padding = Padding.Empty;
this.pl_center_left.BackColor = Color.FromArgb(250, 253, 255);
this.pl_center_main.Padding = Padding.Empty;
this.pl_center_main.BackColor = Color.FromArgb(240, 240, 240);
SetLeftGroupSeparatorVisible(true);
TreeView treeView = GetLeftGroupTreeView();
this.pl_center_left.Controls.Add(treeView);
BindLeftGroupTreeView(treeTable, expandNode);
if (!string.IsNullOrEmpty(expandNode))
{
DataRow expandRow = treeTable.Rows.Cast<DataRow>().FirstOrDefault(n => (n["nodekey"] + "").Equals(expandNode));
if (expandRow != null)
{
OnLeftGroupTreeRowClick(expandRow);
}
}
}
private void ShowGroupMenuPanel(string menuStruct, string groupKey)
{
if (!_groupItems.ContainsKey(menuStruct)) return;
Panel groupPanel = _groupItems[menuStruct];
groupPanel.SuspendLayout();
foreach (System.Windows.Forms.Control control in groupPanel.Controls)
{
GroupControl groupControl = control as GroupControl;
if (groupControl == null) continue;
groupControl.Visible = string.IsNullOrEmpty(groupKey) || (groupControl.Name + "").Equals(groupKey);
}
NormalizeGroupPanelSpacing(groupPanel);
groupPanel.ResumeLayout(true);
groupPanel.AutoScrollPosition = Point.Empty;
this.allMenuPanel.Controls.Clear();
this.allMenuPanel.Controls.Add(groupPanel);
groupPanel.Visible = true;
}
private void NormalizeGroupPanelSpacing(Panel groupPanel)
{
if (groupPanel == null) return;
List<GroupControl> groupControls = groupPanel.Controls.OfType<GroupControl>().ToList();
int topPadding = groupControls.Count > 1 ? GroupControlTopPadding : 0;
foreach (GroupControl groupControl in groupControls)
{
groupControl.Padding = new Padding(0, topPadding, 0, 0);
}
}
private void ShowShortcutPanels(string menuStruct)
{
if (!this._allMenus.Columns.Contains("menuposition") || (!SystemInfo.Instance.IsOpenWork && !SystemInfo.Instance.ShowGallerysFromMenu) || SystemInfo.Instance.HideGallerys)
{
return;
}
this.pl_center_main_bottom_right_main.Controls.Clear();
this.pl_center_main_bottom_left_main.Controls.Clear();
if (this.topLayoutPanelDic.ContainsKey(menuStruct))
{
TableLayoutPanel tableLayoutPanel = this.topLayoutPanelDic[menuStruct];
this.pl_center_main_bottom_right_main.Controls.Add(tableLayoutPanel);
string labelCaption = tableLayoutPanel.Tag + "";
this.lblShortcutset.Text = !string.IsNullOrEmpty(labelCaption) ? string.Format(" {0}", labelCaption) : this.lblShortcutset.Tag + "";
}
if (this.botLayoutPanelDic.ContainsKey(menuStruct))
{
TableLayoutPanel tableLayoutPanel = this.botLayoutPanelDic[menuStruct];
this.pl_center_main_bottom_left_main.Controls.Add(tableLayoutPanel);
string labelCaption = tableLayoutPanel.Tag + "";
this.lblReportcutset.Text = !string.IsNullOrEmpty(labelCaption) ? string.Format(" {0}", labelCaption) : this.lblReportcutset.Tag + "";
}
}
private void OnLeftGroupTreeMenuClick(Button button)
{
try
{
DataRow row = button == null ? null : button.Tag as DataRow;
if (row == null) return;
OnLeftGroupTreeRowClick(row);
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
private void OnLeftGroupTreeRowClick(DataRow row)
{
if (row == null) return;
string menuStruct = row["menustruct"] + "";
string nodeType = row["nodetype"] + "";
string groupKey = nodeType.Equals(LeftGroupTreeNodeTypeGroup) ? row["groupkey"] + "" : string.Empty;
ShowGroupMenuPanel(menuStruct, groupKey);
ShowShortcutPanels(menuStruct);
if (SystemInfo.Instance.DesktopFormat && this.tabMain.SelectedTabPage == this.xtpDesktop)
{
this.webBrowser.Hide();
this.webBrowser.SendToBack();
this.tabMain.SelectedTabPage = this.xtpFirst;
}
}
/// <summary>
/// <para>说明:设置左侧菜单</para>
/// <para>创建人:龚宇超</para>
@@ -683,6 +1071,7 @@ namespace Lskj.Main.Control
private void SetMenus()
{
this._menus.Clear();
this._firstMenuBar = null;
var groupMenus = this._allMenus.AsEnumerable().Where(n => n.Table.Columns.Contains("groupcaption") && !string.IsNullOrEmpty(n["groupcaption"] + ""));
if (groupMenus.Count() == 0 && this._allMenus.Columns.Contains("groupcaption"))
{
@@ -714,6 +1103,12 @@ namespace Lskj.Main.Control
List<DataRow> rows = this._allMenus.AsEnumerable().Where(n => (n["subsysid"] + "").Equals(ERPInfo.Instance.SubSysId) && !string.IsNullOrEmpty(n["menustruct"] + "")).ToList();
if (rows != null && rows.Count > 0)
{
bool useLeftGroupTreeMenu = CanUseLeftGroupTreeMenu();
if (!useLeftGroupTreeMenu)
{
ResetLeftMenuBarPanel();
}
DataTable leftGroupTreeTable = useLeftGroupTreeMenu ? CreateLeftGroupTreeTable() : null;
int buttonTop = Convert.ToInt32(0.05 * DpiY); // 按钮上边距
int menuLeft = Convert.ToInt32(0.05 * DpiY), menuTop = Convert.ToInt32(0.05 * DpiY); // 模块距离左边距,模块距离顶部边距
int menuWidthOld = Convert.ToInt32(1.14 * DpiX), menuHeightOld = Convert.ToInt32(1.32 * DpiY); // 旧模块宽度,模块高度
@@ -923,7 +1318,6 @@ namespace Lskj.Main.Control
// 加载左侧菜单
if (menuStruct.Length == 2)
{
DataTable childs = rows.Cast<DataRow>().Where(x => (x["MenuStruct"] + "").Substring(0, 2) == menuStruct).CopyToDataTable();
if (childs != null && childs.Rows.Count > 1)
{
@@ -931,33 +1325,40 @@ namespace Lskj.Main.Control
defaultParentMenu = menuStruct;
// menuLeft = 5; menuTop = 5;
menuLeft = Convert.ToInt32(0.05 * DpiX); menuTop = Convert.ToInt32(0.05 * DpiY);
MenuBar button = new MenuBar();
button.Size = new Size(Convert.ToInt32(1.52 * DpiX), Convert.ToInt32(0.46 * DpiX));
button.Location = new Point(2, buttonTop);
button.BackColor = System.Drawing.Color.Transparent;
button.GetButton().Text = item["menucaption"] + "";
button.GetButton().Tag = item;
if (useLeftGroupTreeMenu)
{
AddLeftGroupTreeNode(leftGroupTreeTable, menuStruct, item["menucaption"] + "", LeftGroupTreeNodeTypeMenu, menuStruct, string.Empty);
}
else
{
MenuBar button = new MenuBar();
button.Size = new Size(Convert.ToInt32(1.52 * DpiX), Convert.ToInt32(0.46 * DpiX));
button.Location = new Point(2, buttonTop);
button.BackColor = System.Drawing.Color.Transparent;
button.GetButton().Text = item["menucaption"] + "";
button.GetButton().Tag = item;
if (SystemInfo.Instance.MenuBarWidth > 0)
{
button.Size = new Size(SystemInfo.Instance.MenuBarWidth, Convert.ToInt32(0.46 * DpiX));
button.GetButton().Width = SystemInfo.Instance.MenuBarWidth - 10;
}
if (SystemInfo.Instance.MenuBarWidth > 0)
{
button.Size = new Size(SystemInfo.Instance.MenuBarWidth, Convert.ToInt32(0.46 * DpiX));
button.GetButton().Width = SystemInfo.Instance.MenuBarWidth - 10;
}
if (_firstMenuBar == null)
{
_firstMenuBar = button;
if (_firstMenuBar == null)
{
_firstMenuBar = button;
}
// 注册事件
button.SetHoverEvent(hoverEvent, (MenuEventType)SystemInfo.Instance.MemuEventType);
// 44
buttonTop += Convert.ToInt32(0.45 * DpiY);
if (menuStruct == defaultParentMenu)
{
button.SetDefaultSelectMenu(button);
button.SetButtonState(MenuButtonState.selectState);
}
pl_center_left.Controls.Add(button);
}
// 注册事件
button.SetHoverEvent(hoverEvent, (MenuEventType)SystemInfo.Instance.MemuEventType);
// 44
buttonTop += Convert.ToInt32(0.45 * DpiY);
if (menuStruct == defaultParentMenu)
{
button.SetDefaultSelectMenu(button);
button.SetButtonState(MenuButtonState.selectState);
}
pl_center_left.Controls.Add(button);
// 缓存控件
@@ -1091,23 +1492,34 @@ namespace Lskj.Main.Control
}
}
IEnumerable<IGrouping<int, DataRow>> groupByDataRows = groupDataRows.GroupBy(n => Convert.ToInt32((n["groupcaption"] + "").Substring(0, 2))).OrderByDescending(n => n.Key);
int groupByDataRowCount = groupByDataRows.Count();
Panel groupPanel = new Panel();
groupPanel.AutoScroll = true;
groupPanel.Dock = DockStyle.Fill;
int groupControlIndex = 0;
foreach (IGrouping<int, DataRow> groupByDataRow in groupByDataRows)
{
string groupTreeKey = GetGroupTreeKey(menuStruct, groupByDataRow.Key);
string groupTreeCaption = GetGroupCaptionText(groupByDataRow.First()["groupcaption"] + "");
if (string.IsNullOrWhiteSpace(groupTreeCaption) || (groupByDataRowCount == 1 && groupTreeCaption.Equals("默认分组")))
{
groupTreeCaption = item["menucaption"] + "";
}
if (useLeftGroupTreeMenu && groupByDataRowCount > 1)
{
string leftGroupTreeGroupKey = menuStruct + groupByDataRow.Key.ToString("00");
AddLeftGroupTreeNode(leftGroupTreeTable, leftGroupTreeGroupKey, groupTreeCaption, LeftGroupTreeNodeTypeGroup, menuStruct, groupTreeKey);
}
int nowRowCount = 1;//当前行数
int minMenuRow = this._allMenus.Columns.Contains("menuRow") ? groupByDataRow.Min(n => Convert.ToInt32(n["menuRow"])) : 1;
int menuGroupLeft = Convert.ToInt32(0.05 * DpiY);
int menuGroupTop = 0; // 模块距离左边距,模块距离顶部边距
GroupControl groupControl = new GroupControl();
groupControl.Name = groupTreeKey;
groupControl.Tag = groupTreeCaption;
groupControl.TipsLabel.ForeColor = Color.DimGray;
groupControl.Dock = DockStyle.Top;
if (groupControlIndex == groupByDataRows.Count() - 1 && !isShowGrallyInTop)
{
groupControl.Padding = new Padding(0, 0, 0, 0);
}
groupControl.Padding = new Padding(0, GroupControlTopPadding, 0, 0);
groupPanel.Controls.Add(groupControl);
List<DataRow> groupOrderDataRow = groupByDataRow.ToList();
if (this._allMenus.Columns.Contains("menuRow"))
@@ -1231,12 +1643,13 @@ namespace Lskj.Main.Control
}
groupControlIndex += 1;
groupControl.TipsText = $"{groupControl.TipsText}({count})";
groupControl.Height = (int)(menuGroupTop + menuHeight + 28 + 16);
groupControl.Height = (int)(menuGroupTop + menuHeight + 28 + GroupControlTopPadding);
}
if (groupPanel.Controls.Count == 1)
{
(groupPanel.Controls[0] as GroupControl).TipsVisable = false;
}
NormalizeGroupPanelSpacing(groupPanel);
if (!_groupItems.ContainsKey(menuStruct))
{
_groupItems.Add(menuStruct, groupPanel);
@@ -1331,6 +1744,10 @@ namespace Lskj.Main.Control
}
}
}
if (useLeftGroupTreeMenu)
{
BindLeftGroupTreeMenu(leftGroupTreeTable, defaultParentMenu);
}
}
}
/// <summary>
@@ -1599,9 +2016,27 @@ namespace Lskj.Main.Control
private void InitLeftMenu()
{
DataTable dtLvTree = MainImpl.GetLeftTreeView();
if (!pl_center_left.Controls.Contains(tv_left))
{
pl_center_left.Controls.Clear();
pl_center_left.Padding = new Padding(4);
pl_center_left.BackColor = Color.FromArgb(10, 87, 167);
pl_center_main.Padding = Padding.Empty;
pl_center_main.BackColor = Color.FromArgb(240, 240, 240);
SetLeftGroupSeparatorVisible(false);
pl_center_left.Controls.Add(tv_left);
}
tv_left.Dock = DockStyle.Fill;
tv_left.Visible = true;
tv_left.ParentField = "speciesno";
tv_left.ParentKeyLength = 2;
tv_left.TextField = "speciesname";
//tv_left.RaiseClickEventOnAllNodes = false;
//tv_left.ExpandAllNodes = false;
//tv_left.AllowNodeCollapse = true;
//tv_left.SwitchOnMouseMove = false;
//tv_left.UseMenuBarTextStyle = false;
//tv_left.UseGroupTreeImageStyle = false;
tv_left.OnButtonClickEvent += new TreeViewCustom.ButtonClickEventHandler(OnMenuButtonClick);
tv_left.SetDataSource(dtLvTree);
}
@@ -2484,6 +2919,13 @@ namespace Lskj.Main.Control
if (this._groupItems.ContainsKey(item_after["menustruct"] + ""))
{
Panel groupPanel = this._groupItems[item_after["menustruct"] + ""];
foreach (System.Windows.Forms.Control control in groupPanel.Controls)
{
GroupControl groupControl = control as GroupControl;
if (groupControl != null) groupControl.Visible = true;
}
NormalizeGroupPanelSpacing(groupPanel);
groupPanel.AutoScrollPosition = Point.Empty;
groupPanel.Visible = true;
allMenuPanel.Controls.Add(groupPanel);
}
+5 -1
View File
@@ -463,7 +463,10 @@ namespace Lskj.Model
/// 单据来源明细拖拽(双击)后是否背景颜色
/// </summary>
public bool IsSelectSourceColor { get { return !string.IsNullOrWhiteSpace(SelectSourceColor); } }
/// <summary>
/// 单据横向模式
/// </summary>
public bool HorizontalMode;
/// <summary>
@@ -571,6 +574,7 @@ namespace Lskj.Model
this.BillFinalReviewAdd = rowItem.Table.Columns.Contains("BillFinalReviewAdd") ? "1".Equals(rowItem["BillFinalReviewAdd"] + "") : false;
this.SourceMainPushPullHide = rowItem.Table.Columns.Contains("SourceMainPushPullHide") ? "1".Equals(rowItem["SourceMainPushPullHide"] + "") : false;
this.SelectSourceColor = rowItem.Table.Columns.Contains("SelectSourceColor") ? rowItem["SelectSourceColor"] + "" : "";
this.HorizontalMode = rowItem.Table.Columns.Contains("HorizontalMode") ? "1".Equals(rowItem["HorizontalMode"] + "") : false;
}
}
}
+5 -3
View File
@@ -121,6 +121,8 @@ namespace Lskj.Notice
/// </summary>
void ReloadGridData()
{
DataTable data = null;
string sqlStr = string.Empty;
try
{
DBConfig.Instance.ReadConfig();
@@ -144,13 +146,13 @@ namespace Lskj.Notice
}
}
data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId, out sqlStr);
}
catch (Exception)
{
}
string sqlStr = string.Empty;
DataTable data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId, out sqlStr);
//DataTable data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId, out sqlStr);
int rowCount = data == null ? 0 : data.Rows.Count;
+130 -130
View File
@@ -28,7 +28,18 @@
/// </summary>
private void InitializeComponent()
{
this.ssc_main = new DevExpress.XtraEditors.SplitContainerControl();
this.components = new System.ComponentModel.Container();
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
this.barDockControl1 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl2 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl3 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl5 = new DevExpress.XtraBars.BarDockControl();
this.pmFP = new DevExpress.XtraBars.PopupMenu(this.components);
this.pmBillExp = new DevExpress.XtraBars.PopupMenu(this.components);
this.pmBill = new DevExpress.XtraBars.PopupMenu(this.components);
this.pMprint = new DevExpress.XtraBars.PopupMenu(this.components);
this.pMenu = new DevExpress.XtraBars.PopupMenu(this.components);
this.tb_buttom = new Lskj.Control.TabControlEx();
this.ssc_main_top = new DevExpress.XtraEditors.SplitContainerControl();
this.pl_left = new DevExpress.XtraEditors.PanelControl();
this.xtc_left_container = new DevExpress.XtraTab.XtraTabControl();
@@ -40,17 +51,11 @@
this.pl_treeview_detault_search = new DevExpress.XtraEditors.PanelControl();
this.panelControl4 = new DevExpress.XtraEditors.PanelControl();
this.textEdit1 = new DevExpress.XtraEditors.TextEdit();
this.barManager1 = new DevExpress.XtraBars.BarManager();
this.barDockControl1 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl2 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl3 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl5 = new DevExpress.XtraBars.BarDockControl();
this.lceCombobox = new Lskj.Control.LabelComboxEdit();
this.panelControl3 = new DevExpress.XtraEditors.PanelControl();
this.btnTreeSearch = new DevExpress.XtraEditors.SimpleButton();
this.pl_main_bottom = new DevExpress.XtraEditors.PanelControl();
this.dbpFP = new DevExpress.XtraEditors.DropDownButton();
this.pmFP = new DevExpress.XtraBars.PopupMenu();
this.btnRefresh = new DevExpress.XtraEditors.SimpleButton();
this.btnHiding = new DevExpress.XtraEditors.SimpleButton();
this.btnHelp = new DevExpress.XtraEditors.SimpleButton();
@@ -63,15 +68,11 @@
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
this.btn_input = new DevExpress.XtraEditors.SimpleButton();
this.dpbImport = new DevExpress.XtraEditors.DropDownButton();
this.pmBillExp = new DevExpress.XtraBars.PopupMenu();
this.btnBillAdd = new DevExpress.XtraEditors.SimpleButton();
this.btnBillApply = new DevExpress.XtraEditors.SimpleButton();
this.dpCopyBill = new DevExpress.XtraEditors.DropDownButton();
this.pmBill = new DevExpress.XtraBars.PopupMenu();
this.btnPrint = new DevExpress.XtraEditors.DropDownButton();
this.pMprint = new DevExpress.XtraBars.PopupMenu();
this.dpbTools = new DevExpress.XtraEditors.DropDownButton();
this.pMenu = new DevExpress.XtraBars.PopupMenu();
this.btnDelete = new DevExpress.XtraEditors.SimpleButton();
this.btnBillSave = new DevExpress.XtraEditors.SimpleButton();
this.pl_main_top = new DevExpress.XtraEditors.PanelControl();
@@ -85,9 +86,13 @@
this.rdRed = new System.Windows.Forms.RadioButton();
this.pl_blue = new DevExpress.XtraEditors.PanelControl();
this.rdBlue = new System.Windows.Forms.RadioButton();
this.tb_buttom = new Lskj.Control.TabControlEx();
((System.ComponentModel.ISupportInitialize)(this.ssc_main)).BeginInit();
this.ssc_main.SuspendLayout();
this.ssc_main = new DevExpress.XtraEditors.SplitContainerControl();
((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pmFP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pmBillExp)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pmBill)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pMprint)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pMenu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ssc_main_top)).BeginInit();
this.ssc_main_top.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_left)).BeginInit();
@@ -105,12 +110,10 @@
((System.ComponentModel.ISupportInitialize)(this.panelControl4)).BeginInit();
this.panelControl4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl3)).BeginInit();
this.panelControl3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_main_bottom)).BeginInit();
this.pl_main_bottom.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pmFP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pl_templete)).BeginInit();
this.pl_templete.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cb_templete.Properties)).BeginInit();
@@ -118,10 +121,6 @@
this.pl_input.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cb_input.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_input.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pmBillExp)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pmBill)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pMprint)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pMenu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pl_main_top)).BeginInit();
this.pl_main_top.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_main_top_center)).BeginInit();
@@ -134,26 +133,80 @@
this.pl_red.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_blue)).BeginInit();
this.pl_blue.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ssc_main)).BeginInit();
this.ssc_main.SuspendLayout();
this.SuspendLayout();
//
// ssc_main
// barManager1
//
this.ssc_main.Appearance.BackColor = System.Drawing.Color.Transparent;
this.ssc_main.Appearance.Options.UseBackColor = true;
this.ssc_main.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2;
this.ssc_main.Dock = System.Windows.Forms.DockStyle.Fill;
this.ssc_main.Horizontal = false;
this.ssc_main.Location = new System.Drawing.Point(0, 0);
this.ssc_main.Name = "ssc_main";
this.ssc_main.Panel1.Controls.Add(this.ssc_main_top);
this.ssc_main.Panel1.Text = "Panel1";
this.ssc_main.Panel2.Controls.Add(this.tb_buttom);
this.ssc_main.Panel2.Text = "Panel2";
this.ssc_main.Size = new System.Drawing.Size(1511, 730);
this.ssc_main.SplitterPosition = 445;
this.ssc_main.TabIndex = 0;
this.ssc_main.Text = "splitContainerControl1";
this.ssc_main.SplitterMoved += new System.EventHandler(this.OnMainSplitterMoved);
this.barManager1.DockControls.Add(this.barDockControl1);
this.barManager1.DockControls.Add(this.barDockControl2);
this.barManager1.DockControls.Add(this.barDockControl3);
this.barManager1.DockControls.Add(this.barDockControl5);
this.barManager1.Form = this;
this.barManager1.MaxItemId = 0;
//
// barDockControl1
//
this.barDockControl1.CausesValidation = false;
this.barDockControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControl1.Location = new System.Drawing.Point(0, 0);
this.barDockControl1.Size = new System.Drawing.Size(1511, 0);
//
// barDockControl2
//
this.barDockControl2.CausesValidation = false;
this.barDockControl2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControl2.Location = new System.Drawing.Point(0, 730);
this.barDockControl2.Size = new System.Drawing.Size(1511, 0);
//
// barDockControl3
//
this.barDockControl3.CausesValidation = false;
this.barDockControl3.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControl3.Location = new System.Drawing.Point(0, 0);
this.barDockControl3.Size = new System.Drawing.Size(0, 730);
//
// barDockControl5
//
this.barDockControl5.CausesValidation = false;
this.barDockControl5.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControl5.Location = new System.Drawing.Point(1511, 0);
this.barDockControl5.Size = new System.Drawing.Size(0, 730);
//
// pmFP
//
this.pmFP.Manager = this.barManager1;
this.pmFP.Name = "pmFP";
//
// pmBillExp
//
this.pmBillExp.Manager = this.barManager1;
this.pmBillExp.Name = "pmBillExp";
//
// pmBill
//
this.pmBill.Manager = this.barManager1;
this.pmBill.Name = "pmBill";
//
// pMprint
//
this.pMprint.Manager = this.barManager1;
this.pMprint.Name = "pMprint";
//
// pMenu
//
this.pMenu.Manager = this.barManager1;
this.pMenu.Name = "pMenu";
//
// tb_buttom
//
this.tb_buttom.Dock = System.Windows.Forms.DockStyle.Fill;
this.tb_buttom.Location = new System.Drawing.Point(0, 0);
this.tb_buttom.Name = "tb_buttom";
this.tb_buttom.Size = new System.Drawing.Size(1511, 280);
this.tb_buttom.TabIndex = 25;
this.tb_buttom.Load += new System.EventHandler(this.tb_buttom_Load);
//
// ssc_main_top
//
@@ -296,43 +349,6 @@
this.textEdit1.TabIndex = 5;
this.textEdit1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnTreeConditionKeyDown);
//
// barManager1
//
this.barManager1.DockControls.Add(this.barDockControl1);
this.barManager1.DockControls.Add(this.barDockControl2);
this.barManager1.DockControls.Add(this.barDockControl3);
this.barManager1.DockControls.Add(this.barDockControl5);
this.barManager1.Form = this;
this.barManager1.MaxItemId = 0;
//
// barDockControl1
//
this.barDockControl1.CausesValidation = false;
this.barDockControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControl1.Location = new System.Drawing.Point(0, 0);
this.barDockControl1.Size = new System.Drawing.Size(1511, 0);
//
// barDockControl2
//
this.barDockControl2.CausesValidation = false;
this.barDockControl2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControl2.Location = new System.Drawing.Point(0, 730);
this.barDockControl2.Size = new System.Drawing.Size(1511, 0);
//
// barDockControl3
//
this.barDockControl3.CausesValidation = false;
this.barDockControl3.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControl3.Location = new System.Drawing.Point(0, 0);
this.barDockControl3.Size = new System.Drawing.Size(0, 730);
//
// barDockControl5
//
this.barDockControl5.CausesValidation = false;
this.barDockControl5.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControl5.Location = new System.Drawing.Point(1511, 0);
this.barDockControl5.Size = new System.Drawing.Size(0, 730);
//
// lceCombobox
//
this.lceCombobox.BackColor = System.Drawing.SystemColors.Control;
@@ -416,11 +432,6 @@
this.dbpFP.Text = "分配";
this.dbpFP.Click += new System.EventHandler(this.OnBtnFPOldClick);
//
// pmFP
//
this.pmFP.Manager = this.barManager1;
this.pmFP.Name = "pmFP";
//
// btnRefresh
//
this.btnRefresh.AllowFocus = false;
@@ -565,11 +576,6 @@
this.dpbImport.TabIndex = 26;
this.dpbImport.Text = "导入导出";
//
// pmBillExp
//
this.pmBillExp.Manager = this.barManager1;
this.pmBillExp.Name = "pmBillExp";
//
// btnBillAdd
//
this.btnBillAdd.AllowFocus = false;
@@ -610,11 +616,6 @@
this.dpCopyBill.TabIndex = 24;
this.dpCopyBill.Text = "复制单据";
//
// pmBill
//
this.pmBill.Manager = this.barManager1;
this.pmBill.Name = "pmBill";
//
// btnPrint
//
this.btnPrint.AllowFocus = false;
@@ -629,11 +630,6 @@
this.btnPrint.TabIndex = 23;
this.btnPrint.Text = "打印单据";
//
// pMprint
//
this.pMprint.Manager = this.barManager1;
this.pMprint.Name = "pMprint";
//
// dpbTools
//
this.dpbTools.AllowFocus = false;
@@ -649,11 +645,6 @@
this.dpbTools.Text = "常用工具";
this.dpbTools.Click += new System.EventHandler(this.OnToolsClick);
//
// pMenu
//
this.pMenu.Manager = this.barManager1;
this.pMenu.Name = "pMenu";
//
// btnDelete
//
this.btnDelete.AllowFocus = false;
@@ -818,14 +809,24 @@
this.rdBlue.UseVisualStyleBackColor = true;
this.rdBlue.Click += new System.EventHandler(this.OnBlueStateClick);
//
// tb_buttom
// ssc_main
//
this.tb_buttom.Dock = System.Windows.Forms.DockStyle.Fill;
this.tb_buttom.Location = new System.Drawing.Point(0, 0);
this.tb_buttom.Name = "tb_buttom";
this.tb_buttom.Size = new System.Drawing.Size(1511, 280);
this.tb_buttom.TabIndex = 25;
this.tb_buttom.Load += new System.EventHandler(this.tb_buttom_Load);
this.ssc_main.Appearance.BackColor = System.Drawing.Color.Transparent;
this.ssc_main.Appearance.Options.UseBackColor = true;
this.ssc_main.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2;
this.ssc_main.Dock = System.Windows.Forms.DockStyle.Fill;
this.ssc_main.Horizontal = false;
this.ssc_main.Location = new System.Drawing.Point(0, 0);
this.ssc_main.Name = "ssc_main";
this.ssc_main.Panel1.Controls.Add(this.ssc_main_top);
this.ssc_main.Panel1.Text = "Panel1";
this.ssc_main.Panel2.Controls.Add(this.tb_buttom);
this.ssc_main.Panel2.Text = "Panel2";
this.ssc_main.Size = new System.Drawing.Size(1511, 730);
this.ssc_main.SplitterPosition = 445;
this.ssc_main.TabIndex = 0;
this.ssc_main.Text = "splitContainerControl1";
this.ssc_main.SplitterMoved += new System.EventHandler(this.OnMainSplitterMoved);
//
// BillModule
//
@@ -838,8 +839,12 @@
this.Name = "BillModule";
this.Size = new System.Drawing.Size(1511, 730);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnFrmMainKeyDown);
((System.ComponentModel.ISupportInitialize)(this.ssc_main)).EndInit();
this.ssc_main.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pmFP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pmBillExp)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pmBill)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pMprint)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pMenu)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ssc_main_top)).EndInit();
this.ssc_main_top.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pl_left)).EndInit();
@@ -857,12 +862,10 @@
((System.ComponentModel.ISupportInitialize)(this.panelControl4)).EndInit();
this.panelControl4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl3)).EndInit();
this.panelControl3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pl_main_bottom)).EndInit();
this.pl_main_bottom.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pmFP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pl_templete)).EndInit();
this.pl_templete.ResumeLayout(false);
this.pl_templete.PerformLayout();
@@ -872,10 +875,6 @@
this.pl_input.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.cb_input.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txt_input.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pmBillExp)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pmBill)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pMprint)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pMenu)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pl_main_top)).EndInit();
this.pl_main_top.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pl_main_top_center)).EndInit();
@@ -891,6 +890,8 @@
((System.ComponentModel.ISupportInitialize)(this.pl_blue)).EndInit();
this.pl_blue.ResumeLayout(false);
this.pl_blue.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ssc_main)).EndInit();
this.ssc_main.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -898,32 +899,42 @@
#endregion
private DevExpress.XtraTab.XtraTabControl xtc_left_container;
private DevExpress.XtraBars.PopupMenu pMenu;
private DevExpress.XtraBars.BarManager barManager1;
private DevExpress.XtraBars.BarDockControl barDockControl1;
private DevExpress.XtraBars.BarDockControl barDockControl2;
private DevExpress.XtraBars.BarDockControl barDockControl3;
private DevExpress.XtraBars.BarDockControl barDockControl5;
private DevExpress.XtraEditors.SplitContainerControl ssc_main;
private DevExpress.XtraEditors.SplitContainerControl ssc_main_top;
private DevExpress.XtraEditors.PanelControl pl_left;
private DevExpress.XtraBars.PopupMenu pmBillExp;
private DevExpress.XtraBars.PopupMenu pmBill;
private DevExpress.XtraBars.PopupMenu pMprint;
private DevExpress.XtraBars.PopupMenu pmFP;
private DevExpress.XtraEditors.SplitContainerControl ssc_main;
private DevExpress.XtraEditors.SplitContainerControl ssc_main_top;
private DevExpress.XtraEditors.PanelControl pl_left;
private DevExpress.XtraTab.XtraTabControl xtc_left_container;
private DevExpress.XtraEditors.PanelControl pl_main;
private DevExpress.XtraEditors.PanelControl pl_main_center;
private DevExpress.XtraEditors.PanelControl pl_main_center_detail;
private Control.GridControlEx gcMain;
private DevExpress.XtraEditors.XtraScrollableControl pl_main_center_master;
private DevExpress.XtraEditors.PanelControl pl_treeview_detault_search;
private DevExpress.XtraEditors.PanelControl panelControl4;
private DevExpress.XtraEditors.TextEdit textEdit1;
private Control.LabelComboxEdit lceCombobox;
private DevExpress.XtraEditors.PanelControl panelControl3;
private DevExpress.XtraEditors.SimpleButton btnTreeSearch;
public DevExpress.XtraEditors.PanelControl pl_main_bottom;
private DevExpress.XtraEditors.DropDownButton dbpFP;
private DevExpress.XtraEditors.SimpleButton btnRefresh;
private DevExpress.XtraEditors.SimpleButton btnHiding;
private DevExpress.XtraEditors.SimpleButton btnHelp;
private DevExpress.XtraEditors.PanelControl pl_templete;
private DevExpress.XtraEditors.ComboBoxEdit cb_templete;
private DevExpress.XtraEditors.LabelControl lbl_templete;
private DevExpress.XtraEditors.PanelControl pl_input;
private DevExpress.XtraEditors.ComboBoxEdit cb_input;
private DevExpress.XtraEditors.TextEdit txt_input;
private DevExpress.XtraEditors.LabelControl labelControl2;
private DevExpress.XtraEditors.SimpleButton btn_input;
private DevExpress.XtraEditors.DropDownButton dpbImport;
@@ -946,16 +957,5 @@
private DevExpress.XtraEditors.PanelControl pl_blue;
private System.Windows.Forms.RadioButton rdBlue;
private Control.TabControlEx tb_buttom;
private DevExpress.XtraEditors.TextEdit txt_input;
private DevExpress.XtraEditors.SimpleButton btnHiding;
private DevExpress.XtraEditors.SimpleButton btnRefresh;
private Control.GridControlEx gcMain;
private DevExpress.XtraEditors.DropDownButton dbpFP;
private DevExpress.XtraBars.PopupMenu pmFP;
private DevExpress.XtraEditors.PanelControl panelControl4;
private DevExpress.XtraEditors.TextEdit textEdit1;
private Control.LabelComboxEdit lceCombobox;
private DevExpress.XtraEditors.PanelControl panelControl3;
private DevExpress.XtraEditors.SimpleButton btnTreeSearch;
}
}
+330 -144
View File
@@ -312,8 +312,7 @@ namespace Lskj.PubBill
this.labelControl1.Text = Business.Impl.LanguageTranslation.GetTranslatedText(this.labelControl1.Text);
}
if (this.BillModel.HorizontalMode) this.HorizontalInterface();
}
catch (Exception ex)
@@ -1317,7 +1316,7 @@ namespace Lskj.PubBill
DataRow row = BillImpl.GetDataRowResult(this.SysModel.BillMasterSql);
if (row != null)
{
if (row.Table.Columns.Contains(this.BillModel.RtagidKey))
if (row.Table.Columns.Contains(this.BillModel.RtagidKey))
{
string Rtagid = row[this.BillModel.RtagidKey] + "";
// 初始化红、蓝单
@@ -2089,25 +2088,52 @@ namespace Lskj.PubBill
GridControlEx gridDetail = new GridControlEx();
if (model.sourceDetailType.Equals("1"))
if (!string.IsNullOrWhiteSpace(model.DetailMenuCode))
{
//明细为树表格
gridDetail = sourceDetailControl != null ? (TreeGridControlEx)sourceDetailControl : new TreeGridControlEx();
gridDetail.Model = this.SysModel;
gridDetail.Dock = DockStyle.Fill;
gridDetail.SetReadOnlyColumns(detailColumns == null || detailColumns.Length == 0 ? new DataTable() : detailColumns.CopyToDataTable(), GridCustomColumnStruct.BillSourceDetailGridView + model.FormKey);
if (!dataCaches.GetValue(gridDetail, "BaseGridRowColors", out DataTable dtBaseGridRowColors))
//来源明细配置了模块号,根据模块号创建对应的ModuleGridEx
//ModuleGridEx主要是用保存的功能,数据源sql还是根据配置的为准
DataRow modelRow = MainImpl.GetSystemdllTab(model.DetailMenuCode);//获取模块信息
if (modelRow == null)
{
dtBaseGridRowColors = BaseModuleImpl.GetBaseGridRowColors("SOURCEDETAIL_" + model.FormKey);
MessageUtil.Show($"没有找到编号为 {model.DetailMenuCode} 的模块信息");
gridDetail.Parent = gridDetail;
continue;
}
if (!dataCaches.GetValue(gridDetail, "BaseGridRightMenus", out DataTable dtBaseGridRightMenus))
ModuleModel sysModel = new ModuleModel(modelRow);
//设置主表sql
//model.SourceSql = sysModel.MenuSql;
DynamicModuleModel dyncModel = new DynamicModuleModel(new[]
{ sysModel.MenuName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName,
this.SysModel.Privilege, sysModel.ModeCode, "0" });
ModuleGridEx gridEx = new ModuleGridEx();
gridEx.Dock = DockStyle.Fill;
if (model.SourceType == 1)
{
dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus("BILLSOURCEDT_" + model.FormKey);
gridEx.LeftTreeViewEx = treeView;
}
gridDetail.SetGridRowColors(dtBaseGridRowColors);
gridDetail.SetGridRightMenus(dtBaseGridRightMenus, this.SysModel, OnGridDetailRightMenuCallback);
gridDetail.Parent = tabDetail;
gridDetail.BorderStyle = System.Windows.Forms.BorderStyle.None;
else
{
gridEx.LeftGridEx = gridControl;
gridEx.ParentGridEx = gridControl;
}
gridEx.ParentKeyField = model.SourceKeyField;
gridEx.ParentUnionField = model.SourceKeyField;
gridEx.VisibleSearchPanel = false;//禁止上方搜索
gridEx.InitializeControl(sysModel, dyncModel);
gridDetail = gridEx.GridControlObj;
gridEx.Parent = tabDetail;
unionModel.GridDetailModuleGridEx = gridEx;
if (sysModel.TreeAutoMultiHeader == 1) model.ChangeSourceDetailType("1");
if (i == 0)
{
@@ -2116,123 +2142,6 @@ namespace Lskj.PubBill
if (attachModels.Count > 0)
this.tb_buttom.TabControlObj.TabPages[0].Text = model.UserName + DetailedSuffix;
}
if (model.MainDetailsAddType != "2")
{
TreeGridDragGrid treeGridDragGrid = new TreeGridDragGrid((gridDetail as TreeGridControlEx).TreeListObj, this.gcMain.GridView);
treeGridDragGrid.OnDragComplete += new TreeGridDragGridCompleteEventHandler(OnTreeGridDetailGridCompleted);
}
if (BillModel.IsBillDetailCheck == 1)//加载复选框
{
GridDragGrid.TreeListAddCheckBox((gridDetail as TreeGridControlEx).TreeListObj);
}
}
else
{
gridDetail = sourceDetailControl != null ? (GridControlEx)sourceDetailControl : new GridControlEx();
gridDetail.Model = this.SysModel;
gridDetail.Dock = DockStyle.Fill;
gridDetail.SetReadOnlyColumns(detailColumns == null || detailColumns.Length == 0 ? new DataTable() : detailColumns.CopyToDataTable(), GridCustomColumnStruct.BillSourceDetailGridView + model.FormKey);
if (model.DetailedLoadFilter)
{
gridDetail.GridView.OptionsView.ShowAutoFilterRow = true;
}
if (!dataCaches.GetValue(gridDetail, "BaseGridRowColors", out DataTable dtBaseGridRowColors))
{
dtBaseGridRowColors = BaseModuleImpl.GetBaseGridRowColors("SOURCEDETAIL_" + model.FormKey);
}
if (!dataCaches.GetValue(gridDetail, "BaseGridRightMenus", out DataTable dtBaseGridRightMenus))
{
dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus("BILLSOURCEDT_" + model.FormKey);
}
gridDetail.SetGridRowColors(dtBaseGridRowColors);
gridDetail.SetGridRightMenus(dtBaseGridRightMenus, this.SysModel, OnGridDetailRightMenuCallback);
if (BillModel.IsBillDetailCheck == 0)
{
if (model.MainDetailsAddType != "2") gridDetail.GridView.DoubleClick += new EventHandler(OnGridDetailDoubleClick);
}
//明细的明细(明细分成左右2个)
if (!string.IsNullOrEmpty(model.SourceDetailsDetailsSql))
{
GridControlEx gridDetail_Details = sourceDetailDetailControl != null ? (GridControlEx)sourceDetailDetailControl : new GridControlEx();
gridDetail_Details.Model = this.SysModel;
gridDetail_Details.Dock = DockStyle.Fill;
//创建只读列
if (!dataCaches.GetValue(gridDetail_Details, "Detail_Details", out DataTable dataTable))
{
dataTable = BaseModuleImpl.getDetail_Details(model.FormKey);
}
gridDetail_Details.SetReadOnlyColumns(dataTable);
//设置右键
if (!dataCaches.GetValue(gridDetail_Details, "BaseGridRightMenus", out DataTable dttBaseGridRightMenus))
{
dttBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus("BILLSOURCEDTX_" + model.FormKey);
}
gridDetail_Details.SetGridRightMenus(dttBaseGridRightMenus, this.SysModel, OnGridDetailRightMenuCallback);
//明细点击 更新 明细的明细
gridDetail.GridView.FocusedRowObjectChanged += GridView_FocusedRowObjectChanged;
gridDetail.GridView.Tag = model.SourceDetailsDetailsSql;
//创建SplitContainerControl控件,让下方可以左右拖动
SplitContainerControl splitContainerControl = new DevExpress.XtraEditors.SplitContainerControl();
splitContainerControl.Dock = DockStyle.Fill;
splitContainerControl.Panel1.Controls.Add(gridDetail);
gridDetail.BorderStyle = System.Windows.Forms.BorderStyle.None;
splitContainerControl.Panel2.Controls.Add(gridDetail_Details);
gridDetail_Details.BorderStyle = System.Windows.Forms.BorderStyle.None;
splitContainerControl.SplitterMoved += new System.EventHandler(this.OnDetailsSplitterMoved);
string newwidth = IniHelper.Read(string.Format("bill_Details_Width_{0}", this.SysModel.ModuleCode));//通过Key获取Value值
if (!string.IsNullOrEmpty(newwidth))
{
splitContainerControl.SplitterPosition = Convert.ToInt32(newwidth);
}
else
{
int width = this.tb_buttom.Width;//获取控件宽度
splitContainerControl.SplitterPosition = width / 2;//然后将分割位置设置在宽度一半位置
}
if (model.MainDetailsAddType != "1")
{
//明细的明细拖拽到上方
if (this.BillModel.DetailTreeTable)
{
GridDragTreeGrid dragDetaigDetailGrid = new GridDragTreeGrid(gridDetail_Details.GridView, (this.gcMain as TreeGridControlEx).TreeListObj);
dragDetaigDetailGrid.CanDragParentNode = true;
dragDetaigDetailGrid.NeglectingNodes = true;
dragDetaigDetailGrid.OnDragComplete += DragDetailGrid_OnDragComplete;
}
else
{
GridDragGrid dragDetaigDetailGrid = new GridDragGrid(gridDetail_Details.GridView, this.gcMain.GridView);
dragDetaigDetailGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragDetailGridCompleted);
}
if (BillModel.IsBillDetailCheck == 0)
{
//明细的明细双击加载到上方
gridDetail_Details.GridView.DoubleClick += new EventHandler(OnGridDetailDetailDoubleClick);
}
}
splitContainerControl.Parent = tabDetail;
unionModel.GridDetailDetailControlObj = gridDetail_Details;
}
else
{
gridDetail.Parent = tabDetail;
gridDetail.BorderStyle = System.Windows.Forms.BorderStyle.None;
}
if (i == 0)
{
this.tb_buttom.TabControlObj.TabPages.Insert(0, tabDetail);
this.tb_buttom.TabControlObj.SelectedTabPageIndex = 0;
if (attachModels.Count > 0)
this.tb_buttom.TabControlObj.TabPages[0].Text = model.UserName + DetailedSuffix;
}
if (model.MainDetailsAddType != "2")
{
if (this.BillModel.DetailTreeTable)
@@ -2247,21 +2156,202 @@ namespace Lskj.PubBill
}
else
{
GridDragGrid dragDetailGrid = new GridDragGrid(gridDetail.GridView, this.gcMain.GridView);
dragDetailGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragDetailGridCompleted);
if (this.BillModel.IsSelectSourceColor) gridDetail.GridView.CustomDrawCell += GridView_CustomDrawCell;
if (sysModel.TreeAutoMultiHeader == 1)
{
TreeGridDragGrid treeGridDragGrid = new TreeGridDragGrid((gridDetail as TreeGridControlEx).TreeListObj, this.gcMain.GridView);
treeGridDragGrid.OnDragComplete += new TreeGridDragGridCompleteEventHandler(OnTreeGridDetailGridCompleted);
}
else
{
GridDragGrid dragDetailGrid = new GridDragGrid(gridDetail.GridView, this.gcMain.GridView);
dragDetailGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragDetailGridCompleted);
if (this.BillModel.IsSelectSourceColor) gridDetail.GridView.CustomDrawCell += GridView_CustomDrawCell;
}
}
}
if (BillModel.IsBillDetailCheck == 1)//加载复选框
}
else
{
if (model.sourceDetailType.Equals("1"))
{
GridDragGrid.GridAddCheckBox(gridDetail.GridView);
//明细为树表格
gridDetail = sourceDetailControl != null ? (TreeGridControlEx)sourceDetailControl : new TreeGridControlEx();
gridDetail.Model = this.SysModel;
gridDetail.Dock = DockStyle.Fill;
gridDetail.SetReadOnlyColumns(detailColumns == null || detailColumns.Length == 0 ? new DataTable() : detailColumns.CopyToDataTable(), GridCustomColumnStruct.BillSourceDetailGridView + model.FormKey);
if (!dataCaches.GetValue(gridDetail, "BaseGridRowColors", out DataTable dtBaseGridRowColors))
{
dtBaseGridRowColors = BaseModuleImpl.GetBaseGridRowColors("SOURCEDETAIL_" + model.FormKey);
}
if (!dataCaches.GetValue(gridDetail, "BaseGridRightMenus", out DataTable dtBaseGridRightMenus))
{
dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus("BILLSOURCEDT_" + model.FormKey);
}
gridDetail.SetGridRowColors(dtBaseGridRowColors);
gridDetail.SetGridRightMenus(dtBaseGridRightMenus, this.SysModel, OnGridDetailRightMenuCallback);
gridDetail.Parent = tabDetail;
gridDetail.BorderStyle = System.Windows.Forms.BorderStyle.None;
if (i == 0)
{
this.tb_buttom.TabControlObj.TabPages.Insert(0, tabDetail);
this.tb_buttom.TabControlObj.SelectedTabPageIndex = 0;
if (attachModels.Count > 0)
this.tb_buttom.TabControlObj.TabPages[0].Text = model.UserName + DetailedSuffix;
}
if (model.MainDetailsAddType != "2")
{
TreeGridDragGrid treeGridDragGrid = new TreeGridDragGrid((gridDetail as TreeGridControlEx).TreeListObj, this.gcMain.GridView);
treeGridDragGrid.OnDragComplete += new TreeGridDragGridCompleteEventHandler(OnTreeGridDetailGridCompleted);
}
if (BillModel.IsBillDetailCheck == 1)//加载复选框
{
GridDragGrid.TreeListAddCheckBox((gridDetail as TreeGridControlEx).TreeListObj);
}
}
else
{
gridDetail = sourceDetailControl != null ? (GridControlEx)sourceDetailControl : new GridControlEx();
gridDetail.Model = this.SysModel;
gridDetail.Dock = DockStyle.Fill;
gridDetail.SetReadOnlyColumns(detailColumns == null || detailColumns.Length == 0 ? new DataTable() : detailColumns.CopyToDataTable(), GridCustomColumnStruct.BillSourceDetailGridView + model.FormKey);
if (model.DetailedLoadFilter)
{
gridDetail.GridView.OptionsView.ShowAutoFilterRow = true;
}
if (!dataCaches.GetValue(gridDetail, "BaseGridRowColors", out DataTable dtBaseGridRowColors))
{
dtBaseGridRowColors = BaseModuleImpl.GetBaseGridRowColors("SOURCEDETAIL_" + model.FormKey);
}
if (!dataCaches.GetValue(gridDetail, "BaseGridRightMenus", out DataTable dtBaseGridRightMenus))
{
dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus("BILLSOURCEDT_" + model.FormKey);
}
gridDetail.SetGridRowColors(dtBaseGridRowColors);
gridDetail.SetGridRightMenus(dtBaseGridRightMenus, this.SysModel, OnGridDetailRightMenuCallback);
if (BillModel.IsBillDetailCheck == 0)
{
if (model.MainDetailsAddType != "2") gridDetail.GridView.DoubleClick += new EventHandler(OnGridDetailDoubleClick);
}
//明细的明细(明细分成左右2个)
if (!string.IsNullOrEmpty(model.SourceDetailsDetailsSql))
{
GridControlEx gridDetail_Details = sourceDetailDetailControl != null ? (GridControlEx)sourceDetailDetailControl : new GridControlEx();
gridDetail_Details.Model = this.SysModel;
gridDetail_Details.Dock = DockStyle.Fill;
//创建只读列
if (!dataCaches.GetValue(gridDetail_Details, "Detail_Details", out DataTable dataTable))
{
dataTable = BaseModuleImpl.getDetail_Details(model.FormKey);
}
gridDetail_Details.SetReadOnlyColumns(dataTable);
//设置右键
if (!dataCaches.GetValue(gridDetail_Details, "BaseGridRightMenus", out DataTable dttBaseGridRightMenus))
{
dttBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus("BILLSOURCEDTX_" + model.FormKey);
}
gridDetail_Details.SetGridRightMenus(dttBaseGridRightMenus, this.SysModel, OnGridDetailRightMenuCallback);
//明细点击 更新 明细的明细
gridDetail.GridView.FocusedRowObjectChanged += GridView_FocusedRowObjectChanged;
gridDetail.GridView.Tag = model.SourceDetailsDetailsSql;
//创建SplitContainerControl控件,让下方可以左右拖动
SplitContainerControl splitContainerControl = new DevExpress.XtraEditors.SplitContainerControl();
splitContainerControl.Dock = DockStyle.Fill;
splitContainerControl.Panel1.Controls.Add(gridDetail);
gridDetail.BorderStyle = System.Windows.Forms.BorderStyle.None;
splitContainerControl.Panel2.Controls.Add(gridDetail_Details);
gridDetail_Details.BorderStyle = System.Windows.Forms.BorderStyle.None;
splitContainerControl.SplitterMoved += new System.EventHandler(this.OnDetailsSplitterMoved);
string newwidth = IniHelper.Read(string.Format("bill_Details_Width_{0}", this.SysModel.ModuleCode));//通过Key获取Value值
if (!string.IsNullOrEmpty(newwidth))
{
splitContainerControl.SplitterPosition = Convert.ToInt32(newwidth);
}
else
{
int width = this.tb_buttom.Width;//获取控件宽度
splitContainerControl.SplitterPosition = width / 2;//然后将分割位置设置在宽度一半位置
}
if (model.MainDetailsAddType != "1")
{
//明细的明细拖拽到上方
if (this.BillModel.DetailTreeTable)
{
GridDragTreeGrid dragDetaigDetailGrid = new GridDragTreeGrid(gridDetail_Details.GridView, (this.gcMain as TreeGridControlEx).TreeListObj);
dragDetaigDetailGrid.CanDragParentNode = true;
dragDetaigDetailGrid.NeglectingNodes = true;
dragDetaigDetailGrid.OnDragComplete += DragDetailGrid_OnDragComplete;
}
else
{
GridDragGrid dragDetaigDetailGrid = new GridDragGrid(gridDetail_Details.GridView, this.gcMain.GridView);
dragDetaigDetailGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragDetailGridCompleted);
}
if (BillModel.IsBillDetailCheck == 0)
{
//明细的明细双击加载到上方
gridDetail_Details.GridView.DoubleClick += new EventHandler(OnGridDetailDetailDoubleClick);
}
}
splitContainerControl.Parent = tabDetail;
unionModel.GridDetailDetailControlObj = gridDetail_Details;
}
else
{
gridDetail.Parent = tabDetail;
gridDetail.BorderStyle = System.Windows.Forms.BorderStyle.None;
}
if (i == 0)
{
this.tb_buttom.TabControlObj.TabPages.Insert(0, tabDetail);
this.tb_buttom.TabControlObj.SelectedTabPageIndex = 0;
if (attachModels.Count > 0)
this.tb_buttom.TabControlObj.TabPages[0].Text = model.UserName + DetailedSuffix;
}
if (model.MainDetailsAddType != "2")
{
if (this.BillModel.DetailTreeTable)
{
GridDragTreeGrid dragDetailGrid = new GridDragTreeGrid(gridDetail.GridView, (this.gcMain as TreeGridControlEx).TreeListObj);
dragDetailGrid.CanDragParentNode = true;
dragDetailGrid.NeglectingNodes = true;
dragDetailGrid.OnDragComplete += DragDetailGrid_OnDragComplete;
unionModel.AddDataSql = model.AddDataSql;
unionModel.AddDataCondition = model.AddDataCondition;
}
else
{
GridDragGrid dragDetailGrid = new GridDragGrid(gridDetail.GridView, this.gcMain.GridView);
dragDetailGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragDetailGridCompleted);
if (this.BillModel.IsSelectSourceColor) gridDetail.GridView.CustomDrawCell += GridView_CustomDrawCell;
}
}
if (BillModel.IsBillDetailCheck == 1)//加载复选框
{
GridDragGrid.GridAddCheckBox(gridDetail.GridView);
}
}
}
#endregion
#region
@@ -2315,6 +2405,7 @@ namespace Lskj.PubBill
#endregion
unionModel.GridControlObj = gridControl;
if (model.sourceDetailType.Equals("1"))
{
unionModel.TreeGridDetailControlObj = (gridDetail as TreeGridControlEx);
@@ -3855,6 +3946,11 @@ namespace Lskj.PubBill
this.ClearHighlightRows(unionModel.GridDetailControlObj.GridView);
}
if (unionModel.GridDetailModuleGridEx != null)
{
unionModel.GridDetailModuleGridEx.GridControlObj.LastSearchSql = DetailSql;
}
DataTable table = null;
if (unionModel.ModelObj.sourceDetailType == "1")
@@ -4764,7 +4860,18 @@ namespace Lskj.PubBill
}
else
{
this.AddRowsToGridView(table, unionModel);
if (!this.BillModel.IsFastDragAddDetail)
{
this.AddRowsToGridView(table, unionModel);
}
else
{
// 全部行转数组
DataRow[] dragRows = table.Select();
this.AddRowsToGridViewFast(dragRows);
}
}
@@ -5860,6 +5967,11 @@ namespace Lskj.PubBill
if (unionModel.SearchObj != null) sqlValue = unionModel.SearchObj.ReplaceControlValue(sqlValue);
sqlValue = ReplaceHelper.ReplaceParamToValue(sqlValue, e.Node.Name);
if (unionModel.GridDetailModuleGridEx != null)
{
unionModel.GridDetailModuleGridEx.GridControlObj.LastSearchSql = sqlValue;
}
if (unionModel.ModelObj.sourceDetailType == "1" && unionModel.TreeGridDetailControlObj.TreeListObj != null)
{
unionModel.TreeGridDetailControlObj.TreeListObj.DataSource = BillImpl.GetDataTableResult(sqlValue);
@@ -5904,7 +6016,11 @@ namespace Lskj.PubBill
{
this.RefreshSelectedSource();
this.tb_buttom.TabControlObj.TabPages[0].Controls.Clear();
if (unionModel.GridDetailDetailControlObj == null)
if (unionModel.GridDetailModuleGridEx != null)
{
this.tb_buttom.TabControlObj.TabPages[0].Controls.Add(unionModel.GridDetailModuleGridEx);
}
else if (unionModel.GridDetailDetailControlObj == null)
{
this.tb_buttom.TabControlObj.TabPages[0].Controls.Add(unionModel.GridDetailControlObj != null ? unionModel.GridDetailControlObj : unionModel.TreeGridDetailControlObj);
}
@@ -10066,5 +10182,75 @@ namespace Lskj.PubBill
return true;
}
/// <summary>
/// 设置横向界面
/// </summary>
public void HorizontalInterface()
{
//底部main 左侧是来源和来源明细 右侧是主表数据
SplitContainerControl MainSplitContainerControl = new SplitContainerControl();
MainSplitContainerControl.Dock = DockStyle.Fill;
//左侧控件 左侧是来源 右侧是来源明细
SplitContainerControl LeftSplitContainerControl = new SplitContainerControl();
LeftSplitContainerControl.Dock = DockStyle.Fill;
xtc_left_container.HeaderLocation = TabHeaderLocation.Top;
tb_buttom.TabControlObj.HeaderLocation = TabHeaderLocation.Top;
LeftSplitContainerControl.Panel1.Controls.Add(this.xtc_left_container);
LeftSplitContainerControl.Panel2.Controls.Add(this.tb_buttom);
MainSplitContainerControl.Panel1.Controls.Add(LeftSplitContainerControl);
MainSplitContainerControl.Panel2.Controls.Add(this.pl_main);
this.Controls.Remove(this.ssc_main);
this.Controls.Add(MainSplitContainerControl);
string MainWidth = IniHelper.Read(string.Format("bill_SpecialMain_Width_{0}", this.SysModel.ModuleCode));
MainWidth = string.IsNullOrWhiteSpace(MainWidth) ? (MainSplitContainerControl.ClientSize.Width / 2) + "" : MainWidth;
MainSplitContainerControl.SplitterPosition = Convert.ToInt32(MainWidth);
string LeftWidth = IniHelper.Read(string.Format("bill_SpecialLeft_Width_{0}", this.SysModel.ModuleCode));
LeftWidth = string.IsNullOrWhiteSpace(LeftWidth) ? (LeftSplitContainerControl.ClientSize.Width / 2) + "" : LeftWidth;
LeftSplitContainerControl.SplitterPosition = Convert.ToInt32(LeftWidth);
MainSplitContainerControl.SplitterMoved += new System.EventHandler(OnSpecialMainSplitterMoved);
LeftSplitContainerControl.SplitterMoved += new System.EventHandler(OnSpecialLeftSplitterMoved);
MainSplitContainerControl.BringToFront();
}
/// <summary>
/// 分割条移动
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnSpecialMainSplitterMoved(object sender, EventArgs e)
{
if (this._isInitFinish)
{
SplitContainerControl splitContainerControl = sender as SplitContainerControl;
IniHelper.Write(string.Format("bill_SpecialMain_Width_{0}", this.SysModel.ModuleCode), splitContainerControl.SplitterPosition + "");
}
}
/// <summary>
/// 分割条移动
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnSpecialLeftSplitterMoved(object sender, EventArgs e)
{
if (this._isInitFinish)
{
SplitContainerControl splitContainerControl = sender as SplitContainerControl;
IniHelper.Write(string.Format("bill_SpecialLeft_Width_{0}", this.SysModel.ModuleCode), splitContainerControl.SplitterPosition + "");
}
}
}
}
@@ -61,6 +61,10 @@ namespace Lskj.PubBill.Model
public string Orderid;// 来源页签序号
public string DetailMenuCode;// 来源模块号
public BillSourceModel(DataRow item)
{
if (item == null) return;
@@ -106,6 +110,7 @@ namespace Lskj.PubBill.Model
this.DragAndSave = item.Table.Columns.Contains("DragAndSave") && "1".Equals(item["DragAndSave"] + "") ? true : false;
this.TreeInhibitSort = item.Table.Columns.Contains("TreeInhibitSort") && "1".Equals(item["TreeInhibitSort"] + "") ? true : false;
this.Orderid = item.Table.Columns.Contains("Orderid") ? item["Orderid"] + "" : "";
this.DetailMenuCode = item.Table.Columns.Contains("DetailMenuCode") ? item["DetailMenuCode"] + "" : "";
}
/// <summary>
/// 改变来源类型
@@ -115,5 +120,14 @@ namespace Lskj.PubBill.Model
{
this.SourceType = sourceType;
}
/// <summary>
/// 改变来源明细类型
/// </summary>
/// <param name="sourceType"></param>
public void ChangeSourceDetailType(string sourceDetailType)
{
this.sourceDetailType = sourceDetailType;
}
}
}
@@ -54,6 +54,10 @@ namespace Lskj.PubBill.Model
/// 单据来源明细表格的明细
/// </summary>
public GridControlEx GridDetailDetailControlObj;
/// <summary>
/// 单据来源明细模块
/// </summary>
public ModuleGridEx GridDetailModuleGridEx;
public bool IsChange = false;
@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using Lskj.Control;
namespace Lskj.PubCodeDesign
{
internal class CodeDesignModuleGridEx : ModuleGridEx
{
protected override void OnCreateControl()
{
base.OnCreateControl();
HideTopToolPanel();
}
public void HideTopToolPanel()
{
CollapseChildControl(this, "pl_top");
HideChildControl(this, "pl_top_right");
HideChildControl(this, "ddbOper");
HideChildControl(this, "ddbPrint");
HideChildControl(this, "btnRefresh");
}
public void AddNewLogic()
{
this.ExternallyTriggeredAdd();
}
public void EnsureHiddenSaveColumns(IEnumerable<string> fieldNames)
{
DataTable gridColumns = GetGridColumns();
if (gridColumns == null || fieldNames == null) return;
foreach (string fieldName in fieldNames.Where(n => !string.IsNullOrWhiteSpace(n)))
{
EnsureHiddenGridColumn(gridColumns, fieldName);
}
}
private DataTable GetGridColumns()
{
FieldInfo field = typeof(ModuleGridEx).GetField("_gridColumns", BindingFlags.Instance | BindingFlags.NonPublic);
return field == null ? null : field.GetValue(this) as DataTable;
}
private static void EnsureHiddenGridColumn(DataTable gridColumns, string fieldName)
{
if (gridColumns.Rows.Cast<DataRow>().Any(n => string.Equals(n["fieldname"] + "", fieldName, StringComparison.OrdinalIgnoreCase)))
{
return;
}
DataRow row = gridColumns.NewRow();
SetColumnValue(row, "fieldname", fieldName);
SetColumnValue(row, "username", fieldName);
SetColumnValue(row, "sysname", fieldName);
SetColumnValue(row, "width", 0);
SetColumnValue(row, "visible", 0);
SetColumnValue(row, "fieldtype", 1);
SetColumnValue(row, "fieldTypeId", 1);
SetColumnValue(row, "nullable", 1);
SetColumnValue(row, "edited", 1);
SetColumnValue(row, "sortid", 9999);
gridColumns.Rows.Add(row);
}
private static void SetColumnValue(DataRow row, string columnName, object value)
{
if (row == null || row.Table == null || !row.Table.Columns.Contains(columnName)) return;
row[columnName] = value ?? DBNull.Value;
}
private static void CollapseChildControl(System.Windows.Forms.Control parent, string controlName)
{
if (parent == null || string.IsNullOrWhiteSpace(controlName)) return;
foreach (System.Windows.Forms.Control child in parent.Controls)
{
if (string.Equals(child.Name, controlName, StringComparison.OrdinalIgnoreCase))
{
child.Visible = false;
child.Height = 0;
child.Margin = Padding.Empty;
}
CollapseChildControl(child, controlName);
}
}
private static void HideChildControl(System.Windows.Forms.Control parent, string controlName)
{
if (parent == null || string.IsNullOrWhiteSpace(controlName)) return;
foreach (System.Windows.Forms.Control child in parent.Controls)
{
if (string.Equals(child.Name, controlName, StringComparison.OrdinalIgnoreCase))
{
child.Visible = false;
}
HideChildControl(child, controlName);
}
}
}
}
@@ -0,0 +1,74 @@
using System;
using System.Data;
namespace Lskj.PubCodeDesign
{
internal sealed class TreeNodeData
{
public string NodeType;
public string MenuKey;
public int MenuLevel;
public DataRow MenuRow;
public string MenuCaption;
public string ModuleCode;
public int SchemeId;
public string SchemeCode;
public string SchemeName;
public bool BindModule;
public string BindSubSysId;
public string BindMenuStruct1;
public string BindMenuStruct2;
public string BindMenuId;
public string BindModuleCode;
}
internal sealed class MenuComboItem
{
public string Text;
public string SubSysId;
public string MenuStruct;
public string MenuId;
public string ModuleCode;
public DataRow Row;
public override string ToString()
{
return string.IsNullOrWhiteSpace(this.Text) ? base.ToString() : this.Text;
}
}
internal sealed class FieldDesignItem
{
public string UserName;
public string FieldName;
public string RuntimeFieldName;
public int FieldTypeId;
public int ControlWidth;
public int ControlHeight;
public FieldDesignItem Clone()
{
return new FieldDesignItem
{
UserName = this.UserName,
FieldName = this.FieldName,
RuntimeFieldName = this.RuntimeFieldName,
FieldTypeId = this.FieldTypeId,
ControlWidth = this.ControlWidth,
ControlHeight = this.ControlHeight
};
}
}
internal sealed class TableColumnSpec
{
public TableColumnSpec(string name, string definition)
{
this.Name = name;
this.Definition = definition;
}
public string Name;
public string Definition;
}
}
@@ -0,0 +1,886 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using Lskj.Business;
using Lskj.Business.Impl;
using Lskj.Control;
using Lskj.Core;
using Lskj.Util;
namespace Lskj.PubCodeDesign
{
internal static class CodeSchemeStorage
{
private const string SchemeTableName = "P_CodeSchemeTab";
private const string SchemeControlTableName = "P_CodeSchemeControlTab";
private const string CodeRecordTableName = "P_CodeSchemeRecordTab";
private const string CodeGenerateProcedureName = "P_create_CodeSchemeDocumentPr";
private const string NumberRuleTableName = "p_systemNumberRuleTab";
private const string DesignRuleUseColumn = "UseEd";
private const string DesignRuleSortColumn = "SortNo";
private const string DesignRuleFieldNameColumn = "FieldName";
private const string NumberRuleSchemeIdColumn = "SchemeId";
private const string NumberRuleSchemeCodeColumn = "SchemeCode";
private const string NumberRuleSchemeNameColumn = "SchemeName";
private const string NumberRuleMenuKeyColumn = "MenuKey";
private const string NumberRuleBindModuleColumn = "BindModule";
private const string NumberRuleBindModuleCodeColumn = "BindModuleCode";
private const string NumberRuleModIdColumn = "modid";
internal static void EnsureCodeSchemeStorage()
{
try
{
EnsureTable(SchemeTableName, GetCreateSchemeTableSql(), GetSchemeTableColumns());
EnsureTable(SchemeControlTableName, GetCreateSchemeControlTableSql(), GetSchemeControlTableColumns());
EnsureCodeRecordStorage();
DropIndexIfExists(SchemeControlTableName, "UX_CodeSchemeControl_Field");
DropIndexIfExists(SchemeControlTableName, "IX_CodeSchemeControl_Source");
DropIndexIfExists(SchemeTableName, "IX_CodeScheme_Menu");
DeleteDisabledCodeSchemes();
DropColumnIfExists(SchemeTableName, DesignRuleUseColumn);
RemoveLegacySchemeControlColumns();
EnsureIndex("UX_CodeScheme_Code", "CREATE UNIQUE INDEX UX_CodeScheme_Code ON P_CodeSchemeTab(SchemeCode)");
EnsureIndex("IX_CodeScheme_Menu", "CREATE INDEX IX_CodeScheme_Menu ON P_CodeSchemeTab(MenuKey)");
EnsureRuleStorage();
EnsureCodeGenerateProcedure();
EnsureIndexIfColumnsExist(SchemeControlTableName, new string[] { NumberRuleSchemeIdColumn, DesignRuleSortColumn }, "IX_CodeSchemeControl_Scheme", "CREATE INDEX IX_CodeSchemeControl_Scheme ON P_CodeSchemeControlTab(SchemeId, SortNo)");
EnsureIndexIfColumnsExist(SchemeControlTableName, new string[] { NumberRuleSchemeIdColumn, DesignRuleFieldNameColumn }, "IX_CodeSchemeControl_Field", "CREATE INDEX IX_CodeSchemeControl_Field ON P_CodeSchemeControlTab(SchemeId, FieldName)");
EnsureConstraint("FK_CodeSchemeControl_Scheme", "ALTER TABLE P_CodeSchemeControlTab ADD CONSTRAINT FK_CodeSchemeControl_Scheme FOREIGN KEY (SchemeId) REFERENCES P_CodeSchemeTab(SchemeId)");
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
MessageUtil.Show("编码方案表结构初始化失败:" + ex.Message);
}
}
private static void EnsureTable(string tableName, string createSql, List<TableColumnSpec> columns)
{
if (!TableExists(tableName))
{
SqlHelper.ExecuteNonQuery(createSql);
return;
}
foreach (TableColumnSpec column in columns)
{
if (!ColumnExists(tableName, column.Name))
{
SqlHelper.ExecuteNonQuery(string.Format("ALTER TABLE {0} ADD {1} {2}", tableName, column.Name, column.Definition));
}
}
}
private static void RemoveLegacySchemeControlColumns()
{
string[] legacyColumns =
{
"ControlType",
"FieldTypeId",
"ModuleCode",
"SourceType",
"SourceIndex",
"LabelText",
"UserName",
"ControlConfig",
"SchemeControlId",
"ControlWidth",
"ControlHeight",
DesignRuleUseColumn
};
foreach (string columnName in legacyColumns)
{
DropColumnIfExists(SchemeControlTableName, columnName);
}
}
private static void DeleteDisabledCodeSchemes()
{
if (!TableExists(SchemeTableName) || !ColumnExists(SchemeTableName, DesignRuleUseColumn)) return;
string sql = "SELECT SchemeId, BindModule, BindModuleCode FROM P_CodeSchemeTab WHERE ISNULL(UseEd, 1) = 0";
DataTable table = SqlHelper.ExecuteDataTable(sql);
if (table == null || table.Rows.Count == 0) return;
foreach (DataRow row in table.Rows)
{
int schemeId = ToInt(row["SchemeId"]);
string bindModuleCode = ToBool(row["BindModule"]) ? row["BindModuleCode"] + "" : string.Empty;
DeleteRuleRows(SchemeControlTableName, schemeId);
if (!string.IsNullOrWhiteSpace(bindModuleCode) && !BindModuleOwnedByEnabledScheme(bindModuleCode))
{
DeleteBindModuleNumberRuleRows(bindModuleCode);
}
string deleteSql = "DELETE FROM P_CodeSchemeTab WHERE SchemeId = @SchemeId";
SqlHelper.ExecuteNonQuery(CommandType.Text, deleteSql, new SqlParameter[] { new SqlParameter("@SchemeId", schemeId) });
}
}
private static bool BindModuleOwnedByEnabledScheme(string bindModuleCode)
{
if (string.IsNullOrWhiteSpace(bindModuleCode) || !TableExists(SchemeTableName) || !ColumnExists(SchemeTableName, DesignRuleUseColumn)) return false;
string sql = @"
SELECT COUNT(1)
FROM P_CodeSchemeTab
WHERE ISNULL(UseEd, 1) = 1
AND ISNULL(BindModule, 0) = 1
AND ISNULL(BindModuleCode, '') = @BindModuleCode";
object result = SqlHelper.ExecuteScalar(CommandType.Text, sql, new SqlParameter[] { new SqlParameter("@BindModuleCode", bindModuleCode) });
return ToInt(result) > 0;
}
private static void DeleteRuleRows(string tableName, int schemeId)
{
if (schemeId <= 0 || string.IsNullOrWhiteSpace(tableName) || !TableExists(tableName) || !ColumnExists(tableName, NumberRuleSchemeIdColumn)) return;
string sql = string.Format("DELETE FROM {0} WHERE {1} = @SchemeId", QuoteSqlIdentifier(tableName), QuoteSqlIdentifier(NumberRuleSchemeIdColumn));
SqlHelper.ExecuteNonQuery(CommandType.Text, sql, new SqlParameter[] { new SqlParameter("@SchemeId", schemeId) });
}
private static void DeleteBindModuleNumberRuleRows(string bindModuleCode)
{
if (string.IsNullOrWhiteSpace(bindModuleCode) || !TableExists(NumberRuleTableName)) return;
List<string> moduleConditions = new List<string>();
if (ColumnExists(NumberRuleTableName, NumberRuleModIdColumn))
{
moduleConditions.Add(string.Format("ISNULL(CONVERT(NVARCHAR(100), {0}), '') = @BindModuleCode", QuoteSqlIdentifier(NumberRuleModIdColumn)));
}
if (ColumnExists(NumberRuleTableName, NumberRuleBindModuleCodeColumn))
{
moduleConditions.Add(string.Format("ISNULL(CONVERT(NVARCHAR(100), {0}), '') = @BindModuleCode", QuoteSqlIdentifier(NumberRuleBindModuleCodeColumn)));
}
if (moduleConditions.Count == 0) return;
string sql = string.Format("DELETE FROM {0} WHERE ({1})", QuoteSqlIdentifier(NumberRuleTableName), string.Join(" OR ", moduleConditions.ToArray()));
SqlHelper.ExecuteNonQuery(CommandType.Text, sql, new SqlParameter[] { new SqlParameter("@BindModuleCode", bindModuleCode) });
}
internal static bool TableExists(string tableName)
{
string sql = "SELECT COUNT(1) FROM sysobjects WHERE id = OBJECT_ID(@TableName) AND xtype = 'U'";
object result = SqlHelper.ExecuteScalar(CommandType.Text, sql, new SqlParameter[] { new SqlParameter("@TableName", tableName) });
return Convert.ToInt32(result) > 0;
}
internal static bool ColumnExists(string tableName, string columnName)
{
string sql = "SELECT COUNT(1) FROM sys.columns WHERE object_id = OBJECT_ID(@TableName) AND name = @ColumnName";
object result = SqlHelper.ExecuteScalar(CommandType.Text, sql, new SqlParameter[]
{
new SqlParameter("@TableName", tableName),
new SqlParameter("@ColumnName", columnName)
});
return Convert.ToInt32(result) > 0;
}
private static void EnsureIndex(string indexName, string createSql)
{
try
{
string sql = "SELECT COUNT(1) FROM sys.indexes WHERE name = @IndexName";
object result = SqlHelper.ExecuteScalar(CommandType.Text, sql, new SqlParameter[] { new SqlParameter("@IndexName", indexName) });
if (Convert.ToInt32(result) == 0)
{
SqlHelper.ExecuteNonQuery(createSql);
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
}
}
internal static void EnsureIndexIfColumnsExist(string tableName, string[] columnNames, string indexName, string createSql)
{
if (string.IsNullOrWhiteSpace(tableName) || columnNames == null) return;
foreach (string columnName in columnNames)
{
if (!ColumnExists(tableName, columnName)) return;
}
EnsureIndex(indexName, createSql);
}
private static void EnsureConstraint(string constraintName, string createSql)
{
try
{
string sql = "SELECT COUNT(1) FROM sys.objects WHERE name = @ConstraintName";
object result = SqlHelper.ExecuteScalar(CommandType.Text, sql, new SqlParameter[] { new SqlParameter("@ConstraintName", constraintName) });
if (Convert.ToInt32(result) == 0)
{
SqlHelper.ExecuteNonQuery(createSql);
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
}
}
private static void DropIndexIfExists(string tableName, string indexName)
{
try
{
string sql = "SELECT COUNT(1) FROM sys.indexes WHERE object_id = OBJECT_ID(@TableName) AND name = @IndexName";
object result = SqlHelper.ExecuteScalar(CommandType.Text, sql, new SqlParameter[]
{
new SqlParameter("@TableName", tableName),
new SqlParameter("@IndexName", indexName)
});
if (Convert.ToInt32(result) == 0) return;
SqlHelper.ExecuteNonQuery(string.Format("DROP INDEX {0} ON {1}", QuoteSqlIdentifier(indexName), QuoteSqlIdentifier(tableName)));
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
}
}
private static void DropColumnIfExists(string tableName, string columnName)
{
try
{
if (!ColumnExists(tableName, columnName)) return;
DropColumnIndexes(tableName, columnName);
DropColumnDefaultConstraints(tableName, columnName);
SqlHelper.ExecuteNonQuery(string.Format("ALTER TABLE {0} DROP COLUMN {1}", QuoteSqlIdentifier(tableName), QuoteSqlIdentifier(columnName)));
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
}
}
private static void DropColumnIndexes(string tableName, string columnName)
{
string sql = @"
DECLARE @sql NVARCHAR(MAX) = N'';
SELECT @sql = @sql +
CASE
WHEN i.is_primary_key = 1 OR i.is_unique_constraint = 1 THEN
N'ALTER TABLE ' + QUOTENAME(OBJECT_SCHEMA_NAME(i.object_id)) + N'.' + QUOTENAME(OBJECT_NAME(i.object_id)) + N' DROP CONSTRAINT ' + QUOTENAME(i.name) + N';'
ELSE
N'DROP INDEX ' + QUOTENAME(i.name) + N' ON ' + QUOTENAME(OBJECT_SCHEMA_NAME(i.object_id)) + N'.' + QUOTENAME(OBJECT_NAME(i.object_id)) + N';'
END
FROM sys.indexes i
INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
WHERE i.object_id = OBJECT_ID(@TableName)
AND c.name = @ColumnName
AND i.name IS NOT NULL;
IF LEN(@sql) > 0
BEGIN
EXEC sp_executesql @sql;
END";
SqlHelper.ExecuteNonQuery(CommandType.Text, sql, new SqlParameter[]
{
new SqlParameter("@TableName", tableName),
new SqlParameter("@ColumnName", columnName)
});
}
private static void DropColumnDefaultConstraints(string tableName, string columnName)
{
string sql = @"
DECLARE @sql NVARCHAR(MAX) = N'';
SELECT @sql = @sql + N'ALTER TABLE ' + QUOTENAME(OBJECT_SCHEMA_NAME(parent_object_id)) + N'.' + QUOTENAME(OBJECT_NAME(parent_object_id)) + N' DROP CONSTRAINT ' + QUOTENAME(name) + N';'
FROM sys.default_constraints
WHERE parent_object_id = OBJECT_ID(@TableName)
AND parent_column_id = COLUMNPROPERTY(OBJECT_ID(@TableName), @ColumnName, 'ColumnId');
IF LEN(@sql) > 0
BEGIN
EXEC sp_executesql @sql;
END";
SqlHelper.ExecuteNonQuery(CommandType.Text, sql, new SqlParameter[]
{
new SqlParameter("@TableName", tableName),
new SqlParameter("@ColumnName", columnName)
});
}
internal static string QuoteSqlIdentifier(string name)
{
return "[" + (name ?? string.Empty).Replace("]", "]]") + "]";
}
private static string GetCreateSchemeTableSql()
{
return @"CREATE TABLE P_CodeSchemeTab (
SchemeId INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
SchemeCode VARCHAR(50) NOT NULL,
SchemeName NVARCHAR(100) NOT NULL,
MenuKey VARCHAR(200) NOT NULL,
SubSysId VARCHAR(50) NULL,
MenuId VARCHAR(50) NULL,
MenuStruct VARCHAR(50) NULL,
MenuCaption NVARCHAR(100) NULL,
ModuleCode VARCHAR(100) NOT NULL,
BindModule BIT NOT NULL DEFAULT(0),
BindSubSysId VARCHAR(50) NULL,
BindMenuStruct1 VARCHAR(50) NULL,
BindMenuStruct2 VARCHAR(50) NULL,
BindMenuId VARCHAR(50) NULL,
BindModuleCode VARCHAR(100) NULL,
IsDefault BIT NOT NULL DEFAULT(0),
Remark NVARCHAR(500) NULL,
CreateUserId VARCHAR(50) NULL,
CreateUserName NVARCHAR(50) NULL,
CreateTime DATETIME NOT NULL DEFAULT(GETDATE()),
ModifyUserId VARCHAR(50) NULL,
ModifyUserName NVARCHAR(50) NULL,
ModifyTime DATETIME NULL
)";
}
private static string GetCreateSchemeControlTableSql()
{
return @"CREATE TABLE P_CodeSchemeControlTab (
SchemeId INT NOT NULL DEFAULT(0),
SchemeCode VARCHAR(50) NOT NULL DEFAULT(''),
SchemeName NVARCHAR(100) NULL,
MenuKey VARCHAR(200) NULL,
BindModule BIT NOT NULL DEFAULT(0),
BindModuleCode VARCHAR(100) NULL,
modid VARCHAR(100) NULL
)";
}
private static List<TableColumnSpec> GetSchemeTableColumns()
{
return new List<TableColumnSpec>
{
new TableColumnSpec("SchemeId", "INT IDENTITY(1,1) NOT NULL"),
new TableColumnSpec("SchemeCode", "VARCHAR(50) NOT NULL DEFAULT('')"),
new TableColumnSpec("SchemeName", "NVARCHAR(100) NOT NULL DEFAULT('')"),
new TableColumnSpec("MenuKey", "VARCHAR(200) NOT NULL DEFAULT('')"),
new TableColumnSpec("SubSysId", "VARCHAR(50) NULL"),
new TableColumnSpec("MenuId", "VARCHAR(50) NULL"),
new TableColumnSpec("MenuStruct", "VARCHAR(50) NULL"),
new TableColumnSpec("MenuCaption", "NVARCHAR(100) NULL"),
new TableColumnSpec("ModuleCode", "VARCHAR(100) NOT NULL DEFAULT('')"),
new TableColumnSpec("BindModule", "BIT NOT NULL DEFAULT(0)"),
new TableColumnSpec("BindSubSysId", "VARCHAR(50) NULL"),
new TableColumnSpec("BindMenuStruct1", "VARCHAR(50) NULL"),
new TableColumnSpec("BindMenuStruct2", "VARCHAR(50) NULL"),
new TableColumnSpec("BindMenuId", "VARCHAR(50) NULL"),
new TableColumnSpec("BindModuleCode", "VARCHAR(100) NULL"),
new TableColumnSpec("IsDefault", "BIT NOT NULL DEFAULT(0)"),
new TableColumnSpec("Remark", "NVARCHAR(500) NULL"),
new TableColumnSpec("CreateUserId", "VARCHAR(50) NULL"),
new TableColumnSpec("CreateUserName", "NVARCHAR(50) NULL"),
new TableColumnSpec("CreateTime", "DATETIME NOT NULL DEFAULT(GETDATE())"),
new TableColumnSpec("ModifyUserId", "VARCHAR(50) NULL"),
new TableColumnSpec("ModifyUserName", "NVARCHAR(50) NULL"),
new TableColumnSpec("ModifyTime", "DATETIME NULL")
};
}
private static List<TableColumnSpec> GetSchemeControlTableColumns()
{
return new List<TableColumnSpec>
{
new TableColumnSpec("SchemeId", "INT NOT NULL DEFAULT(0)"),
new TableColumnSpec("SchemeCode", "VARCHAR(50) NOT NULL DEFAULT('')"),
new TableColumnSpec("SchemeName", "NVARCHAR(100) NULL"),
new TableColumnSpec("MenuKey", "VARCHAR(200) NULL"),
new TableColumnSpec("BindModule", "BIT NOT NULL DEFAULT(0)"),
new TableColumnSpec("BindModuleCode", "VARCHAR(100) NULL"),
new TableColumnSpec("modid", "VARCHAR(100) NULL")
};
}
private static string GetCreateCodeRecordTableSql()
{
return @"CREATE TABLE P_CodeSchemeRecordTab (
RecordId INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
SchemeId INT NOT NULL DEFAULT(0),
SchemeCode VARCHAR(50) NOT NULL DEFAULT(''),
SchemeName NVARCHAR(100) NULL,
MenuKey VARCHAR(200) NULL,
SequenceKey NVARCHAR(300) NOT NULL DEFAULT(''),
SerialNo INT NOT NULL DEFAULT(0),
CodeValue NVARCHAR(300) NOT NULL,
RuleText NVARCHAR(MAX) NULL,
CreateUserId VARCHAR(50) NULL,
CreateUserName NVARCHAR(50) NULL,
CreateTime DATETIME NOT NULL DEFAULT(GETDATE())
)";
}
private static List<TableColumnSpec> GetCodeRecordTableColumns()
{
return new List<TableColumnSpec>
{
new TableColumnSpec("RecordId", "INT IDENTITY(1,1) NOT NULL"),
new TableColumnSpec("SchemeId", "INT NOT NULL DEFAULT(0)"),
new TableColumnSpec("SchemeCode", "VARCHAR(50) NOT NULL DEFAULT('')"),
new TableColumnSpec("SchemeName", "NVARCHAR(100) NULL"),
new TableColumnSpec("MenuKey", "VARCHAR(200) NULL"),
new TableColumnSpec("SequenceKey", "NVARCHAR(300) NOT NULL DEFAULT('')"),
new TableColumnSpec("SerialNo", "INT NOT NULL DEFAULT(0)"),
new TableColumnSpec("CodeValue", "NVARCHAR(300) NOT NULL DEFAULT('')"),
new TableColumnSpec("RuleText", "NVARCHAR(MAX) NULL"),
new TableColumnSpec("CreateUserId", "VARCHAR(50) NULL"),
new TableColumnSpec("CreateUserName", "NVARCHAR(50) NULL"),
new TableColumnSpec("CreateTime", "DATETIME NOT NULL DEFAULT(GETDATE())")
};
}
internal static void EnsureCodeRecordStorage()
{
EnsureTable(CodeRecordTableName, GetCreateCodeRecordTableSql(), GetCodeRecordTableColumns());
EnsureIndexIfColumnsExist(CodeRecordTableName, new string[] { "SchemeId", "CodeValue" }, "UX_CodeSchemeRecord_Code", "CREATE UNIQUE INDEX UX_CodeSchemeRecord_Code ON P_CodeSchemeRecordTab(SchemeId, CodeValue)");
EnsureIndexIfColumnsExist(CodeRecordTableName, new string[] { "SchemeId", "SequenceKey", "SerialNo" }, "IX_CodeSchemeRecord_Sequence", "CREATE INDEX IX_CodeSchemeRecord_Sequence ON P_CodeSchemeRecordTab(SchemeId, SequenceKey, SerialNo)");
}
internal static void EnsureCodeGenerateProcedure()
{
string createSql = string.Format(@"
IF OBJECT_ID(N'dbo.{0}', N'P') IS NULL
BEGIN
EXEC(N'CREATE PROCEDURE dbo.{0} AS BEGIN SET NOCOUNT ON; END')
END", CodeGenerateProcedureName);
SqlHelper.ExecuteNonQuery(CommandType.Text, createSql);
SqlHelper.ExecuteNonQuery(CommandType.Text, GetAlterCodeGenerateProcedureSql());
}
private static string GetAlterCodeGenerateProcedureSql()
{
return string.Format(@"
ALTER PROCEDURE dbo.{0}
@SchemeId INT,
@CreateUserId VARCHAR(50) = '',
@CreateUserName NVARCHAR(50) = '',
@return_id NVARCHAR(300) OUTPUT
AS
BEGIN
SET NOCOUNT ON;
DECLARE @SchemeCode VARCHAR(50);
DECLARE @SchemeName NVARCHAR(100);
DECLARE @MenuKey VARCHAR(200);
DECLARE @BindModule BIT;
SELECT
@SchemeCode = ISNULL(SchemeCode, ''),
@SchemeName = ISNULL(SchemeName, N''),
@MenuKey = ISNULL(MenuKey, ''),
@BindModule = ISNULL(BindModule, 0)
FROM P_CodeSchemeTab
WHERE SchemeId = @SchemeId;
IF @SchemeCode IS NULL
BEGIN
RAISERROR(N'未找到编码方案。', 16, 1);
RETURN;
END
IF ISNULL(@BindModule, 0) = 1
BEGIN
RAISERROR(N'当前方案已绑定模块,view模式只支持未绑定方案生成编码。', 16, 1);
RETURN;
END
DECLARE @defaultValue VARCHAR(MAX),
@defaultSql NVARCHAR(MAX),
@likeValue VARCHAR(MAX),
@likeSql NVARCHAR(MAX),
@prefixSql NVARCHAR(MAX),
@likePrefix VARCHAR(300),
@orderlen INT,
@emptyint INT,
@orderNumber VARCHAR(300),
@out_char VARCHAR(300),
@tmpSql NVARCHAR(MAX),
@tmpvar VARCHAR(100),
@avalue VARCHAR(300),
@RuleText NVARCHAR(MAX),
@SerialNo INT;
BEGIN TRY
SELECT CASE WHEN element=1 THEN QUOTENAME(RIGHT('0000000000'+ISNULL(LTRIM(defaultvalue),''),elementlen),'''')
WHEN element=2 THEN 'CONVERT(varchar(4),'+defaultvalue+',120)'
WHEN element=3 THEN 'RIGHT(CONVERT(varchar(4),'+defaultvalue+',120),2)'
WHEN element=4 THEN 'RIGHT('+QUOTENAME('00','''')+'+cast(month('+defaultvalue+') as varchar),2)'
WHEN element=5 THEN 'RIGHT('+QUOTENAME('00','''')+'+cast(day('+defaultvalue+') as varchar),2)'
WHEN element=6 AND ISNULL(elementlen,0)>0 THEN 'RIGHT('+QUOTENAME('000000000000','''')+'+'+defaultvalue+','+CAST(elementlen AS varchar)+')'
WHEN element=6 AND ISNULL(elementlen,0)=0 THEN defaultvalue
WHEN element=999 THEN QUOTENAME(CASE WHEN ISNULL(LTRIM(defaultvalue),'')='' THEN '0000000000000001' ELSE defaultvalue END,'''')
ELSE 'RIGHT('+QUOTENAME('000000000000','''')+'+'+defaultvalue+','+CAST(elementlen AS varchar)+')'
END AS defaultvalue,
ISNULL(splitchar,'') AS splitchar,
CASE WHEN element=1 AND isrelated=1 THEN QUOTENAME(RIGHT('0000000000'+ISNULL(LTRIM(defaultvalue),''),elementlen),'''')
WHEN element=2 AND isrelated=1 THEN 'CONVERT(varchar(4),'+defaultvalue+',120)'
WHEN element=3 AND isrelated=1 THEN 'RIGHT(CONVERT(varchar(4),'+defaultvalue+',120),2)'
WHEN element=4 AND isrelated=1 THEN 'RIGHT('+QUOTENAME('00','''')+'+cast(month('+defaultvalue+') as varchar),2)'
WHEN element=5 AND isrelated=1 THEN 'RIGHT('+QUOTENAME('00','''')+'+cast(day('+defaultvalue+') as varchar),2)'
WHEN element=6 AND isrelated=1 AND ISNULL(elementlen,0)>0 THEN 'RIGHT(''000000000000''+'+defaultvalue+','+CAST(elementlen AS varchar)+')'
WHEN element=6 AND isrelated=1 AND ISNULL(elementlen,0)=0 THEN defaultvalue
WHEN element=999 THEN ''
WHEN isrelated=0 THEN QUOTENAME(RIGHT('__________',elementlen),'''')
ELSE ''
END AS likevalue,
CASE WHEN element=999 THEN elementlen ELSE 0 END AS orderlen
INTO #tempordernumber
FROM (
SELECT
CASE WHEN ISNUMERIC(CONVERT(VARCHAR(20), element)) = 1 THEN CONVERT(INT, element) ELSE 0 END AS element,
ISNULL(CONVERT(VARCHAR(MAX), defaultvalue), '') AS defaultvalue,
ISNULL(CONVERT(VARCHAR(50), splitchar), '') AS splitchar,
CASE WHEN ISNUMERIC(CONVERT(VARCHAR(20), elementlen)) = 1 THEN CONVERT(INT, elementlen) ELSE 0 END AS elementlen,
CASE WHEN ISNULL(CONVERT(VARCHAR(20), isrelated), '0') IN ('1', 'True', 'true', '是') THEN 1 ELSE 0 END AS isrelated,
CASE WHEN ISNUMERIC(CONVERT(VARCHAR(20), Orderid)) = 1 THEN CONVERT(INT, Orderid) ELSE 0 END AS Orderid,
CASE WHEN ISNUMERIC(CONVERT(VARCHAR(20), ID)) = 1 THEN CONVERT(INT, ID) ELSE 0 END AS ID
FROM P_CodeSchemeControlTab
WHERE SchemeId=@SchemeId
AND ISNULL(CONVERT(NVARCHAR(20), enableFlag), N'1') IN (N'1', N'True', N'true', N'是')
) ruleSource
ORDER BY Orderid, ID;
SET @defaultValue='';
SET @defaultSql='';
SET @likeValue='';
SET @likeSql='';
SET @prefixSql='';
SET @likePrefix='';
SET @orderlen=0;
SET @emptyint=0;
SET @orderNumber='';
SET @out_char='';
SET @tmpvar='';
SET @avalue='';
SET @SerialNo=0;
SELECT @emptyint=1,
@defaultValue=@defaultValue+defaultvalue+'+'+QUOTENAME(splitchar,'''')+'+',
@likeValue=@likeValue+CASE WHEN likevalue='' THEN '' ELSE likevalue+'+'+QUOTENAME(splitchar,'''')+'+' END,
@orderlen=@orderlen+orderlen
FROM #tempordernumber;
SET @defaultValue=REPLACE(@defaultValue,'{{&loginid&}}',CAST(ISNULL(@CreateUserId,'') AS VARCHAR));
SET @likeValue=REPLACE(@likeValue,'{{&loginid&}}',CAST(ISNULL(@CreateUserId,'') AS VARCHAR));
IF ISNULL(@emptyint,0)=0
BEGIN
SET @defaultSql='select @out_char=replace(convert(varchar(10),getdate(),120),''-'','''')+''0001''';
SET @likeSql='select @out_char=max(CodeValue) from P_CodeSchemeRecordTab with(updlock,holdlock) where SchemeId=@SchemeId and CodeValue like '+QUOTENAME(REPLACE(CONVERT(VARCHAR(10),GETDATE(),120),'-','')+'%','''');
SET @prefixSql='select @out_char='+QUOTENAME(REPLACE(CONVERT(VARCHAR(10),GETDATE(),120),'-',''),'''');
SET @orderlen=4;
END
ELSE
BEGIN
IF ISNULL(@orderlen,0)<=0
BEGIN
RAISERROR(N'当前方案未配置流水号规则。', 16, 1);
RETURN;
END
IF ISNULL(@defaultValue,'')<>''
SET @defaultSql='select @out_char='+LEFT(@defaultValue,LEN(@defaultValue)-1);
IF ISNULL(@likeValue,'')<>''
BEGIN
SET @likeSql='select @out_char=max(CodeValue) from P_CodeSchemeRecordTab with(updlock,holdlock) where SchemeId=@SchemeId and CodeValue like '+@likeValue+QUOTENAME('%','''');
SET @prefixSql='select @out_char='+LEFT(@likeValue,LEN(@likeValue)-1);
END
ELSE
BEGIN
SET @likeSql='select @out_char=max(CodeValue) from P_CodeSchemeRecordTab with(updlock,holdlock) where SchemeId=@SchemeId';
SET @prefixSql='select @out_char=''''';
END
END
WHILE CHARINDEX('{{&',@defaultSql)>0
BEGIN
IF CHARINDEX('&}}',@defaultSql)<1
BEGIN
RAISERROR(N'变量名缺少&}}号。', 16, 1);
RETURN;
END
SET @tmpvar=SUBSTRING(@defaultSql,CHARINDEX('{{&',@defaultSql),CHARINDEX('&}}',@defaultSql)-CHARINDEX('{{&',@defaultSql)+2);
RAISERROR(N'未绑定模块方案不支持字段变量:%s。', 16, 1, @tmpvar);
RETURN;
END
WHILE CHARINDEX('{{&',@likeSql)>0
BEGIN
IF CHARINDEX('&}}',@likeSql)<1
BEGIN
RAISERROR(N'变量名缺少&}}号。', 16, 1);
RETURN;
END
SET @tmpvar=SUBSTRING(@likeSql,CHARINDEX('{{&',@likeSql),CHARINDEX('&}}',@likeSql)-CHARINDEX('{{&',@likeSql)+2);
RAISERROR(N'未绑定模块方案不支持字段变量:%s。', 16, 1, @tmpvar);
RETURN;
END
SET @RuleText=ISNULL(@defaultSql,N'')+CHAR(13)+CHAR(10)+ISNULL(@likeSql,N'');
BEGIN TRANSACTION;
SET @out_char='';
IF ISNULL(@likeSql,'')<>''
EXEC sp_executesql @likeSql,N'@SchemeId int,@out_char varchar(300) output', @SchemeId, @out_char output;
IF ISNULL(LTRIM(@out_char),'')<>''
BEGIN
SET @orderNumber=LEFT(@out_char, LEN(@out_char)-@orderlen)+
RIGHT('0000000000'+CAST(CAST(RIGHT(@out_char,@orderlen) AS INT)+1 AS VARCHAR),@orderlen);
END
ELSE
BEGIN
EXEC sp_executesql @defaultSql,N'@out_char varchar(300) output', @out_char output;
SET @orderNumber=ISNULL(LTRIM(@out_char),'');
END
SET @out_char='';
IF ISNULL(@prefixSql,'')<>''
BEGIN
EXEC sp_executesql @prefixSql,N'@out_char varchar(300) output', @out_char output;
SET @likePrefix=ISNULL(@out_char,'');
END
IF LEN(ISNULL(@orderNumber,''))=0
RAISERROR(N'生成编码为空,请检查方案规则。', 16, 1);
IF LEN(@orderNumber)>300
RAISERROR(N'生成编码长度超过300,请检查方案规则。', 16, 1);
IF EXISTS (SELECT 1 FROM P_CodeSchemeRecordTab WITH (UPDLOCK, HOLDLOCK) WHERE SchemeId=@SchemeId AND CodeValue=@orderNumber)
RAISERROR(N'生成编码重复,请检查方案规则。', 16, 1);
IF ISNUMERIC(RIGHT(@orderNumber,@orderlen))=1
SET @SerialNo=CONVERT(INT,RIGHT(@orderNumber,@orderlen));
INSERT INTO P_CodeSchemeRecordTab
(SchemeId, SchemeCode, SchemeName, MenuKey, SequenceKey, SerialNo, CodeValue, RuleText, CreateUserId, CreateUserName, CreateTime)
VALUES
(@SchemeId, @SchemeCode, @SchemeName, @MenuKey, ISNULL(@likePrefix,''), @SerialNo, @orderNumber, @RuleText, @CreateUserId, @CreateUserName, GETDATE());
SET @return_id=@orderNumber;
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION;
DECLARE @ErrorMessage NVARCHAR(4000);
SET @ErrorMessage = ERROR_MESSAGE();
RAISERROR(@ErrorMessage, 16, 1);
END CATCH
END", CodeGenerateProcedureName);
}
internal static void EnsureRuleStorage()
{
EnsureSchemeControlRuleStorage();
}
private static void EnsureNumberRuleSchemeStorage()
{
}
private static void EnsureSchemeControlRuleStorage()
{
if (!TableExists(SchemeControlTableName)) return;
foreach (TableColumnSpec column in GetNumberRuleSchemeColumns())
{
if (!ColumnExists(SchemeControlTableName, column.Name))
{
SqlHelper.ExecuteNonQuery(string.Format("ALTER TABLE {0} ADD {1} {2}", QuoteSqlIdentifier(SchemeControlTableName), QuoteSqlIdentifier(column.Name), column.Definition));
}
}
if (TableExists(NumberRuleTableName))
{
List<TableColumnSpec> mirrorColumns = GetNumberRuleMirrorColumns();
foreach (TableColumnSpec column in mirrorColumns)
{
if (!ColumnExists(SchemeControlTableName, column.Name))
{
SqlHelper.ExecuteNonQuery(string.Format("ALTER TABLE {0} ADD {1} {2}", QuoteSqlIdentifier(SchemeControlTableName), QuoteSqlIdentifier(column.Name), column.Definition));
}
}
RemoveSchemeControlUnusedRuleColumns(mirrorColumns);
}
EnsureIndex("IX_CodeSchemeControl_Menu", "CREATE INDEX IX_CodeSchemeControl_Menu ON P_CodeSchemeControlTab(MenuKey, SchemeId)");
}
private static void RemoveSchemeControlUnusedRuleColumns(List<TableColumnSpec> mirrorColumns)
{
if (!TableExists(SchemeControlTableName)) return;
HashSet<string> keepColumns = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (TableColumnSpec column in GetNumberRuleSchemeColumns())
{
keepColumns.Add(column.Name);
}
if (mirrorColumns != null)
{
foreach (TableColumnSpec column in mirrorColumns)
{
keepColumns.Add(column.Name);
}
}
foreach (string columnName in GetTableColumnNames(SchemeControlTableName))
{
if (keepColumns.Contains(columnName)) continue;
DropColumnIfExists(SchemeControlTableName, columnName);
}
}
private static List<string> GetTableColumnNames(string tableName)
{
List<string> columns = new List<string>();
if (string.IsNullOrWhiteSpace(tableName) || !TableExists(tableName)) return columns;
string sql = @"SELECT name FROM sys.columns WHERE object_id = OBJECT_ID(@TableName) ORDER BY column_id";
DataTable table = SqlHelper.ExecuteDataTable(sql, new SqlParameter[] { new SqlParameter("@TableName", tableName) });
if (table == null) return columns;
foreach (DataRow row in table.Rows)
{
string columnName = row["name"] + "";
if (!string.IsNullOrWhiteSpace(columnName))
{
columns.Add(columnName);
}
}
return columns;
}
private static List<TableColumnSpec> GetNumberRuleSchemeColumns()
{
return new List<TableColumnSpec>
{
new TableColumnSpec(NumberRuleSchemeIdColumn, "INT NOT NULL DEFAULT(0)"),
new TableColumnSpec(NumberRuleSchemeCodeColumn, "VARCHAR(50) NOT NULL DEFAULT('')"),
new TableColumnSpec(NumberRuleSchemeNameColumn, "NVARCHAR(100) NULL"),
new TableColumnSpec(NumberRuleMenuKeyColumn, "VARCHAR(200) NULL"),
new TableColumnSpec(NumberRuleBindModuleColumn, "BIT NOT NULL DEFAULT(0)"),
new TableColumnSpec(NumberRuleBindModuleCodeColumn, "VARCHAR(100) NULL"),
new TableColumnSpec(NumberRuleModIdColumn, "VARCHAR(100) NULL")
};
}
private static List<TableColumnSpec> GetNumberRuleMirrorColumns()
{
List<TableColumnSpec> columns = new List<TableColumnSpec>();
string sql = @"
SELECT
c.COLUMN_NAME,
c.DATA_TYPE,
c.CHARACTER_MAXIMUM_LENGTH,
c.NUMERIC_PRECISION,
c.NUMERIC_SCALE,
COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA + '.' + c.TABLE_NAME), c.COLUMN_NAME, 'IsComputed') AS IsComputed
FROM INFORMATION_SCHEMA.COLUMNS c
WHERE c.TABLE_NAME = @TableName
ORDER BY c.ORDINAL_POSITION";
DataTable table = SqlHelper.ExecuteDataTable(sql, new SqlParameter[] { new SqlParameter("@TableName", NumberRuleTableName) });
if (table == null) return columns;
foreach (DataRow row in table.Rows)
{
string columnName = row["COLUMN_NAME"] + "";
if (string.IsNullOrWhiteSpace(columnName)) continue;
if (string.Equals(columnName, DesignRuleUseColumn, StringComparison.OrdinalIgnoreCase)) continue;
if (ToInt(row["IsComputed"]) == 1) continue;
string definition = GetColumnDefinitionFromSchemaRow(row);
if (string.IsNullOrWhiteSpace(definition)) continue;
columns.Add(new TableColumnSpec(columnName, definition));
}
return columns;
}
private static string GetColumnDefinitionFromSchemaRow(DataRow row)
{
string dataType = (row["DATA_TYPE"] + "").Trim();
if (string.IsNullOrWhiteSpace(dataType)) return string.Empty;
if (string.Equals(dataType, "timestamp", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "rowversion", StringComparison.OrdinalIgnoreCase))
{
return string.Empty;
}
string typeText = dataType;
int maxLength = ToInt(row["CHARACTER_MAXIMUM_LENGTH"]);
if (IsLengthColumnType(dataType))
{
typeText += maxLength < 0 ? "(MAX)" : "(" + maxLength + ")";
}
else if (IsPrecisionColumnType(dataType))
{
int precision = ToInt(row["NUMERIC_PRECISION"]);
int scale = ToInt(row["NUMERIC_SCALE"]);
if (precision > 0)
{
typeText += "(" + precision + "," + Math.Max(0, scale) + ")";
}
}
else if (IsDateTimePrecisionColumnType(dataType))
{
int scale = ToInt(row["NUMERIC_SCALE"]);
if (scale > 0)
{
typeText += "(" + scale + ")";
}
}
return typeText + " NULL";
}
private static int ToInt(object value)
{
int result;
return int.TryParse(value + "", out result) ? result : 0;
}
private static bool ToBool(object value)
{
if (value == null || value == DBNull.Value) return false;
bool boolValue;
if (bool.TryParse(value + "", out boolValue)) return boolValue;
return ToInt(value) != 0;
}
private static bool IsLengthColumnType(string dataType)
{
return string.Equals(dataType, "varchar", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "nvarchar", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "char", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "nchar", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "varbinary", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "binary", StringComparison.OrdinalIgnoreCase);
}
private static bool IsPrecisionColumnType(string dataType)
{
return string.Equals(dataType, "decimal", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "numeric", StringComparison.OrdinalIgnoreCase);
}
private static bool IsDateTimePrecisionColumnType(string dataType)
{
return string.Equals(dataType, "datetime2", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "datetimeoffset", StringComparison.OrdinalIgnoreCase) ||
string.Equals(dataType, "time", StringComparison.OrdinalIgnoreCase);
}
}
}
@@ -0,0 +1,77 @@
using Lskj.Business;
using Lskj.Model;
using Lskj.Util;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
namespace Lskj.PubCodeDesign
{
/// <summary>
/// c#库被调用统一接口类
/// </summary>
public sealed class DllBaseClass : IForm
{
public DllBaseClass()
{
}
public DllBaseClass(string[] obj)
{
try
{
FrmMain main = new FrmMain();
DynamicCodeDesign moduleModel = new DynamicCodeDesign(obj);// 基础档案上下结构动态链接库参数
main.Model = moduleModel;
this.SubForm = main;
}
catch (Exception ex)
{
LogUtil.WriteError("Lskj.PubChart.dll--参数错误-->" + obj.ToString(), ex);
}
}
/// <summary>
/// 窗口
/// </summary>
public Form SubForm { get; set; }
}
public class DynamicCodeDesign : DynamicModel
{
public string ExecType = "0";
public DynamicCodeDesign(string[] args) : base(args)
{
// 右键菜单打开的模块没有moduleId,部分特殊模块没有moduleId比如添加界面.
if (!string.IsNullOrEmpty(args[5]))
{
base.ModuleId = Convert.ToInt32(args[5]);
}
if (args.Length > 6 && !string.IsNullOrWhiteSpace(args[6]))
{
base.ModuleCode = args[6];
}
if (args.Length > 7 && !string.IsNullOrWhiteSpace(args[7]))
{
ExecType = args[7];
}
if (!string.IsNullOrEmpty(args[args.Length - 1]))
{
try
{
JObject rowObject = JsonConvert.DeserializeObject<JObject>(args[args.Length - 1]);
JArray jArray = new JArray();
jArray.Add(rowObject);
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(jArray));
this.MaintabFocusedRow = dataTable.Rows[0];
}
catch (Exception)
{
}
}
}
}
}
+625
View File
@@ -0,0 +1,625 @@
namespace Lskj.PubCodeDesign
{
partial class FrmMain
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.splitRoot = new DevExpress.XtraEditors.SplitContainerControl();
this.pnlTreeHost = new DevExpress.XtraEditors.PanelControl();
this.treeMenu = new DevExpress.XtraTreeList.TreeList();
this.treeColumnMenu = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.imgMenuTree = new System.Windows.Forms.ImageList();
this.pnlLeftHeader = new DevExpress.XtraEditors.PanelControl();
this.lblMenuTitle = new DevExpress.XtraEditors.LabelControl();
this.pnlDesignWork = new DevExpress.XtraEditors.PanelControl();
this.gridDesignRules = new Lskj.PubCodeDesign.CodeDesignModuleGridEx();
this.pnlDesignGridHeader = new DevExpress.XtraEditors.PanelControl();
this.lblDesignGridTitle = new DevExpress.XtraEditors.LabelControl();
this.pnlBindModule = new DevExpress.XtraEditors.PanelControl();
this.cboBindLevel3 = new DevExpress.XtraEditors.ComboBoxEdit();
this.lblBindLevel3 = new DevExpress.XtraEditors.LabelControl();
this.cboBindLevel2 = new DevExpress.XtraEditors.ComboBoxEdit();
this.lblBindLevel2 = new DevExpress.XtraEditors.LabelControl();
this.cboBindLevel1 = new DevExpress.XtraEditors.ComboBoxEdit();
this.lblBindLevel1 = new DevExpress.XtraEditors.LabelControl();
this.chkBindModule = new DevExpress.XtraEditors.CheckEdit();
this.pnlViewWork = new DevExpress.XtraEditors.XtraScrollableControl();
this.pl_buttom = new DevExpress.XtraEditors.PanelControl();
this.btnAddLogic = new DevExpress.XtraEditors.SimpleButton();
this.btnDeleteLogic = new DevExpress.XtraEditors.SimpleButton();
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
this.pnlDesignerHeader = new DevExpress.XtraEditors.PanelControl();
this.btnDeleteScheme = new DevExpress.XtraEditors.SimpleButton();
this.btnGenerateCode = new DevExpress.XtraEditors.SimpleButton();
this.txtCodePreview = new DevExpress.XtraEditors.TextEdit();
this.lblCodePreview = new DevExpress.XtraEditors.LabelControl();
this.txtSchemeName = new DevExpress.XtraEditors.TextEdit();
this.label1 = new DevExpress.XtraEditors.LabelControl();
this.cmsMenuTree = new System.Windows.Forms.ContextMenuStrip();
this.menuAddScheme = new System.Windows.Forms.ToolStripMenuItem();
this.lblDesignerStatus = new DevExpress.XtraEditors.LabelControl();
((System.ComponentModel.ISupportInitialize)(this.splitRoot)).BeginInit();
this.splitRoot.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pnlTreeHost)).BeginInit();
this.pnlTreeHost.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.treeMenu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pnlLeftHeader)).BeginInit();
this.pnlLeftHeader.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pnlDesignWork)).BeginInit();
this.pnlDesignWork.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pnlDesignGridHeader)).BeginInit();
this.pnlDesignGridHeader.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pnlBindModule)).BeginInit();
this.pnlBindModule.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cboBindLevel3.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cboBindLevel2.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cboBindLevel1.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.chkBindModule.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pl_buttom)).BeginInit();
this.pl_buttom.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pnlDesignerHeader)).BeginInit();
this.pnlDesignerHeader.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.txtCodePreview.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txtSchemeName.Properties)).BeginInit();
this.cmsMenuTree.SuspendLayout();
this.SuspendLayout();
//
// splitRoot
//
this.splitRoot.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitRoot.Location = new System.Drawing.Point(0, 0);
this.splitRoot.Name = "splitRoot";
this.splitRoot.Panel1.Controls.Add(this.pnlTreeHost);
this.splitRoot.Panel1.Controls.Add(this.pnlLeftHeader);
this.splitRoot.Panel2.Controls.Add(this.pnlDesignWork);
this.splitRoot.Panel2.Controls.Add(this.pnlViewWork);
this.splitRoot.Panel2.Controls.Add(this.pl_buttom);
this.splitRoot.Panel2.Controls.Add(this.pnlDesignerHeader);
this.splitRoot.Size = new System.Drawing.Size(1297, 681);
this.splitRoot.SplitterPosition = 260;
this.splitRoot.TabIndex = 0;
this.splitRoot.Text = "splitRoot";
//
// pnlTreeHost
//
this.pnlTreeHost.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(253)))), ((int)(((byte)(255)))));
this.pnlTreeHost.Appearance.Options.UseBackColor = true;
this.pnlTreeHost.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pnlTreeHost.Controls.Add(this.treeMenu);
this.pnlTreeHost.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlTreeHost.Location = new System.Drawing.Point(0, 38);
this.pnlTreeHost.Name = "pnlTreeHost";
this.pnlTreeHost.Size = new System.Drawing.Size(260, 643);
this.pnlTreeHost.TabIndex = 1;
//
// treeMenu
//
this.treeMenu.Appearance.Empty.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(253)))), ((int)(((byte)(255)))));
this.treeMenu.Appearance.Empty.Options.UseBackColor = true;
this.treeMenu.Appearance.FocusedCell.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(207)))), ((int)(((byte)(226)))), ((int)(((byte)(243)))));
this.treeMenu.Appearance.FocusedCell.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.treeMenu.Appearance.FocusedCell.Options.UseBackColor = true;
this.treeMenu.Appearance.FocusedCell.Options.UseForeColor = true;
this.treeMenu.Appearance.FocusedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(207)))), ((int)(((byte)(226)))), ((int)(((byte)(243)))));
this.treeMenu.Appearance.FocusedRow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.treeMenu.Appearance.FocusedRow.Options.UseBackColor = true;
this.treeMenu.Appearance.FocusedRow.Options.UseForeColor = true;
this.treeMenu.Appearance.Row.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(253)))), ((int)(((byte)(255)))));
this.treeMenu.Appearance.Row.Font = new System.Drawing.Font("微软雅黑", 9.5F);
this.treeMenu.Appearance.Row.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.treeMenu.Appearance.Row.Options.UseBackColor = true;
this.treeMenu.Appearance.Row.Options.UseFont = true;
this.treeMenu.Appearance.Row.Options.UseForeColor = true;
this.treeMenu.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.treeMenu.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] {
this.treeColumnMenu});
this.treeMenu.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeMenu.Location = new System.Drawing.Point(0, 0);
this.treeMenu.Name = "treeMenu";
this.treeMenu.OptionsBehavior.Editable = false;
this.treeMenu.OptionsSelection.EnableAppearanceFocusedCell = false;
this.treeMenu.OptionsView.ShowColumns = false;
this.treeMenu.OptionsView.ShowHorzLines = false;
this.treeMenu.OptionsView.ShowIndicator = false;
this.treeMenu.OptionsView.ShowVertLines = false;
this.treeMenu.RowHeight = 28;
this.treeMenu.SelectImageList = this.imgMenuTree;
this.treeMenu.Size = new System.Drawing.Size(260, 643);
this.treeMenu.TabIndex = 0;
//
// treeColumnMenu
//
this.treeColumnMenu.Caption = "编码分类";
this.treeColumnMenu.FieldName = "Text";
this.treeColumnMenu.MinWidth = 35;
this.treeColumnMenu.Name = "treeColumnMenu";
this.treeColumnMenu.Visible = true;
this.treeColumnMenu.VisibleIndex = 0;
//
// imgMenuTree
//
this.imgMenuTree.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
this.imgMenuTree.ImageSize = new System.Drawing.Size(18, 18);
this.imgMenuTree.TransparentColor = System.Drawing.Color.Transparent;
//
// pnlLeftHeader
//
this.pnlLeftHeader.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(248)))), ((int)(((byte)(250)))));
this.pnlLeftHeader.Appearance.Options.UseBackColor = true;
this.pnlLeftHeader.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pnlLeftHeader.Controls.Add(this.lblMenuTitle);
this.pnlLeftHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlLeftHeader.Location = new System.Drawing.Point(0, 0);
this.pnlLeftHeader.Name = "pnlLeftHeader";
this.pnlLeftHeader.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.pnlLeftHeader.Size = new System.Drawing.Size(260, 38);
this.pnlLeftHeader.TabIndex = 0;
//
// lblMenuTitle
//
this.lblMenuTitle.Appearance.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Bold);
this.lblMenuTitle.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.lblMenuTitle.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.lblMenuTitle.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.lblMenuTitle.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.lblMenuTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblMenuTitle.Location = new System.Drawing.Point(10, 0);
this.lblMenuTitle.Name = "lblMenuTitle";
this.lblMenuTitle.Size = new System.Drawing.Size(250, 38);
this.lblMenuTitle.TabIndex = 3;
this.lblMenuTitle.Text = "编码分类";
//
// pnlDesignWork
//
this.pnlDesignWork.Appearance.BackColor = System.Drawing.Color.White;
this.pnlDesignWork.Appearance.Options.UseBackColor = true;
this.pnlDesignWork.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pnlDesignWork.Controls.Add(this.gridDesignRules);
this.pnlDesignWork.Controls.Add(this.pnlDesignGridHeader);
this.pnlDesignWork.Controls.Add(this.pnlBindModule);
this.pnlDesignWork.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlDesignWork.Location = new System.Drawing.Point(0, 38);
this.pnlDesignWork.Name = "pnlDesignWork";
this.pnlDesignWork.Size = new System.Drawing.Size(760, 607);
this.pnlDesignWork.TabIndex = 24;
this.pnlDesignWork.Visible = false;
//
// gridDesignRules
//
this.gridDesignRules.BackColor = System.Drawing.Color.Transparent;
this.gridDesignRules.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridDesignRules.Location = new System.Drawing.Point(0, 116);
this.gridDesignRules.Margin = new System.Windows.Forms.Padding(4);
this.gridDesignRules.Name = "gridDesignRules";
this.gridDesignRules.OperShortMode = true;
this.gridDesignRules.Size = new System.Drawing.Size(760, 491);
this.gridDesignRules.TabIndex = 2;
this.gridDesignRules.VisibleMrpSearchPanel = false;
this.gridDesignRules.VisibleOperPanel = false;
this.gridDesignRules.VisibleSearchPanel = false;
//
// pnlDesignGridHeader
//
this.pnlDesignGridHeader.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(248)))), ((int)(((byte)(250)))));
this.pnlDesignGridHeader.Appearance.Options.UseBackColor = true;
this.pnlDesignGridHeader.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pnlDesignGridHeader.Controls.Add(this.lblDesignGridTitle);
this.pnlDesignGridHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlDesignGridHeader.Location = new System.Drawing.Point(0, 86);
this.pnlDesignGridHeader.Name = "pnlDesignGridHeader";
this.pnlDesignGridHeader.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.pnlDesignGridHeader.Size = new System.Drawing.Size(760, 30);
this.pnlDesignGridHeader.TabIndex = 1;
//
// lblDesignGridTitle
//
this.lblDesignGridTitle.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold);
this.lblDesignGridTitle.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.lblDesignGridTitle.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.lblDesignGridTitle.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.lblDesignGridTitle.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.lblDesignGridTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblDesignGridTitle.Location = new System.Drawing.Point(10, 0);
this.lblDesignGridTitle.Name = "lblDesignGridTitle";
this.lblDesignGridTitle.Size = new System.Drawing.Size(750, 30);
this.lblDesignGridTitle.TabIndex = 0;
this.lblDesignGridTitle.Text = "方案明细";
//
// pnlBindModule
//
this.pnlBindModule.Appearance.BackColor = System.Drawing.Color.White;
this.pnlBindModule.Appearance.Options.UseBackColor = true;
this.pnlBindModule.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pnlBindModule.Controls.Add(this.cboBindLevel3);
this.pnlBindModule.Controls.Add(this.lblBindLevel3);
this.pnlBindModule.Controls.Add(this.cboBindLevel2);
this.pnlBindModule.Controls.Add(this.lblBindLevel2);
this.pnlBindModule.Controls.Add(this.cboBindLevel1);
this.pnlBindModule.Controls.Add(this.lblBindLevel1);
this.pnlBindModule.Controls.Add(this.chkBindModule);
this.pnlBindModule.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlBindModule.Location = new System.Drawing.Point(0, 0);
this.pnlBindModule.Name = "pnlBindModule";
this.pnlBindModule.Size = new System.Drawing.Size(760, 86);
this.pnlBindModule.TabIndex = 0;
//
// cboBindLevel3
//
this.cboBindLevel3.Location = new System.Drawing.Point(548, 45);
this.cboBindLevel3.Name = "cboBindLevel3";
this.cboBindLevel3.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.cboBindLevel3.Properties.Appearance.Options.UseFont = true;
this.cboBindLevel3.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.cboBindLevel3.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
this.cboBindLevel3.Size = new System.Drawing.Size(170, 24);
this.cboBindLevel3.TabIndex = 6;
//
// lblBindLevel3
//
this.lblBindLevel3.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.lblBindLevel3.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.lblBindLevel3.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.lblBindLevel3.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.lblBindLevel3.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.lblBindLevel3.Location = new System.Drawing.Point(482, 42);
this.lblBindLevel3.Name = "lblBindLevel3";
this.lblBindLevel3.Size = new System.Drawing.Size(66, 26);
this.lblBindLevel3.TabIndex = 5;
this.lblBindLevel3.Text = "三级菜单:";
//
// cboBindLevel2
//
this.cboBindLevel2.Location = new System.Drawing.Point(312, 45);
this.cboBindLevel2.Name = "cboBindLevel2";
this.cboBindLevel2.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.cboBindLevel2.Properties.Appearance.Options.UseFont = true;
this.cboBindLevel2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.cboBindLevel2.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
this.cboBindLevel2.Size = new System.Drawing.Size(150, 24);
this.cboBindLevel2.TabIndex = 4;
//
// lblBindLevel2
//
this.lblBindLevel2.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.lblBindLevel2.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.lblBindLevel2.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.lblBindLevel2.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.lblBindLevel2.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.lblBindLevel2.Location = new System.Drawing.Point(246, 42);
this.lblBindLevel2.Name = "lblBindLevel2";
this.lblBindLevel2.Size = new System.Drawing.Size(66, 26);
this.lblBindLevel2.TabIndex = 3;
this.lblBindLevel2.Text = "二级菜单:";
//
// cboBindLevel1
//
this.cboBindLevel1.Location = new System.Drawing.Point(76, 45);
this.cboBindLevel1.Name = "cboBindLevel1";
this.cboBindLevel1.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.cboBindLevel1.Properties.Appearance.Options.UseFont = true;
this.cboBindLevel1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.cboBindLevel1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
this.cboBindLevel1.Size = new System.Drawing.Size(150, 24);
this.cboBindLevel1.TabIndex = 2;
//
// lblBindLevel1
//
this.lblBindLevel1.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.lblBindLevel1.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.lblBindLevel1.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.lblBindLevel1.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.lblBindLevel1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.lblBindLevel1.Location = new System.Drawing.Point(10, 42);
this.lblBindLevel1.Name = "lblBindLevel1";
this.lblBindLevel1.Size = new System.Drawing.Size(66, 26);
this.lblBindLevel1.TabIndex = 1;
this.lblBindLevel1.Text = "一级菜单:";
//
// chkBindModule
//
this.chkBindModule.Location = new System.Drawing.Point(10, 12);
this.chkBindModule.Name = "chkBindModule";
this.chkBindModule.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold);
this.chkBindModule.Properties.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.chkBindModule.Properties.Appearance.Options.UseFont = true;
this.chkBindModule.Properties.Appearance.Options.UseForeColor = true;
this.chkBindModule.Properties.Caption = "绑定模块";
this.chkBindModule.Size = new System.Drawing.Size(95, 21);
this.chkBindModule.TabIndex = 0;
//
// pnlViewWork
//
this.pnlViewWork.Appearance.BackColor = System.Drawing.Color.White;
this.pnlViewWork.Appearance.Options.UseBackColor = true;
this.pnlViewWork.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlViewWork.Location = new System.Drawing.Point(0, 38);
this.pnlViewWork.Name = "pnlViewWork";
this.pnlViewWork.Padding = new System.Windows.Forms.Padding(10);
this.pnlViewWork.Size = new System.Drawing.Size(760, 607);
this.pnlViewWork.TabIndex = 1;
this.pnlViewWork.Visible = false;
//
// pl_buttom
//
this.pl_buttom.Appearance.BackColor = System.Drawing.SystemColors.Control;
this.pl_buttom.Appearance.Options.UseBackColor = true;
this.pl_buttom.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pl_buttom.Controls.Add(this.btnAddLogic);
this.pl_buttom.Controls.Add(this.btnDeleteLogic);
this.pl_buttom.Controls.Add(this.btnSave);
this.pl_buttom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pl_buttom.Location = new System.Drawing.Point(0, 645);
this.pl_buttom.Name = "pl_buttom";
this.pl_buttom.Size = new System.Drawing.Size(760, 36);
this.pl_buttom.TabIndex = 23;
//
// btnAddLogic
//
this.btnAddLogic.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnAddLogic.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAddLogic.Appearance.Options.UseFont = true;
this.btnAddLogic.Enabled = false;
this.btnAddLogic.Location = new System.Drawing.Point(558, 6);
this.btnAddLogic.Name = "btnAddLogic";
this.btnAddLogic.Size = new System.Drawing.Size(58, 26);
this.btnAddLogic.TabIndex = 35;
this.btnAddLogic.Text = "增加(&A)";
//
// btnDeleteLogic
//
this.btnDeleteLogic.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnDeleteLogic.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnDeleteLogic.Appearance.Options.UseFont = true;
this.btnDeleteLogic.Enabled = false;
this.btnDeleteLogic.Location = new System.Drawing.Point(622, 6);
this.btnDeleteLogic.Name = "btnDeleteLogic";
this.btnDeleteLogic.Size = new System.Drawing.Size(62, 26);
this.btnDeleteLogic.TabIndex = 36;
this.btnDeleteLogic.Text = "删除(&D)";
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSave.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnSave.Appearance.Options.UseFont = true;
this.btnSave.Location = new System.Drawing.Point(690, 6);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(62, 26);
this.btnSave.TabIndex = 37;
this.btnSave.Text = "保存(&S)";
//
// pnlDesignerHeader
//
this.pnlDesignerHeader.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(248)))), ((int)(((byte)(250)))));
this.pnlDesignerHeader.Appearance.Options.UseBackColor = true;
this.pnlDesignerHeader.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pnlDesignerHeader.Controls.Add(this.btnDeleteScheme);
this.pnlDesignerHeader.Controls.Add(this.btnGenerateCode);
this.pnlDesignerHeader.Controls.Add(this.txtCodePreview);
this.pnlDesignerHeader.Controls.Add(this.lblCodePreview);
this.pnlDesignerHeader.Controls.Add(this.txtSchemeName);
this.pnlDesignerHeader.Controls.Add(this.label1);
this.pnlDesignerHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlDesignerHeader.Location = new System.Drawing.Point(0, 0);
this.pnlDesignerHeader.Name = "pnlDesignerHeader";
this.pnlDesignerHeader.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.pnlDesignerHeader.Size = new System.Drawing.Size(760, 38);
this.pnlDesignerHeader.TabIndex = 0;
//
// btnDeleteScheme
//
this.btnDeleteScheme.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.btnDeleteScheme.Appearance.Options.UseFont = true;
this.btnDeleteScheme.Enabled = false;
this.btnDeleteScheme.Location = new System.Drawing.Point(280, 6);
this.btnDeleteScheme.Name = "btnDeleteScheme";
this.btnDeleteScheme.Size = new System.Drawing.Size(72, 26);
this.btnDeleteScheme.TabIndex = 5;
this.btnDeleteScheme.Text = "删除方案";
//
// btnGenerateCode
//
this.btnGenerateCode.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.btnGenerateCode.Appearance.Options.UseFont = true;
this.btnGenerateCode.Enabled = false;
this.btnGenerateCode.Location = new System.Drawing.Point(620, 6);
this.btnGenerateCode.Name = "btnGenerateCode";
this.btnGenerateCode.Size = new System.Drawing.Size(72, 24);
this.btnGenerateCode.TabIndex = 8;
this.btnGenerateCode.Text = "生成编码";
this.btnGenerateCode.Visible = false;
//
// txtCodePreview
//
this.txtCodePreview.Location = new System.Drawing.Point(372, 6);
this.txtCodePreview.Margin = new System.Windows.Forms.Padding(0);
this.txtCodePreview.Name = "txtCodePreview";
this.txtCodePreview.Properties.Appearance.BackColor = System.Drawing.Color.White;
this.txtCodePreview.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.txtCodePreview.Properties.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(42)))), ((int)(((byte)(54)))), ((int)(((byte)(66)))));
this.txtCodePreview.Properties.Appearance.Options.UseBackColor = true;
this.txtCodePreview.Properties.Appearance.Options.UseFont = true;
this.txtCodePreview.Properties.Appearance.Options.UseForeColor = true;
this.txtCodePreview.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
this.txtCodePreview.Properties.ReadOnly = true;
this.txtCodePreview.Size = new System.Drawing.Size(240, 24);
this.txtCodePreview.TabIndex = 7;
this.txtCodePreview.Visible = false;
//
// lblCodePreview
//
this.lblCodePreview.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(248)))), ((int)(((byte)(250)))));
this.lblCodePreview.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold);
this.lblCodePreview.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.lblCodePreview.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.lblCodePreview.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.lblCodePreview.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.lblCodePreview.Location = new System.Drawing.Point(292, 0);
this.lblCodePreview.Name = "lblCodePreview";
this.lblCodePreview.Size = new System.Drawing.Size(78, 38);
this.lblCodePreview.TabIndex = 6;
this.lblCodePreview.Text = "编码预览:";
this.lblCodePreview.Visible = false;
//
// txtSchemeName
//
this.txtSchemeName.Enabled = false;
this.txtSchemeName.Location = new System.Drawing.Point(85, 6);
this.txtSchemeName.Margin = new System.Windows.Forms.Padding(0);
this.txtSchemeName.Name = "txtSchemeName";
this.txtSchemeName.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.txtSchemeName.Properties.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(42)))), ((int)(((byte)(54)))), ((int)(((byte)(66)))));
this.txtSchemeName.Properties.Appearance.Options.UseFont = true;
this.txtSchemeName.Properties.Appearance.Options.UseForeColor = true;
this.txtSchemeName.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
this.txtSchemeName.Size = new System.Drawing.Size(188, 24);
this.txtSchemeName.TabIndex = 4;
//
// label1
//
this.label1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(248)))), ((int)(((byte)(250)))));
this.label1.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold);
this.label1.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(73)))), ((int)(((byte)(98)))));
this.label1.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.label1.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.label1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.label1.Dock = System.Windows.Forms.DockStyle.Left;
this.label1.Location = new System.Drawing.Point(10, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 38);
this.label1.TabIndex = 3;
this.label1.Text = "方案名称:";
//
// cmsMenuTree
//
this.cmsMenuTree.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAddScheme});
this.cmsMenuTree.Name = "cmsMenuTree";
this.cmsMenuTree.Size = new System.Drawing.Size(125, 26);
//
// menuAddScheme
//
this.menuAddScheme.Name = "menuAddScheme";
this.menuAddScheme.Size = new System.Drawing.Size(124, 22);
this.menuAddScheme.Text = "添加方案";
//
// lblDesignerStatus
//
this.lblDesignerStatus.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(248)))), ((int)(((byte)(250)))));
this.lblDesignerStatus.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F);
this.lblDesignerStatus.Appearance.ForeColor = System.Drawing.Color.DimGray;
this.lblDesignerStatus.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.lblDesignerStatus.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.lblDesignerStatus.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.lblDesignerStatus.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lblDesignerStatus.Location = new System.Drawing.Point(0, 655);
this.lblDesignerStatus.Name = "lblDesignerStatus";
this.lblDesignerStatus.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.lblDesignerStatus.Size = new System.Drawing.Size(560, 26);
this.lblDesignerStatus.TabIndex = 2;
this.lblDesignerStatus.Text = "请选择左侧末级菜单并添加方案";
this.lblDesignerStatus.Visible = false;
//
// FrmMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(1297, 681);
this.Controls.Add(this.splitRoot);
this.Name = "FrmMain";
this.Text = "编码生成设计";
((System.ComponentModel.ISupportInitialize)(this.splitRoot)).EndInit();
this.splitRoot.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pnlTreeHost)).EndInit();
this.pnlTreeHost.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.treeMenu)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pnlLeftHeader)).EndInit();
this.pnlLeftHeader.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pnlDesignWork)).EndInit();
this.pnlDesignWork.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pnlDesignGridHeader)).EndInit();
this.pnlDesignGridHeader.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pnlBindModule)).EndInit();
this.pnlBindModule.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.cboBindLevel3.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cboBindLevel2.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cboBindLevel1.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.chkBindModule.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pl_buttom)).EndInit();
this.pl_buttom.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pnlDesignerHeader)).EndInit();
this.pnlDesignerHeader.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.txtCodePreview.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txtSchemeName.Properties)).EndInit();
this.cmsMenuTree.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.SplitContainerControl splitRoot;
private DevExpress.XtraEditors.PanelControl pnlLeftHeader;
private DevExpress.XtraEditors.PanelControl pnlTreeHost;
private System.Windows.Forms.ImageList imgMenuTree;
private System.Windows.Forms.ContextMenuStrip cmsMenuTree;
private System.Windows.Forms.ToolStripMenuItem menuAddScheme;
private DevExpress.XtraEditors.PanelControl pnlDesignerHeader;
private DevExpress.XtraEditors.LabelControl lblDesignerStatus;
private DevExpress.XtraEditors.PanelControl pl_buttom;
private DevExpress.XtraEditors.SimpleButton btnSave;
private DevExpress.XtraEditors.SimpleButton btnDeleteScheme;
private DevExpress.XtraEditors.SimpleButton btnGenerateCode;
private DevExpress.XtraEditors.TextEdit txtCodePreview;
private DevExpress.XtraEditors.LabelControl lblCodePreview;
private DevExpress.XtraTreeList.TreeList treeMenu;
private DevExpress.XtraTreeList.Columns.TreeListColumn treeColumnMenu;
private DevExpress.XtraEditors.TextEdit txtSchemeName;
private DevExpress.XtraEditors.LabelControl label1;
private DevExpress.XtraEditors.LabelControl lblMenuTitle;
private DevExpress.XtraEditors.XtraScrollableControl pnlViewWork;
private DevExpress.XtraEditors.PanelControl pnlDesignWork;
private Lskj.PubCodeDesign.CodeDesignModuleGridEx gridDesignRules;
private DevExpress.XtraEditors.PanelControl pnlDesignGridHeader;
private DevExpress.XtraEditors.LabelControl lblDesignGridTitle;
private DevExpress.XtraEditors.PanelControl pnlBindModule;
private DevExpress.XtraEditors.ComboBoxEdit cboBindLevel3;
private DevExpress.XtraEditors.LabelControl lblBindLevel3;
private DevExpress.XtraEditors.ComboBoxEdit cboBindLevel2;
private DevExpress.XtraEditors.LabelControl lblBindLevel2;
private DevExpress.XtraEditors.ComboBoxEdit cboBindLevel1;
private DevExpress.XtraEditors.LabelControl lblBindLevel1;
private DevExpress.XtraEditors.CheckEdit chkBindModule;
private DevExpress.XtraEditors.SimpleButton btnAddLogic;
private DevExpress.XtraEditors.SimpleButton btnDeleteLogic;
}
}
File diff suppressed because it is too large Load Diff
+126
View File
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="imgMenuTree.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="cmsMenuTree.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>151, 17</value>
</metadata>
</root>
@@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{552308D8-450C-4ECA-9A3E-543AF0F8E150}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lskj.PubCodeDesign</RootNamespace>
<AssemblyName>Lskj.PubCodeDesign</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Debug\Lib\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\Debug\AllMethodXml\Lskj.PubCodeDesign.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="DevExpress.XtraTreeList.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CodeDesignModuleGridEx.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="DllBaseClass.cs" />
<Compile Include="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CodeSchemeModels.cs" />
<Compile Include="CodeSchemeStorage.cs" />
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lskj.Business\Lskj.Business.csproj">
<Project>{7eafccc2-a18f-49e9-85c6-a984966cfd01}</Project>
<Name>Lskj.Business</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Control\Lskj.Control.csproj">
<Project>{447cdc40-659f-4cca-9ed6-8e818b4cf8bf}</Project>
<Name>Lskj.Control</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Core\Lskj.Core.csproj">
<Project>{2a1be6ac-1077-491b-a754-c5822fe8121e}</Project>
<Name>Lskj.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Main\Lskj.Main.csproj">
<Project>{BCA1E2B3-C4AB-4D2C-B519-3DCFDB5B83D6}</Project>
<Name>Lskj.Main</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Model\Lskj.Model.csproj">
<Project>{52bc40e0-c0c6-4f78-996b-cae028d209ca}</Project>
<Name>Lskj.Model</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Util\Lskj.Util.csproj">
<Project>{a51bf642-6543-4de3-8948-83f558b72bd4}</Project>
<Name>Lskj.Util</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Lskj.PubCodeDesign")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lskj.PubCodeDesign")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("552308d8-450c-4eca-9a3e-543af0f8e150")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,70 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Lskj.PubCodeDesign.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lskj.PubCodeDesign.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Lskj.PubCodeDesign.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
@@ -0,0 +1,4 @@
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraTreeList.TreeList, DevExpress.XtraTreeList.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
@@ -106,6 +106,7 @@ namespace Lskj.PubMrpAnalyze
/// 是否已经执行行改变事件并刷新明细数据
/// </summary>
private bool isFocusedRowChanged = true;
private HashSet<GridView> mrpDragCopyViews = new HashSet<GridView>();
#endregion
public MrpAnalyzeMain()
{
@@ -659,6 +660,8 @@ namespace Lskj.PubMrpAnalyze
this.gd_LeftBottom.SetGridViewDataSource(detailTable);
}
this.SetDetailGridDataSource();
this.EnsureRightGridFocusedCellCopy(gridControlEx);
this.RestoreRightGridCellSelection(gridControlEx);
}
catch (Exception ex)
{
@@ -666,6 +669,83 @@ namespace Lskj.PubMrpAnalyze
MessageUtil.Show(Message, ex.Message);
}
}
private void EnsureRightGridFocusedCellCopy(GridControlEx gridControlEx)
{
try
{
if (gridControlEx == null || gridControlEx.GridView == null) return;
GridView view = gridControlEx.GridView;
if (mrpDragCopyViews.Contains(view)) return;
view.KeyDown += OnRightGridViewKeyDown;
mrpDragCopyViews.Add(view);
}
catch
{
}
}
private void OnRightGridViewKeyDown(object sender, KeyEventArgs e)
{
try
{
if (!e.Control || e.KeyCode != Keys.C) return;
GridView view = sender as GridView;
if (view == null || view.OptionsSelection.MultiSelectMode != GridMultiSelectMode.CellSelect) return;
var cells = view.GetSelectedCells();
if (cells.Length != 0 || view.GetSelectedRows().Length == 0) return;
if (view.FocusedRowHandle < 0 || view.FocusedColumn == null) return;
object obj = view.GetFocusedRowCellDisplayText(view.FocusedColumn);
Clipboard.SetDataObject(obj == null ? string.Empty : obj + "");
e.Handled = true;
}
catch
{
}
}
private void RestoreRightGridCellSelection(GridControlEx gridControlEx)
{
try
{
if (gridControlEx == null || gridControlEx.GridView == null || gridControlEx.IsDisposed || !gridControlEx.IsHandleCreated) return;
gridControlEx.BeginInvoke(new Action(() =>
{
try
{
if (gridControlEx.IsDisposed || gridControlEx.GridView == null) return;
GridView view = gridControlEx.GridView;
if (view.RowCount <= 0) return;
int rowHandle = view.FocusedRowHandle >= 0 ? view.FocusedRowHandle : 0;
GridColumn column = view.FocusedColumn ?? view.VisibleColumns.FirstOrDefault();
if (column == null) return;
view.ClearSelection();
view.FocusedRowHandle = rowHandle;
view.FocusedColumn = column;
view.SelectCell(rowHandle, column);
}
catch
{
}
}));
}
catch
{
}
}
/// <summary>
/// <para>说明:数据行发生改变加载明细</para>
/// <para>创建人:王一帆</para>
+2
View File
@@ -109,6 +109,7 @@
this.gridLeft.Name = "gridLeft";
this.gridLeft.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
this.gridLeft.Size = new System.Drawing.Size(250, 702);
this.gridLeft.SysModel = null;
this.gridLeft.TabIndex = 7;
//
// splitRightContainer
@@ -265,6 +266,7 @@
this.gcMain.Name = "gcMain";
this.gcMain.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
this.gcMain.Size = new System.Drawing.Size(1192, 215);
this.gcMain.SysModel = null;
this.gcMain.TabIndex = 0;
//
// plm_top_cond
+102 -28
View File
@@ -76,6 +76,18 @@ namespace Lskj.PubProductSysMge
/// </summary>
private List<SysSetModel> ControlList = new List<SysSetModel>();
/// <summary>
/// 左侧树节点正在加载,防止连续点击重复进入加载流程。
/// </summary>
private bool _isTreeNodeLoading = false;
/// <summary>
/// 左侧树当前正在加载的节点,用于加载期间恢复选中状态。
/// </summary>
private TreeNode _loadingTreeNode = null;
/// <summary>
/// 程序内部切换方案下拉框时,屏蔽 SelectedIndexChanged 的嵌套加载。
/// </summary>
private bool _suppressProjectSelectedIndexChanged = false;
/// <summary>
/// 规格控件
/// </summary>
private BaseUserControl _SpecBaseControl;
@@ -553,8 +565,9 @@ namespace Lskj.PubProductSysMge
this.ControlList.Clear();
try
{
if (projectComBoEdit.SelectedItem == "" || treeNode == null) return;
string projectId = (projectComBoEdit.SelectedItem as ComboBoxModel).Value;
ComboBoxModel selectedProject = projectComBoEdit.SelectedItem as ComboBoxModel;
if (selectedProject == null || treeNode == null) return;
string projectId = selectedProject.Value;
if (treeNode != null && !string.IsNullOrEmpty(projectId))
{
DataTable dataTable = new DataTable();
@@ -1004,6 +1017,11 @@ namespace Lskj.PubProductSysMge
/// <param name="e"></param>
private void OnProjectSelectedIndexChanged(object sender, EventArgs e)
{
if (_suppressProjectSelectedIndexChanged || _isTreeNodeLoading)
{
return;
}
WaitForm.ShowForm();
try
{
@@ -1027,24 +1045,38 @@ namespace Lskj.PubProductSysMge
/// <param name="e"></param>
private void OnTreeLeftTreeNodeSelected(object sender, TreeNodeMouseClickEventArgs e)
{
WaitForm.ShowForm();
if (e.Node == null)
if (_isTreeNodeLoading)
{
MessageUtil.Show("请选择节点");
if (_loadingTreeNode != null && this.treeLeftViewEx.TreeView.SelectedNode != _loadingTreeNode)
{
this.treeLeftViewEx.TreeView.SelectedNode = _loadingTreeNode;
}
return;
}
this.treeLeftViewEx.TreeView.SelectedNode = e.Node;
string nodeName = this.treeLeftViewEx.TreeView.SelectedNode != null ? this.treeLeftViewEx.TreeView.SelectedNode.Name : "";
this.speciesNoEdit.Text = "";
this.speciesNameEdit.Text = "";
//this.projectComBoEdit.Text = "";
//this.projectComBoEdit.Tag = "";
this.btnUpdate.Enabled = false;
this.btnSave.Enabled = true;
this.MainControlObj.ResetControlValue();
this.pl_Top.Controls.Clear();
this.ControlList.Clear();
_isTreeNodeLoading = true;
_loadingTreeNode = e.Node;
try
{
WaitForm.ShowForm();
if (e.Node == null)
{
MessageUtil.Show("请选择节点");
return;
}
this.treeLeftViewEx.TreeView.SelectedNode = e.Node;
string nodeName = this.treeLeftViewEx.TreeView.SelectedNode != null ? this.treeLeftViewEx.TreeView.SelectedNode.Name : "";
this.speciesNoEdit.Text = "";
this.speciesNameEdit.Text = "";
//this.projectComBoEdit.Text = "";
//this.projectComBoEdit.Tag = "";
this.btnUpdate.Enabled = false;
this.btnSave.Enabled = true;
this.MainControlObj.ResetControlValue();
//this.pl_Top.Controls.Clear();
this.DisposeTopControls();
this.ControlList.Clear();
//string projectId = MainImpl.GetResult(string.Format("select BmFaID from P_ProductSpeciesTab where speciesno = '{0}'", e.Node.Name)) + "";
//string projectName = MainImpl.GetResult(string.Format("select ItemName from p_productsyssetGrouptab where id = '{0}'", projectId)) + "";
string sql = "select id,ItemName from p_productsyssetGrouptab where speciesno = '{0}'";
@@ -1055,23 +1087,40 @@ namespace Lskj.PubProductSysMge
this.speciesNameEdit.Text = e.Node.Text;
//this.projectComBoEdit.Text = projectName;
//this.projectComBoEdit.Tag = projectId;
this.projectComBoEdit.Text = "";
this.projectComBoEdit.Properties.Items.Clear();
if (e.Node.Nodes.Count == 0)
bool hasProjectItem = false;
_suppressProjectSelectedIndexChanged = true;
try
{
foreach (DataRow item in dataTable.Rows)
this.projectComBoEdit.Text = "";
this.projectComBoEdit.Properties.Items.Clear();
if (e.Node.Nodes.Count == 0)
{
ComboBoxModel comboBoxModel = new ComboBoxModel(item)
foreach (DataRow item in dataTable.Rows)
{
ValueMember = dataTable.Columns[0].ColumnName,
DisplayMember = dataTable.Columns[1].ColumnName,
};
this.projectComBoEdit.Properties.Items.Add(comboBoxModel);
ComboBoxModel comboBoxModel = new ComboBoxModel(item)
{
ValueMember = dataTable.Columns[0].ColumnName,
DisplayMember = dataTable.Columns[1].ColumnName,
};
this.projectComBoEdit.Properties.Items.Add(comboBoxModel);
}
if (this.projectComBoEdit.Properties.Items.Count > 0)
{
this.projectComBoEdit.SelectedIndex = 0;
hasProjectItem = true;
}
}
this.projectComBoEdit.SelectedIndex = 0;
}
//SetDynamicControl(e.Node);
finally
{
_suppressProjectSelectedIndexChanged = false;
}
if (hasProjectItem)
{
SetDynamicControl(e.Node);
}
string where = null;
if (string.IsNullOrWhiteSpace(this.ParentUnionField))
{
@@ -1099,9 +1148,34 @@ namespace Lskj.PubProductSysMge
}
finally
{
_loadingTreeNode = null;
_isTreeNodeLoading = false;
WaitForm.HideForm();
}
}
/// <summary>
/// 清空并释放顶部动态控件,避免 Controls.Clear 只移除不释放导致资源累积。
/// </summary>
private void DisposeTopControls()
{
if (this.pl_Top == null || this.pl_Top.IsDisposed)
{
return;
}
for (int i = this.pl_Top.Controls.Count - 1; i >= 0; i--)
{
System.Windows.Forms.Control control = this.pl_Top.Controls[i];
this.pl_Top.Controls.RemoveAt(i);
control.Dispose();
}
}
/// <summary>
/// 控件面板点击时切换焦点,实现隐藏弹出框
/// </summary>
+5
View File
@@ -52,6 +52,11 @@ namespace Lskj.Util
{
DllFileName = "Lskj.PubBrowerXp.dll";
}
if (DllFileName.Equals("Lskj.PubCodeDesign1.dll"))
{
DllFileName = "Lskj.PubCodeDesign.dll";
args = args.Concat(new string[] { "", "1" }).ToArray();
}
//DllFileName = "Lskj.PubTabDll.dll";
string libPath = DllFileName.Trim().ToLower().Equals("lskj.pubbrowser.dll") ? PubUtil.AbsolutelyBrowserPath + DllFileName : PubUtil.AbsolutelyLibPath + DllFileName;
Assembly _Assembly = Assembly.UnsafeLoadFrom(libPath);
+5 -11
View File
@@ -36,10 +36,9 @@ namespace Lskj.Util
{
if (bytes == null) return null;
using (System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes))
using (System.Drawing.Image sourceImage = System.Drawing.Image.FromStream(ms))
{
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
ms.Flush();
return returnImage;
return new Bitmap(sourceImage);
}
}
catch (Exception)
@@ -56,14 +55,9 @@ namespace Lskj.Util
{
try
{
FileStream fs = File.OpenRead(path); //OpenRead
int filelength = 0;
filelength = (int)fs.Length; //获得文件长度
Byte[] image = new Byte[filelength]; //建立一个字节数组
fs.Read(image, 0, filelength); //按字节流读取
System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
fs.Close();
return result;
if (string.IsNullOrWhiteSpace(path) || !File.Exists(path)) return null;
byte[] image = File.ReadAllBytes(path);
return ReadImage(image);
}
catch (Exception)
{
+15
View File
@@ -203,6 +203,21 @@ namespace Lskj.Util
{
get { return BitMapPath + "Main/Module/"; }
}
/// <summary>
/// 主界面左侧树图标路径
/// </summary>
public static string MainTreeviewImagePath
{
get
{
string path = BitMapPath + "Main\\MainTreeview\\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
public static string MesItemImage
{
get { return BitMapPath + "MesItem/"; }