SVN r823
SVN-Revision: r823
This commit is contained in:
@@ -1422,8 +1422,8 @@ namespace Lskj.Control
|
||||
if (this.ControlObj != null)
|
||||
sqlValue = this.ControlObj.ReplaceControlValue(sqlValue);
|
||||
sqlValue = ProcessingSql(sqlValue);
|
||||
sqlValue = MainImpl.GetDefaultValue(SourceSQL);
|
||||
sqlValue = ReplaceHelper.ReplaceParam(SourceSQL);
|
||||
sqlValue = MainImpl.GetDefaultValue(sqlValue);
|
||||
sqlValue = ReplaceHelper.ReplaceParam(sqlValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3565,7 +3565,8 @@ namespace Lskj.Control
|
||||
comboxEdit.DisplayMember = model.TextMember;
|
||||
comboxEdit.ValueMember = ControlType.LabComboxText == model.FieldType || ControlType.LabComboxTextParam == model.FieldType ? model.TextMember : model.ValueMember;
|
||||
//comboxEdit.DataSource = MainImpl.GetDataTableResult(model.SqlSource);
|
||||
|
||||
comboxEdit.Tag = model;
|
||||
comboxEdit.QueryPopUp += ComboxEdit_QueryPopUp;
|
||||
|
||||
LookUpColumnInfo valueColumn = new LookUpColumnInfo();
|
||||
valueColumn.Caption = "编码";
|
||||
@@ -3593,6 +3594,10 @@ namespace Lskj.Control
|
||||
|
||||
this.mControlList.Add(model);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:创建树节点自动搜索框</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
@@ -5354,7 +5359,7 @@ namespace Lskj.Control
|
||||
GridColumn col = gridView.VisibleColumns[_colNumber];
|
||||
|
||||
GridColumnModel model = col.Tag as GridColumnModel;
|
||||
if (model != null && (model.CanCopy || ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit))))
|
||||
if (model != null && !model.ProhibitPaste && (model.CanCopy || ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit))))
|
||||
{
|
||||
// 返回ID类型特殊处理
|
||||
string cellValue = _arrayStr2[j];
|
||||
@@ -5568,7 +5573,7 @@ namespace Lskj.Control
|
||||
GridColumn col = gridView.VisibleColumns[_colNumber];
|
||||
GridColumnModel model = col.Tag as GridColumnModel;
|
||||
|
||||
if (model != null && (model.CanCopy || ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit)))) //if ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit))
|
||||
if (model != null&& !model.ProhibitPaste && (model.CanCopy || ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit)))) //if ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit))
|
||||
{
|
||||
// 返回ID类型特殊处理
|
||||
string cellValue = _arrayStr2[j];
|
||||
@@ -6289,7 +6294,7 @@ namespace Lskj.Control
|
||||
DataRow rowItem = dataRows.Count() > 0 ? dataRows[0] : this.gridView.GetFocusedDataRow();
|
||||
if (model.FieldType == ControlType.LabAutoGridValueParam || model.FieldType == ControlType.LabAutoGridTextParam || model.FieldType == ControlType.LabAutoCompleteTextParam || model.FieldType == ControlType.LabAutoCompleteValueParam)
|
||||
{
|
||||
if (model != null && rowItem != null)
|
||||
if (model != null && (rowItem != null|| this.ParentControl != null))
|
||||
{
|
||||
string sqlValue = model.SqlSource;
|
||||
|
||||
@@ -6297,9 +6302,16 @@ namespace Lskj.Control
|
||||
sqlValue = this.ParentControl.ReplaceParentControlValue(sqlValue);
|
||||
sqlValue = sqlValue.Replace("#", "");
|
||||
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
if (rowItem != null)
|
||||
{
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
}
|
||||
|
||||
DataTable table = MainImpl.GetDataTableResult(sqlValue);
|
||||
edit.Properties.DataSource = table;
|
||||
|
||||
|
||||
|
||||
string[] columnsWidth = model != null ? model.LookUpFieldsWidth.Trim().TrimEnd(',').Split(',') : null;
|
||||
if (model != null && !string.IsNullOrWhiteSpace(model.LookUpFieldsWidth) && columnsWidth.Length > 0)
|
||||
{
|
||||
@@ -6448,6 +6460,53 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下拉列表框(带参数)。打开时更新下拉框数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void ComboxEdit_QueryPopUp(object sender, CancelEventArgs e)
|
||||
{
|
||||
if (sender is LookUpEdit)
|
||||
{
|
||||
try
|
||||
{
|
||||
int popWidth = 0;
|
||||
LookUpEdit edit = (sender as LookUpEdit);
|
||||
GridColumnModel model = edit.Properties.Tag as GridColumnModel;
|
||||
CurrentOperColumnKey = Model.ModuleCode + "_" + model.FieldName;
|
||||
CurrentOperModel = model;
|
||||
DataRow[] dataRows = this.GetViewFocusedDataRows();
|
||||
DataRow rowItem = dataRows.Count() > 0 ? dataRows[0] : this.gridView.GetFocusedDataRow();
|
||||
if (model.FieldType == ControlType.LabComboxValueParam || model.FieldType == ControlType.LabComboxTextParam)
|
||||
{
|
||||
if (model != null && (rowItem != null || this.ParentControl != null))
|
||||
{
|
||||
string sqlValue = model.SqlSource;
|
||||
|
||||
if (this.ParentControl != null)
|
||||
sqlValue = this.ParentControl.ReplaceParentControlValue(sqlValue);
|
||||
sqlValue = sqlValue.Replace("#", "");
|
||||
if (rowItem != null)
|
||||
{
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
}
|
||||
DataTable table = MainImpl.GetDataTableResult(sqlValue);
|
||||
edit.Properties.DataSource = table;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex, Model.ModuleCode);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:打开多选控件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
|
||||
@@ -363,6 +363,10 @@ namespace Lskj.Control.Model
|
||||
/// 附加关联(附件模块关联主表树型)
|
||||
/// </summary>
|
||||
public bool AdditionalAssociations;
|
||||
/// <summary>
|
||||
/// 禁止粘贴
|
||||
/// </summary>
|
||||
public bool ProhibitPaste;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -452,4 +456,5 @@ namespace Lskj.Control.Model
|
||||
int.TryParse(item["LabPicUrlHeight"] + "", out LabPicUrlHeight);
|
||||
}
|
||||
this.IsCustomGroupPrimary = item.Table.Columns.Contains("IsCustomGroupPrimary") ? "1".Equals(item["IsCustomGroupPrimary"] + "") : false;
|
||||
this.IsCustomGroupField = item.Table.Columns.Contains("IsCustomGroupField")&&int.TryParse(item["IsCustomGroupField"] + "",out IsCustomGroupField) ? IsCustomGroupField : 0;
|
||||
this.IsCustomGroupField = item.Table.Columns.Contains("IsCustomGroupField")&&int.TryParse(item["IsCustomGroupField"] + "",out IsCustomGroupField) ? IsCustomGroupField : 0;
|
||||
this.ImportConversionFormat = item.Table.Columns.Contains("ImportConversionFormat") ? item["ImportConversionFormat
|
||||
@@ -1047,6 +1047,14 @@ namespace Lskj.Control
|
||||
try
|
||||
{
|
||||
this._leftGridSearchObj.SearchGrid();
|
||||
|
||||
if (this.SysModel.DefaultClickLeft)
|
||||
{
|
||||
this.OnGridViewRowClick(null, null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -357,6 +357,10 @@ namespace Lskj.Control
|
||||
{
|
||||
(this.ModuleGridObj.GridControlObj as TreeGridControlEx).TreeListObj.FocusedNodeChanged += OnFocusedNodeChanged;
|
||||
}
|
||||
if (this.ModuleGridObj.GridControlObj is TreeBandedGridControlEx)
|
||||
{
|
||||
(this.ModuleGridObj.GridControlObj as TreeBandedGridControlEx).TreeListObj.FocusedNodeChanged += OnFocusedNodeChanged;
|
||||
}
|
||||
if (this.SysModel.DoubleClickDetail)
|
||||
{
|
||||
//双击刷新的话,和行改变事件冲突。
|
||||
@@ -390,6 +394,10 @@ namespace Lskj.Control
|
||||
{
|
||||
(this.ModuleGridObj.GridControlObj as TreeGridControlEx).TreeListObj.FocusedNodeChanged += OnFocusedNodeChanged;
|
||||
}
|
||||
if (this.ModuleGridObj.GridControlObj is TreeBandedGridControlEx)
|
||||
{
|
||||
(this.ModuleGridObj.GridControlObj as TreeBandedGridControlEx).TreeListObj.FocusedNodeChanged += OnFocusedNodeChanged;
|
||||
}
|
||||
if (SystemInfo.Instance.ReportMainTabClickRefresh)
|
||||
{
|
||||
if (this.SysModel.DoubleClickDetail)
|
||||
@@ -614,11 +622,11 @@ namespace Lskj.Control
|
||||
GridDetailModel model = this.tcButtom.GetGridDetailModel(tabPage);
|
||||
if (isNull)
|
||||
{
|
||||
DataRow leftrow = _leftGridSearchObj!=null?_leftGridSearchObj.MainGridEx.GetViewFocusedDataRow():null;
|
||||
if (model.IsUnionleft&& leftrow!=null)//为空状态下若明细关联左侧则去替换数据源
|
||||
DataRow leftrow = _leftGridSearchObj != null ? _leftGridSearchObj.MainGridEx.GetViewFocusedDataRow() : null;
|
||||
if (model != null && model.IsUnionleft && leftrow != null)//为空状态下若明细关联左侧则去替换数据源
|
||||
{
|
||||
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
||||
|
||||
|
||||
if (ReplaceHelper.IsSelect(sqlValue) && !string.IsNullOrEmpty(model.UnionValue))
|
||||
{
|
||||
string Conditions = string.Empty;
|
||||
@@ -866,7 +874,7 @@ namespace Lskj.Control
|
||||
{
|
||||
string fieldName = !string.IsNullOrEmpty(model.UnionParentField) && rowItem.Table.Columns.Contains(model.UnionParentField) ? model.UnionParentField : ModuleGridObj.ParmaryKey;
|
||||
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
||||
if (model.IsUnionleft&& _leftGridSearchObj!=null)
|
||||
if (model.IsUnionleft && _leftGridSearchObj != null)
|
||||
{
|
||||
DataRow leftrow = _leftGridSearchObj.MainGridEx.GetViewFocusedDataRow();
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(leftrow, sqlValue);
|
||||
@@ -1087,10 +1095,6 @@ namespace Lskj.Control
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -192,6 +192,10 @@ namespace Lskj.Control
|
||||
/// 拖拽模式
|
||||
/// </summary>
|
||||
public bool isDrag = false;
|
||||
/// <summary>
|
||||
/// 是否保存成功(Lskj.PubBillSpecial点击保存后,先执行右上方表格保存)
|
||||
/// </summary>
|
||||
public bool isSuccessfullySaved;
|
||||
#endregion
|
||||
|
||||
#region public set property
|
||||
@@ -214,6 +218,11 @@ namespace Lskj.Control
|
||||
get { return this.TipsPanel; }
|
||||
}
|
||||
|
||||
public SimpleButton BtnSave
|
||||
{
|
||||
get { return this.btnSave; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 搜索界面
|
||||
/// </summary>
|
||||
@@ -519,8 +528,8 @@ namespace Lskj.Control
|
||||
this.SearchObj.InitDefaultSearchControl(table, this.pl_top_fix_search, false);
|
||||
else
|
||||
this.SearchObj.InitDefaultSearchControl(table, this.pl_top_fix_search);
|
||||
//固定条件不显示的话,隐藏上方。(只显示表格)
|
||||
if (!this.pl_top_fix_search.Visible)
|
||||
//固定条件不显示,隐藏上方。(只显示表格)
|
||||
if (SystemInfo.Instance.HideFixedConditions)
|
||||
{
|
||||
this.pl_top.Visible = false;
|
||||
}
|
||||
@@ -2568,6 +2577,7 @@ namespace Lskj.Control
|
||||
public void SaveGridRecord(bool isErrorTips = true)
|
||||
{
|
||||
this.SaveResults = false;
|
||||
this.isSuccessfullySaved = false;
|
||||
string tableName = this.SysModel.MenuTable;
|
||||
string Autogrowcolumn = BaseImpl.GetResult(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", tableName)) + "";
|
||||
DataTable DatabasePropertySheet = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", tableName));//数据库属性表
|
||||
@@ -2769,6 +2779,7 @@ namespace Lskj.Control
|
||||
else
|
||||
{
|
||||
this.SaveResults = true;
|
||||
this.isSuccessfullySaved = true;
|
||||
(gcMain.GridControl.DataSource as DataTable).AcceptChanges();
|
||||
if (this.SearchObj != null)
|
||||
{
|
||||
@@ -4351,6 +4362,7 @@ namespace Lskj.Control
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
protected void OnSaveClick(object sender, EventArgs e)
|
||||
{
|
||||
this.isSuccessfullySaved = false;
|
||||
if (this.GridControlObj.CustomGroupBandEx != null)//保存前若存在虚拟多表头则反写修改
|
||||
{
|
||||
this.GridControlObj.callbackUpdData();
|
||||
@@ -4386,6 +4398,7 @@ namespace Lskj.Control
|
||||
int result = this.GridControlObj.AdapterObj.Update(treeList.TreeListObj.DataSource as DataTable);
|
||||
if (result > 0)
|
||||
{
|
||||
this.isSuccessfullySaved = true;
|
||||
isExec = false;
|
||||
MessageUtil.Show(ResourceKeys.SaveSuccess);
|
||||
if (OnSaveGridCallBack != null)
|
||||
@@ -4443,6 +4456,7 @@ namespace Lskj.Control
|
||||
int result = this.GridControlObj.AdapterObj.Update(this.gcMain.GridControl.DataSource as DataTable);
|
||||
if (result > 0)
|
||||
{
|
||||
this.isSuccessfullySaved = true;
|
||||
isExec = false;
|
||||
MessageUtil.Show(ResourceKeys.SaveSuccess);
|
||||
if (this.SearchObj != null)
|
||||
@@ -5561,4 +5575,31 @@ namespace Lskj.Control
|
||||
|
||||
// 获取字体和最大宽度
|
||||
Document document = richEdit.Document;
|
||||
|
||||
Font font = richEdit.Font;
|
||||
int maxWidth = richEdit.ClientSize.Width - richEdit.Padding.Horizontal;
|
||||
|
||||
// 获取前3行文本
|
||||
string[] lines = richEdit.Text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
int lineCount = Math.Min(4, lines.Length);
|
||||
string firstThreeLines = string.Join(Environment.NewLine, lines.Take(lineCount));
|
||||
|
||||
// 创建StringFormat
|
||||
StringFormat format = new StringFormat(StringFormat.GenericTypographic);
|
||||
format.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces;
|
||||
|
||||
// 测量文本高度
|
||||
using (Graphics g = richEdit.CreateGraphics())
|
||||
{
|
||||
SizeF textSize = g.MeasureString(
|
||||
firstThreeLines,
|
||||
font,
|
||||
maxWidth,
|
||||
format
|
||||
);
|
||||
return (int)Math.Ceiling(textSize.Height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -954,7 +954,7 @@ namespace Lskj.Control
|
||||
gridEx.Tag = detailModel;
|
||||
gridEx.Parent = plMain;
|
||||
gridEx.Model = this.Model;
|
||||
gcMain.SysModel = this.SysModel;
|
||||
gridEx.SysModel = this.SysModel;
|
||||
gridEx.SetReadOnlyColumns(detailModel.GridColumns, detailModel.GridCustomColumnKey);
|
||||
|
||||
gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(detailModel.FormKey), this.Model);
|
||||
|
||||
Reference in New Issue
Block a user