SVN r1089
SVN-Revision: r1089
This commit is contained in:
@@ -236,6 +236,10 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ModuleResultDic = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// 带参数控件修改数据源字典
|
||||
/// </summary>
|
||||
public Dictionary<string, List<string>> ParaContrlsDic = new Dictionary<string, List<string>>();
|
||||
/// <summary>
|
||||
/// 控件值改变动态刷新表格列
|
||||
/// </summary>
|
||||
public event KeyEventHandler OnDataFileRefrshCallBack;
|
||||
@@ -1458,8 +1462,8 @@ namespace Lskj.Control.Model
|
||||
model.SourceSql += "and 1<>1";
|
||||
}
|
||||
DataTable table = new DataTable();
|
||||
|
||||
if ((!ControlType.IsNotLoadData(model.FieldType)|| model.ModuleFrameDisplayText && (model.FieldType == 160|| model.FieldType == 161)) && model.FieldType != ControlType.LabTreeType)
|
||||
|
||||
if ((!ControlType.IsNotLoadData(model.FieldType) || model.ModuleFrameDisplayText && (model.FieldType == 160 || model.FieldType == 161)) && model.FieldType != ControlType.LabTreeType)
|
||||
{
|
||||
if (mControlSourceDic.ContainsKey(model))
|
||||
{
|
||||
@@ -1528,6 +1532,25 @@ namespace Lskj.Control.Model
|
||||
// 智能搜索框
|
||||
LabelAutoGridLook autoiGridEdit = ctr as LabelAutoGridLook;
|
||||
autoiGridEdit.SetDataSource(table);
|
||||
if (autoiGridEdit.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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ControlType.LabMultiSelectText:
|
||||
case ControlType.LabMultiSelectTextNew:
|
||||
@@ -1561,6 +1584,8 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
case ControlType.LabCheckAutoSeacherValue:
|
||||
case ControlType.LabCheckAutoSeacherText:
|
||||
case ControlType.LabAutoCompleteCheckParamValue:
|
||||
case ControlType.LabAutoCompleteCheckParamText:
|
||||
// 带复选框自动搜索框
|
||||
LabelCheckAutoTextEdit checkAutoTextEdit = ctr as LabelCheckAutoTextEdit;
|
||||
checkAutoTextEdit.AutoTextEdit.SetDataSource(table);
|
||||
@@ -1573,7 +1598,7 @@ namespace Lskj.Control.Model
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
LabelMultiAutoTextEdit4 moduleReturnsIdnew = ctr as LabelMultiAutoTextEdit4;
|
||||
moduleReturnsIdnew.DataSource=table;
|
||||
moduleReturnsIdnew.DataSource = table;
|
||||
break;
|
||||
case ControlType.DynamicallyGeneratedSql:
|
||||
LabelMultiAutoTextEdit3 moduleSqlGenerated = ctr as LabelMultiAutoTextEdit3;
|
||||
@@ -1711,7 +1736,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
else if (model.FieldName.EndsWith("operatedate", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
controlValue = SqlHelper.ExecuteScalar("select getdate()")+"";//DateTime.Now.ToString();
|
||||
controlValue = SqlHelper.ExecuteScalar("select getdate()") + "";//DateTime.Now.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2095,6 +2120,8 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
case ControlType.LabCheckAutoSeacherValue:
|
||||
case ControlType.LabCheckAutoSeacherText:
|
||||
case ControlType.LabAutoCompleteCheckParamValue:
|
||||
case ControlType.LabAutoCompleteCheckParamText:
|
||||
// 带复选框自动搜索框
|
||||
LabelCheckAutoTextEdit checkAutoTextEdit = ctr as LabelCheckAutoTextEdit;
|
||||
if (checkAutoTextEdit.CheckEdit.Checked)
|
||||
@@ -2130,7 +2157,7 @@ namespace Lskj.Control.Model
|
||||
//数字编辑框
|
||||
case ControlType.LabTextInt:
|
||||
LabelTextEdit textIntEdit = ctr as LabelTextEdit;
|
||||
if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText;
|
||||
if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText.Replace(",", "");
|
||||
break;
|
||||
case ControlType.LabComboxPopupValue:
|
||||
case ControlType.LabComboxPopupText:
|
||||
@@ -2575,7 +2602,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
else if (model.FieldName.EndsWith("operatedate", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string date = SqlHelper.ExecuteScalar("select getdate()") + "";
|
||||
string date = SqlHelper.ExecuteScalar("select getdate()") + "";
|
||||
control.EditText = date; //DateTime.Now.ToString();
|
||||
control.Model.Text = date; //DateTime.Now.ToString();
|
||||
}
|
||||
@@ -3533,6 +3560,10 @@ namespace Lskj.Control.Model
|
||||
if (baseControl is LabelImageEdit)
|
||||
{
|
||||
LabelImageEdit imageEdit = baseControl as LabelImageEdit;
|
||||
if (imageEdit.TextEdit.Image != null)
|
||||
{
|
||||
imageEdit.TextEdit.Image.Dispose();
|
||||
}
|
||||
imageEdit.LoadImage(controlValue + "");
|
||||
}
|
||||
else if (baseControl is LabelPictureEdit)
|
||||
@@ -3915,7 +3946,7 @@ namespace Lskj.Control.Model
|
||||
foreach (DataRow item in _schemes.Rows)
|
||||
{
|
||||
BarButtonItem bbi_item = new BarButtonItem();
|
||||
bbi_item.Caption = item["ProjectName"] + "";
|
||||
bbi_item.Caption = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText(item["ProjectName"] + "") : item["ProjectName"] + "";
|
||||
bbi_item.Tag = item["SearchValue"] + "";
|
||||
bbi_item.ItemClick += new ItemClickEventHandler(OnPopupItemClick);
|
||||
|
||||
@@ -3923,11 +3954,11 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
|
||||
BarButtonItem bbi_save = new BarButtonItem();
|
||||
bbi_save.Caption = "保存方案";
|
||||
bbi_save.Caption = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("保存方案") : "保存方案";
|
||||
bbi_save.ItemClick += new ItemClickEventHandler(OnPopupSaveItemClick);
|
||||
|
||||
BarButtonItem bbi_manager = new BarButtonItem();
|
||||
bbi_manager.Caption = "方案管理";
|
||||
bbi_manager.Caption = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("方案管理") : "方案管理";
|
||||
bbi_manager.ItemClick += new ItemClickEventHandler(OnPopupManagerItemClick);
|
||||
|
||||
_popupMenu.AddItem(bbi_save);
|
||||
@@ -4417,6 +4448,8 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
case ControlType.LabCheckAutoSeacherValue:
|
||||
case ControlType.LabCheckAutoSeacherText:
|
||||
case ControlType.LabAutoCompleteCheckParamValue:
|
||||
case ControlType.LabAutoCompleteCheckParamText:
|
||||
// 带复选框自动搜索框
|
||||
LabelCheckAutoTextEdit checkAutoTextEdit = new LabelCheckAutoTextEdit();
|
||||
checkAutoTextEdit.clickAfterEmpty = model.clickAfterEmpty;
|
||||
@@ -4424,6 +4457,7 @@ namespace Lskj.Control.Model
|
||||
checkAutoTextEdit.AutoTextEdit.ValueField = model.ValueMember;
|
||||
checkAutoTextEdit.AutoTextEdit.TextField = model.TextMember;
|
||||
//checkAutoTextEdit.AutoTextEdit.SetDataSource(dataSource);
|
||||
if(ControlType.LabAutoCompleteCheckParamValue == model.FieldType || ControlType.LabAutoCompleteCheckParamText == model.FieldType) checkAutoTextEdit.TextEdit.ControlObj = this;
|
||||
|
||||
checkAutoTextEdit.TextEdit.SourceSQL = model.SourceSql;
|
||||
checkAutoTextEdit.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
|
||||
@@ -4571,7 +4605,7 @@ namespace Lskj.Control.Model
|
||||
|
||||
model.SourceSql = "";
|
||||
//设置了ModuleFrameDisplayText(显示text值),就把配置的模块sql传给model.SourceSql
|
||||
if (model.ModuleFrameDisplayText)
|
||||
if (model.ModuleFrameDisplayText)
|
||||
{
|
||||
moduleReturnsIdNew.ModuleFrameDisplayText = true;
|
||||
model.SourceSql = moduleReturnsIdNew._lookUpForm.SysModel.MenuSql;
|
||||
@@ -4629,9 +4663,9 @@ namespace Lskj.Control.Model
|
||||
|
||||
billSourceComboxEdit.Button.Visible = true;
|
||||
billSourceComboxEdit.OpenDocumentSource += new EventHandler(OpenDocumentSource);
|
||||
|
||||
|
||||
billSourceComboxEdit.clickAfterEmpty = model.clickAfterEmpty;
|
||||
billSourceComboxEdit.ValueMember =model.ValueMember;
|
||||
billSourceComboxEdit.ValueMember = model.ValueMember;
|
||||
billSourceComboxEdit.ValueField = model.ValueMember;
|
||||
billSourceComboxEdit.TextField = model.TextMember;
|
||||
billSourceComboxEdit.FormKey = model.FieldName + "_" + model.FormKey;
|
||||
@@ -4658,6 +4692,7 @@ namespace Lskj.Control.Model
|
||||
LabelTextEdit textEdit = new LabelTextEdit();
|
||||
if (model.FieldType == ControlType.LabTextInt)
|
||||
{
|
||||
textEdit.TextEdit.Tag = model;
|
||||
textEdit.TextEdit.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.OnIntKeyPress);
|
||||
textEdit.TextEdit.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(this.OnIntEditValueChanging);
|
||||
}
|
||||
@@ -4749,8 +4784,17 @@ namespace Lskj.Control.Model
|
||||
private void OnIntEditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
|
||||
{
|
||||
string newText = e.NewValue as string;
|
||||
|
||||
|
||||
if (sender is TextEdit)
|
||||
{
|
||||
TextEdit textEdit = sender as TextEdit;
|
||||
if (textEdit.Tag is ControlModel)
|
||||
{
|
||||
//没有浏览权限默认显示****
|
||||
ControlModel model = textEdit.Tag as ControlModel;
|
||||
if (model.Visible && newText.Equals("****")) return;
|
||||
}
|
||||
}
|
||||
|
||||
// 第一个输入负号不会取消,出现了千位分隔符不会取消更改,末尾为百分号不会取消
|
||||
if (!newText.Equals("-") && !string.IsNullOrEmpty(newText) && !Regex.IsMatch(newText, @"^(?:-(?:[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)|[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)(?:%)?$"))
|
||||
{
|
||||
@@ -5199,6 +5243,31 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 刷新带参数数据源
|
||||
/// </summary>
|
||||
/// <param name="baseControl"></param>
|
||||
private void RefushParaSource(BaseUserControl baseControl)
|
||||
{
|
||||
|
||||
if (baseControl != null && baseControl.Model != null)
|
||||
{
|
||||
if (ParaContrlsDic.ContainsKey(baseControl.Model.FieldName))
|
||||
{
|
||||
List<string> controlNames = ParaContrlsDic[baseControl.Model.FieldName];
|
||||
foreach (string controlName in controlNames)
|
||||
{
|
||||
BaseUserControl baseUserControl = FindControl(controlName.Trim('{', '}'));
|
||||
if (baseUserControl == null) continue;
|
||||
if (baseUserControl.Model == null) continue;
|
||||
if (baseUserControl is LabelAutoGridLook labelAutoGridLook)
|
||||
{
|
||||
labelAutoGridLook.HandPopupSqlValue(labelAutoGridLook.SourceSQL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件禁编或隐藏</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-01-22 </para>
|
||||
@@ -5213,7 +5282,7 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
ControlModel[] controls = this._models.Where(x => x.DisableCond.Contains("{" + model.FieldName + "}")).ToArray();
|
||||
ControlModel[] requiredcontrols = this._models.Where(x => x.RequiredCond.Contains("{" + model.FieldName + "}")).ToArray();
|
||||
if ((controls == null || controls.Length == 0)&&(requiredcontrols == null || requiredcontrols.Length == 0)) return;
|
||||
if ((controls == null || controls.Length == 0) && (requiredcontrols == null || requiredcontrols.Length == 0)) return;
|
||||
|
||||
string fieldValue = GetControlValue(model);
|
||||
foreach (ControlModel item in requiredcontrols)
|
||||
@@ -5577,6 +5646,7 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
BaseUserControl baseControl = (sender as System.Windows.Forms.Control).ToBaseUserControl();
|
||||
this.SetUnionAncCalcControl(baseControl);
|
||||
this.RefushParaSource(baseControl);
|
||||
if (baseControl.Model != null && baseControl.Model.IsRefreshSource == 1 && OnSourceRefrshCallBack != null)
|
||||
{
|
||||
this.RefreshControl = baseControl.Model.FieldName;//条件表刷新上表的关键字段名
|
||||
|
||||
Reference in New Issue
Block a user