SVN r263
SVN-Revision: r263
This commit is contained in:
@@ -361,6 +361,17 @@ 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==116)
|
||||
//{
|
||||
// this._fieldtype = 160;
|
||||
//}
|
||||
//if (this._fieldtype == 117)
|
||||
//{
|
||||
// this._fieldtype = 161;
|
||||
//}
|
||||
|
||||
|
||||
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";
|
||||
|
||||
@@ -211,6 +211,12 @@ namespace Lskj.Control.Model
|
||||
/// 弹出框右键
|
||||
/// </summary>
|
||||
public BarItemLinkCollection rightItemLinks;
|
||||
/// <summary>
|
||||
/// 模块选择框 选中后返回关联的字典
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ModuleResultDic = new Dictionary<string, string>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 控件Panel对象
|
||||
/// </summary>
|
||||
@@ -1399,14 +1405,17 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
model.SourceSql += "and 1<>1";
|
||||
}
|
||||
DataTable table = (model.FieldType == ControlType.LabSelectReturnIdNew || model.FieldType == ControlType.LabSelectReturnTextNew) ? new DataTable() : BaseImpl.GetDataTableResult(model.SourceSql);
|
||||
if (mControlSourceDic.ContainsKey(model))
|
||||
DataTable table = new DataTable();
|
||||
if (model.FieldType != ControlType.LabSelectReturnIdNew && model.FieldType != ControlType.LabSelectReturnTextNew)
|
||||
{
|
||||
table = mControlSourceDic[model].Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
table = BaseImpl.GetDataTableResult(model.SourceSql);
|
||||
if (mControlSourceDic.ContainsKey(model))
|
||||
{
|
||||
table = mControlSourceDic[model].Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
table = BaseImpl.GetDataTableResult(model.SourceSql);
|
||||
}
|
||||
}
|
||||
//if (model.FieldType != ControlType.LabAutoCompleteValueParam && model.FieldType != ControlType.LabAutoCompleteTextParam && model.FieldType != ControlType.LabAutoCompleteValue && model.FieldType != ControlType.LabAutoCompleteText)
|
||||
// table = MainImpl.GetDataTableResult(model.SourceSql);
|
||||
@@ -2497,7 +2506,7 @@ namespace Lskj.Control.Model
|
||||
foreach (ControlModel model in this.ControlModels)
|
||||
{
|
||||
BaseUserControl control = FindControl(model);
|
||||
if (!model.IsFixedValue) continue;//清空时该控件是否忽略
|
||||
if (model.IsFixedValue) continue;//清空时该控件是否忽略
|
||||
// 树结构节点不清空数据
|
||||
if (control != null && model.FieldType != ControlType.LabTreeType)
|
||||
{
|
||||
@@ -2795,7 +2804,14 @@ namespace Lskj.Control.Model
|
||||
valueBuilder.AppendFormat("N'{0}',", ParentKey);
|
||||
}
|
||||
|
||||
|
||||
if (ModuleResultDic!=null&& ModuleResultDic.Count>0)
|
||||
{
|
||||
foreach (string resultKey in ModuleResultDic.Keys)
|
||||
{
|
||||
fieldBuilder.Append(resultKey + ",");
|
||||
valueBuilder.AppendFormat("N'{0}',", ModuleResultDic[resultKey].Replace("'", "''"));
|
||||
}
|
||||
}
|
||||
execSql = string.Format("insert into {0}({1}) values ({2})", tableName, fieldBuilder.ToString().TrimEnd(','), valueBuilder.ToString().TrimEnd(','));
|
||||
}
|
||||
else
|
||||
@@ -2826,6 +2842,13 @@ namespace Lskj.Control.Model
|
||||
updateBuilder.Append(string.IsNullOrEmpty(fieldValue) ? string.Format("{0}={1}", model.FieldName, GetNullValue(model)) : string.Format("{0}=N'{1}',", model.FieldName, fieldValue.Replace("'", "''")));
|
||||
}
|
||||
}
|
||||
if (ModuleResultDic != null && ModuleResultDic.Count > 0)
|
||||
{
|
||||
foreach (string resultKey in ModuleResultDic.Keys)
|
||||
{
|
||||
updateBuilder.Append(string.Format("{0}=N'{1}',", resultKey, ModuleResultDic[resultKey].Replace("'", "''")));
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(updateBuilder.ToString()))
|
||||
{
|
||||
execSql = string.Format("update {0} set {1} where {2}='{3}'", tableName, updateBuilder.ToString().TrimEnd(','), primaryKey, primaryValue);
|
||||
@@ -3736,7 +3759,8 @@ namespace Lskj.Control.Model
|
||||
/// <returns>System.Windows.Forms.Control.</returns>
|
||||
private System.Windows.Forms.Control InitControl(ControlModel model, bool isLoadBorder = true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(model.SourceSql) && model.Visible)
|
||||
|
||||
if (!string.IsNullOrEmpty(model.SourceSql)&& !(model.FieldType == ControlType.LabSelectReturnIdNew || model.FieldType == ControlType.LabSelectReturnTextNew))
|
||||
{
|
||||
Task<DataTable> sourceTask = null;
|
||||
if (StaticControl.AddParentGrid.Key != null && Model != null && StaticControl.AddParentGrid.Key.Equals(Model.ModuleCode))
|
||||
|
||||
Reference in New Issue
Block a user