SVN r314
SVN-Revision: r314
This commit is contained in:
@@ -98,6 +98,14 @@ namespace Lskj.Control
|
|||||||
/// 源表格
|
/// 源表格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private GridControlEx _gridEx;
|
private GridControlEx _gridEx;
|
||||||
|
/// <summary>
|
||||||
|
/// 导入返回控件名
|
||||||
|
/// </summary>
|
||||||
|
public string ImportReturnName = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 导入返回控件值
|
||||||
|
/// </summary>
|
||||||
|
public string ImportReturnValue = string.Empty;
|
||||||
|
|
||||||
public FrmImport()
|
public FrmImport()
|
||||||
: this("", "", "", null, "", "", "", "")
|
: this("", "", "", null, "", "", "", "")
|
||||||
@@ -378,14 +386,40 @@ namespace Lskj.Control
|
|||||||
failedData.Columns.Add("import_errormsg");
|
failedData.Columns.Add("import_errormsg");
|
||||||
if (!failedData.Columns.Contains(this._importFlag))
|
if (!failedData.Columns.Contains(this._importFlag))
|
||||||
failedData.Columns.Add(this._importFlag);
|
failedData.Columns.Add(this._importFlag);
|
||||||
|
if (!string.IsNullOrWhiteSpace(this.ImportReturnName))
|
||||||
|
{
|
||||||
|
if (!failedData.Columns.Contains(this.ImportReturnName))
|
||||||
|
failedData.Columns.Add(this.ImportReturnName);
|
||||||
|
}
|
||||||
for (int i = 0; i < dt.Rows.Count; i++)
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
dt.Rows[i][_importFlag] = "1";
|
dt.Rows[i][_importFlag] = "1";
|
||||||
|
if (!string.IsNullOrWhiteSpace(this.ImportReturnName))
|
||||||
|
{
|
||||||
|
dt.Rows[i][ImportReturnName] = ImportReturnValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
//所有导入的主键集合
|
||||||
|
List<string> parmaryKeys= new List<string>();
|
||||||
|
|
||||||
//根据全表字段类型进行默认填充
|
//根据全表字段类型进行默认填充
|
||||||
int currRow = 0;
|
int currRow = 0;
|
||||||
foreach (DataRow dr in dt.Rows)
|
foreach (DataRow dr in dt.Rows)
|
||||||
{
|
{
|
||||||
|
if (this.SysModel.ImportPrimarykeyVerify && !string.IsNullOrWhiteSpace(_parmaryKey) )
|
||||||
|
{
|
||||||
|
if (parmaryKeys.Contains(dr[_parmaryKey]))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parmaryKeys.Add(dr[_parmaryKey] + "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rowNum = (currRow + 1) + "";
|
rowNum = (currRow + 1) + "";
|
||||||
DataRow tmpRow = datatb.NewRow();
|
DataRow tmpRow = datatb.NewRow();
|
||||||
foreach (DataColumn dc in datatb.Columns)
|
foreach (DataColumn dc in datatb.Columns)
|
||||||
@@ -1192,34 +1226,3 @@ namespace Lskj.Control
|
|||||||
string[] fields = model.UnionFields.Trim(',').Split(',');
|
string[] fields = model.UnionFields.Trim(',').Split(',');
|
||||||
DataRow rowResult = BaseImpl.GetDataRowResult(unionValues);
|
DataRow rowResult = BaseImpl.GetDataRowResult(unionValues);
|
||||||
if (rowResult != null)
|
if (rowResult != null)
|
||||||
{
|
|
||||||
for (int i = 0; i < fields.Length; i++)
|
|
||||||
{
|
|
||||||
string field = fields[i];
|
|
||||||
string value = rowResult.Table.Columns.Contains(field) ? rowResult[field] + "" : null;
|
|
||||||
rowItem[field] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 设置为空
|
|
||||||
for (int i = 0; i < fields.Length; i++)
|
|
||||||
{
|
|
||||||
string field = fields[i];
|
|
||||||
rowItem[field] = DBNull.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
LogHelper.Instance.WriteError(ex);
|
|
||||||
LogUtil.WriteError("计算列关联字段--错误-->" + unionValues, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -281,4 +281,7 @@ namespace Lskj.Control.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The LookUpWidth.</value>
|
/// <value>The LookUpWidth.</value>
|
||||||
public int LookUpWidth { get; set; }
|
public int LookUpWidth { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///下拉列宽度,逗号分隔一一对应
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The LookUpFieldsWidth.</value
|
||||||
@@ -2693,7 +2693,25 @@ namespace Lskj.Control.Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取导入返回控件的名称
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string getImportReturnValueControl()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
foreach (System.Windows.Forms.Control item in _parentPanel.Controls)
|
||||||
|
{
|
||||||
|
if (item is BaseUserControl)
|
||||||
|
{
|
||||||
|
var baseControl = item as BaseUserControl;
|
||||||
|
if(baseControl.Model.ImportReturnValue) return baseControl.Model.FieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -3741,6 +3759,7 @@ namespace Lskj.Control.Model
|
|||||||
model.SplicingConditions = item.Table.Columns.Contains("SplicingConditions") ? item["SplicingConditions"] + "" : "";
|
model.SplicingConditions = item.Table.Columns.Contains("SplicingConditions") ? item["SplicingConditions"] + "" : "";
|
||||||
model.IsRadio = item.Table.Columns.Contains("IsRadio") && !string.IsNullOrWhiteSpace(item["IsRadio"] + "") ? "1".Equals(item["IsRadio"] + "") : false;
|
model.IsRadio = item.Table.Columns.Contains("IsRadio") && !string.IsNullOrWhiteSpace(item["IsRadio"] + "") ? "1".Equals(item["IsRadio"] + "") : false;
|
||||||
model.ScanAfterEmpty = item.Table.Columns.Contains("ScanAfterEmpty") && !string.IsNullOrWhiteSpace(item["ScanAfterEmpty"] + "") ? "1".Equals(item["ScanAfterEmpty"] + "") : false;
|
model.ScanAfterEmpty = item.Table.Columns.Contains("ScanAfterEmpty") && !string.IsNullOrWhiteSpace(item["ScanAfterEmpty"] + "") ? "1".Equals(item["ScanAfterEmpty"] + "") : false;
|
||||||
|
model.ImportReturnValue = item.Table.Columns.Contains("ImportReturnValue") && !string.IsNullOrWhiteSpace(item["ImportReturnValue"] + "") ? "1".Equals(item["ImportReturnValue"] + "") : false;
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -3052,14 +3052,33 @@ namespace Lskj.Control
|
|||||||
leftValue = this.ParentKeyValue;
|
leftValue = this.ParentKeyValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string ImportReturnName= this.SearchObj.getImportReturnValueControl();
|
||||||
|
string ImportReturnValue = string.Empty;
|
||||||
|
if (!string.IsNullOrWhiteSpace(ImportReturnName))
|
||||||
|
{
|
||||||
|
BaseUserControl baseUserControl=this.SearchObj.FindControl(ImportReturnName);
|
||||||
|
ImportReturnValue = BaseImpl.GetDefaultValue(baseUserControl.Model.Default);
|
||||||
|
this.SearchObj.SetControlValue(ImportReturnName, ImportReturnValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FrmImport import = new FrmImport(this.SysModel.MenuTable, this.Model.ModuleCode, _parmaryKey, this.gcMain, this.SysModel.PrefixKey, leftField, leftValue, this.Model.FormText, this.SysModel.ConcatenatedPrefix);
|
FrmImport import = new FrmImport(this.SysModel.MenuTable, this.Model.ModuleCode, _parmaryKey, this.gcMain, this.SysModel.PrefixKey, leftField, leftValue, this.Model.FormText, this.SysModel.ConcatenatedPrefix);
|
||||||
import.ParentGridEx = this.ParentGridEx;
|
import.ParentGridEx = this.ParentGridEx;
|
||||||
|
import.ImportReturnName = ImportReturnName;
|
||||||
|
import.ImportReturnValue = ImportReturnValue;
|
||||||
DialogResult result = import.ShowDialog();
|
DialogResult result = import.ShowDialog();
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
this.SearchObj.SearchLastGrid();
|
if (!string.IsNullOrWhiteSpace(ImportReturnName))
|
||||||
|
{
|
||||||
|
this.SearchObj.SearchGrid();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.SearchObj.SearchLastGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(this.SysModel.afterimportSql))
|
if (!string.IsNullOrWhiteSpace(this.SysModel.afterimportSql))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ namespace Lskj.Control.MultiModelLookUp
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool SingleChoiceMode;
|
public bool SingleChoiceMode;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表格列根据配置加载(默认是加载sql数据源中的中文列,目前只支持单选模式)
|
/// 表格列根据配置加载(默认是加载sql数据源中的中文列,目前只支持单选模式) 2025-03-06 改成单选默认根据配置加载
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ConfigureColumnMode = false;
|
public bool ConfigureColumnMode = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -209,6 +209,17 @@ namespace Lskj.Control.MultiModelLookUp
|
|||||||
this.Resize += new System.EventHandler(maximization);
|
this.Resize += new System.EventHandler(maximization);
|
||||||
this.splitMain_Right.SplitterMoved += new EventHandler(PositionChange);
|
this.splitMain_Right.SplitterMoved += new EventHandler(PositionChange);
|
||||||
}
|
}
|
||||||
|
//右键
|
||||||
|
//DataTable dt = BaseModuleImpl.GetBaseGridRightMenus(this.UnionModuleCodel);
|
||||||
|
//string[] obj = new string[]{
|
||||||
|
// "",
|
||||||
|
// ERPInfo.Instance.UserId,
|
||||||
|
// ERPInfo.Instance.UserName,
|
||||||
|
// "3",
|
||||||
|
// this.UnionModuleCodel,
|
||||||
|
//}; ;
|
||||||
|
//DynamicModel dynamicModel = new DynamicModel(obj);
|
||||||
|
//this.gcMain.SetGridRightMenus(dt, dynamicModel, null, this.SearchObj, null);
|
||||||
|
|
||||||
|
|
||||||
this.gcDetail.GridView.OptionsSelection.EnableAppearanceFocusedCell = false;
|
this.gcDetail.GridView.OptionsSelection.EnableAppearanceFocusedCell = false;
|
||||||
@@ -368,7 +379,7 @@ namespace Lskj.Control.MultiModelLookUp
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void SetReadOnlyColumns()
|
private void SetReadOnlyColumns()
|
||||||
{
|
{
|
||||||
if (this.ConfigureColumnMode && SingleChoiceMode)
|
if ( SingleChoiceMode) //this.ConfigureColumnMode &&
|
||||||
{
|
{
|
||||||
DataTable _gridColumns = BaseModuleImpl.GetBaseGridColumns(this.UnionModuleCodel);
|
DataTable _gridColumns = BaseModuleImpl.GetBaseGridColumns(this.UnionModuleCodel);
|
||||||
this.gcMain.SetReadOnlyColumns(_gridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);
|
this.gcMain.SetReadOnlyColumns(_gridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);
|
||||||
|
|||||||
@@ -648,7 +648,7 @@ namespace Lskj.Control.MultiModelLookUp
|
|||||||
LeftGridEx.GridView.SelectRow(0);
|
LeftGridEx.GridView.SelectRow(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.DataSource = BaseImpl.GetDataTableResult(this.NewSourceSQL + "and 1<>1");
|
this.DataSource = BaseImpl.GetDataTableResult(this.NewSourceSQL + " and 1<>1");
|
||||||
this.gcDetail.GridControl.DataSource = this.gcMain.gridControl.DataSourceTable().Clone();
|
this.gcDetail.GridControl.DataSource = this.gcMain.gridControl.DataSourceTable().Clone();
|
||||||
//创建表格列
|
//创建表格列
|
||||||
if (isFirst)
|
if (isFirst)
|
||||||
|
|||||||
Reference in New Issue
Block a user