SVN r654
SVN-Revision: r654
This commit is contained in:
@@ -298,4 +298,8 @@ namespace Lskj.Control.Model
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
/// <
|
||||
/// <summary>
|
||||
///模块选择返回框,是否单选模式
|
||||
/// </summary>
|
||||
public bool IsRadio { get; set; }
|
||||
/
|
||||
@@ -347,6 +347,10 @@ namespace Lskj.Control.Model
|
||||
/// 聚合字段列
|
||||
/// </summary>
|
||||
public int IsCustomGroupField;
|
||||
/// <summary>
|
||||
/// 导入时转格式
|
||||
/// </summary>
|
||||
public string ImportConversionFormat;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -439,4 +443,4 @@ namespace Lskj.Control.Model
|
||||
this._lookUpWidth = item.Table.Columns.Contains("LookUpWidth") ? int.TryParse(item["LookUpWidth"] + "", out int lookUpWidth) ? lookUpWidth : 0 : 0;
|
||||
this._lookUpFieldsWidth = item.Table.Columns.Contains("LookUpFieldsWidth") ? item["LookUpFieldsWidth"] + "" : "";
|
||||
this.isDynamic = item.Table.Columns.Contains("isDynamic") && !string.IsNullOrWhiteSpace(item["isDynamic"] + "") ? "1".Equals(item["isDynamic"] + "") : false;
|
||||
th
|
||||
this.ConfigureColumnMode = item.Table.Columns.Contains("ConfigureColumnMode") && !string.IsNullOrWhiteSpace(item["ConfigureColumnMode"] + "") ? "1".Equa
|
||||
@@ -1920,19 +1920,49 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
string selWhere = "1=1";
|
||||
DataTable table = ValueGridColumnTable[model];
|
||||
if (table != null && table.Rows.Count > 0)
|
||||
|
||||
if (model.FieldType == ControlType.LabMultiSelectValue || model.FieldType == ControlType.LabMultiSelectValueNew || model.FieldType == ControlType.LabMultiSelectValueParam)
|
||||
{
|
||||
DataRow rowItemValue = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.TextMember] + "" == text);
|
||||
DataRow rowItemText = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.ValueMember] + "" == text);
|
||||
//value = rowItemValue != null ? rowItemValue[isBillImport ? model.ValueMember : model.TextMember] + "" : rowItemText != null ? rowItemText[isBillImport ? model.ValueMember : model.TextMember] + "" : "";
|
||||
value = rowItemValue != null ? rowItemValue[model.ValueMember] + "" : rowItemText != null ? rowItemText[model.ValueMember] + "" : "";
|
||||
string[] splitString = text.Split(',');
|
||||
string nemValue = string.Empty;
|
||||
foreach (string newText in splitString)
|
||||
{
|
||||
if (table != null && table.Rows.Count > 0)
|
||||
{
|
||||
DataRow rowItemValue = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.TextMember] + "" == newText);
|
||||
DataRow rowItemText = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.ValueMember] + "" == newText);
|
||||
value = rowItemValue != null ? rowItemValue[model.ValueMember] + "" : rowItemText != null ? rowItemText[model.ValueMember] + "" : "";
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
nemValue += value + ',';
|
||||
}
|
||||
value = nemValue.TrimEnd(',');
|
||||
}
|
||||
else
|
||||
value = "";
|
||||
{
|
||||
if (table != null && table.Rows.Count > 0)
|
||||
{
|
||||
DataRow rowItemValue = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.TextMember] + "" == text);
|
||||
DataRow rowItemText = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.ValueMember] + "" == text);
|
||||
//value = rowItemValue != null ? rowItemValue[isBillImport ? model.ValueMember : model.TextMember] + "" : rowItemText != null ? rowItemText[isBillImport ? model.ValueMember : model.TextMember] + "" : "";
|
||||
value = rowItemValue != null ? rowItemValue[model.ValueMember] + "" : rowItemText != null ? rowItemText[model.ValueMember] + "" : "";
|
||||
}
|
||||
else
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:导入到表格中</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
@@ -2074,6 +2104,22 @@ namespace Lskj.Control.Model
|
||||
// dataRow[col.FieldName] = cell.StringCellValue;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(SystemInfo.Instance.ImportRemoveSpaces && cell.CellType == CellType.String)
|
||||
{
|
||||
// 清除字符串前后空格
|
||||
string cellValue = cell.StringCellValue.Trim();
|
||||
cell.SetCellValue(cellValue);
|
||||
}
|
||||
|
||||
if ((model.ImportConversionFormat+"").Equals("1"))
|
||||
{
|
||||
// 转成全大写
|
||||
string cellValue = cell.StringCellValue.ToUpper();
|
||||
cell.SetCellValue(cellValue);
|
||||
}
|
||||
|
||||
|
||||
if (cell.CellType == CellType.Numeric && (cell.NumericCellValue + "").StartsWith("-"))
|
||||
{
|
||||
dataRow[col.FieldName] = cell.NumericCellValue;
|
||||
@@ -2411,6 +2457,14 @@ namespace Lskj.Control.Model
|
||||
//isImportRows = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SystemInfo.Instance.ImportRemoveSpaces && cell.CellType == CellType.String)
|
||||
{
|
||||
// 清除字符串前后空格
|
||||
string cellValue = cell.StringCellValue.Trim();
|
||||
cell.SetCellValue(cellValue);
|
||||
}
|
||||
|
||||
if (cell.CellType == CellType.Numeric && (cell.NumericCellValue + "").StartsWith("-"))
|
||||
{
|
||||
dataRow[col.FieldName] = cell.NumericCellValue;
|
||||
@@ -3686,47 +3740,4 @@ namespace Lskj.Control.Model
|
||||
// 设置填充模式为实心填充
|
||||
cellStyle.FillPattern = FillPattern.SolidForeground;
|
||||
}
|
||||
cell.CellStyle = cellStyle;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 保存更改回原始文件
|
||||
using (FileStream file = new FileStream(excelFilePath, FileMode.Create, FileAccess.Write))
|
||||
{
|
||||
workbook.Write(file);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在未保存的数据
|
||||
/// </summary>
|
||||
/// <param name="control"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsDataNotSaved(this GridControlEx control)
|
||||
{
|
||||
DataTable table = control.gridControl.DataSource as DataTable;
|
||||
foreach (DataRow row in table.Rows)
|
||||
{
|
||||
if (row.RowState == DataRowState.Modified || row.RowState == DataRowState.Added)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1505,7 +1505,7 @@ namespace Lskj.Control.Model
|
||||
// 右键调用Lskj.PubBill.dll、Lskj.PubBillBrp,并且为多选新增,则汇总明细数据且只执行一次.
|
||||
bool isOnlyOne = (model.DllName.Equals("lskj.pubbill.dll", StringComparison.OrdinalIgnoreCase) ||
|
||||
model.DllName.Equals("lskj.pubbillbrp.dll", StringComparison.OrdinalIgnoreCase)) &&
|
||||
!string.IsNullOrEmpty(model.DllParam8) && !string.IsNullOrEmpty(model.DllParam9) && model.MoreClick;
|
||||
!string.IsNullOrEmpty(model.DllParam8) && !string.IsNullOrEmpty(model.DllParam9) && model.Mergeexec;
|
||||
if (isOnlyOne)
|
||||
{
|
||||
string fieldValue = paramList[8];
|
||||
@@ -1675,14 +1675,18 @@ namespace Lskj.Control.Model
|
||||
else
|
||||
{
|
||||
//多条合并执行时替换参数
|
||||
fieldValue = fieldValue.Replace("[", "{").Replace("]", "}");
|
||||
//先替换{},替换的是选中行的数据
|
||||
fieldValue = ReplaceHelper.ReplaceRowParam(rowData, fieldValue.Replace("#", ""));
|
||||
//替换[],替换的是多选行中的数据
|
||||
fieldValue = ReplaceHelper.ReplaceRowParam(rowDatas, fieldValue.Replace("[", "{").Replace("]", "}"), "", "");
|
||||
|
||||
//如果是sql的情况,可能有 select '[xx]' as xxx 和 where xx in([xxx]) 的情况,start和end不好统一设置,先默认为空
|
||||
//string start = "'", end = "'";
|
||||
//if (fieldValue.ToUpper().Contains("EXEC"))
|
||||
//{
|
||||
// start = end = string.Empty;
|
||||
//}
|
||||
handleParamList.Add(ReplaceHelper.ReplaceRowParam(rowDatas, fieldValue, "", "") + "");
|
||||
handleParamList.Add(fieldValue);
|
||||
}
|
||||
break;
|
||||
case "[": //[FormTitle_格式数据
|
||||
@@ -1788,4 +1792,28 @@ namespace Lskj.Control.Model
|
||||
DataRow[] dataRows = columnsTab.Select().Where(n => (n["name"] + "").Equals(colunmField.Key)).ToArray();
|
||||
if (dataRows.Length == 0)
|
||||
{
|
||||
string a
|
||||
string addColSql = string.Format("alter table P_PrivateDllTab add {0} {1}", colunmField.Key, colunmField.Value);
|
||||
SqlHelper.ExecuteNonQuery(addColSql);//添加列
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string createTabSql = "create table P_PrivateDllTab(id int IDENTITY(1,1) NOT NULL,{0})";
|
||||
string createCol = string.Empty;
|
||||
foreach (KeyValuePair<string, string> colunmField in colDic)
|
||||
{
|
||||
createCol += string.Format("{0} {1},", colunmField.Key, colunmField.Value);
|
||||
}
|
||||
createTabSql = string.Format(createTabSql, createCol.TrimEnd(','));
|
||||
SqlHelper.ExecuteNonQuery(createTabSql);//创建表
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2969,7 +2969,7 @@ namespace Lskj.Control.Model
|
||||
#endregion
|
||||
#region 保存成功后上传附件
|
||||
string idValue = primaryValue;
|
||||
if (SystemModel!=null&&!string.IsNullOrWhiteSpace(SystemModel.AttachmentAssociated))
|
||||
if (SystemModel != null && !string.IsNullOrWhiteSpace(SystemModel.AttachmentAssociated))
|
||||
{
|
||||
idValue = GetControlValue(SystemModel.AttachmentAssociated);
|
||||
}
|
||||
@@ -3024,7 +3024,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
#endregion
|
||||
#region 保存后执行某个右键
|
||||
if (SystemModel!=null&&!string.IsNullOrEmpty(SystemModel.AfterSaveExec))
|
||||
if (SystemModel != null && !string.IsNullOrEmpty(SystemModel.AfterSaveExec))
|
||||
{
|
||||
DataRow menuRow = BaseModuleImpl.GetBaseGridRightMenuById(SystemModel.AfterSaveExec);
|
||||
if (menuRow != null)
|
||||
@@ -3287,7 +3287,10 @@ namespace Lskj.Control.Model
|
||||
|
||||
this._mainGridEx.LastSearchSql = sqlValue;
|
||||
this._mainGridEx.LastSearchButtonhSql = sqlValue;
|
||||
|
||||
//while (!_mainGridEx.IsHandleCreated)
|
||||
//{
|
||||
// System.Threading.Thread.Sleep(100);
|
||||
//}
|
||||
if (_mainGridEx.IsHandleCreated)
|
||||
{
|
||||
// 窗口加载完成搜索,采用异步加载
|
||||
@@ -3924,6 +3927,7 @@ namespace Lskj.Control.Model
|
||||
model.ImportReturnValue = item.Table.Columns.Contains("ImportReturnValue") && !string.IsNullOrWhiteSpace(item["ImportReturnValue"] + "") ? "1".Equals(item["ImportReturnValue"] + "") : false;
|
||||
model.ImportCurrentValue = item.Table.Columns.Contains("ImportCurrentValue") && !string.IsNullOrWhiteSpace(item["ImportCurrentValue"] + "") ? "1".Equals(item["ImportCurrentValue"] + "") : false;
|
||||
model.SchedStartDataControl = item.Table.Columns.Contains("SchedStartDataControl") && !string.IsNullOrWhiteSpace(item["SchedStartDataControl"] + "") ? "1".Equals(item["SchedStartDataControl"] + "") : false;
|
||||
model.ListBoxFontSize = item.Table.Columns.Contains("ListBoxFontSize") && !string.IsNullOrEmpty(item["ListBoxFontSize"] + "") ? Convert.ToInt32(item["ListBoxFontSize"] + "") : 0;
|
||||
return model;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -4066,19 +4070,19 @@ namespace Lskj.Control.Model
|
||||
case ControlType.LabMultiComTreeboxTextParam:
|
||||
// 自动树节点搜索框
|
||||
LabelAutoTreeEdit autoTreeEdit = new LabelAutoTreeEdit();
|
||||
autoTreeEdit.isMultiClick = (ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeText == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabMulitTreeTextParam == model.FieldType|| ControlType.LabMultiComTreeboxValue == model.FieldType || ControlType.LabMultiComTreeboxText == model.FieldType || ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxTextParam == model.FieldType);
|
||||
autoTreeEdit.ValueMember = ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxValue == model.FieldType||ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabTreeLookValue == model.FieldType || ControlType.LabCheckTreeLookValue == model.FieldType || ControlType.LabTreeLastlevelValue == model.FieldType || ControlType.LabCheckTreeLastlevelValue == model.FieldType ? model.ValueMember : model.TextMember;
|
||||
autoTreeEdit.isMultiClick = (ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeText == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabMulitTreeTextParam == model.FieldType || ControlType.LabMultiComTreeboxValue == model.FieldType || ControlType.LabMultiComTreeboxText == model.FieldType || ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxTextParam == model.FieldType);
|
||||
autoTreeEdit.ValueMember = ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxValue == model.FieldType || ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabTreeLookValue == model.FieldType || ControlType.LabCheckTreeLookValue == model.FieldType || ControlType.LabTreeLastlevelValue == model.FieldType || ControlType.LabCheckTreeLastlevelValue == model.FieldType ? model.ValueMember : model.TextMember;
|
||||
autoTreeEdit.ValueField = model.ValueMember;
|
||||
autoTreeEdit.TextField = model.TextMember;
|
||||
if (ControlType.LabTreeLastlevelValue == model.FieldType || ControlType.LabTreeLastlevelText == model.FieldType || ControlType.LabCheckTreeLastlevelValue == model.FieldType || ControlType.LabCheckTreeLastlevelText == model.FieldType) autoTreeEdit.isRootNode = false;
|
||||
|
||||
|
||||
//工具中和bs里 132-135都是只能选末级,136-139可以选中全部
|
||||
if (ControlType.LabMultiComTreeboxValue == model.FieldType || ControlType.LabMultiComTreeboxText == model.FieldType || ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxTextParam == model.FieldType)
|
||||
{
|
||||
|
||||
autoTreeEdit.TextEdit.SelectAll = true;
|
||||
}
|
||||
|
||||
|
||||
//autoTreeEdit.FormKey = model.FieldName + "_" + model.FormKey;
|
||||
//autoEdit.SetDataSource(dataSource);
|
||||
autoTreeEdit.TextEdit.SourceSQL = model.SourceSql;
|
||||
@@ -4348,6 +4352,7 @@ namespace Lskj.Control.Model
|
||||
case ControlType.LabComboxPopupText:
|
||||
// 弹出下拉列表框
|
||||
LabelComboxPopupEdit comboxPopupEdit = new LabelComboxPopupEdit();
|
||||
comboxPopupEdit.ListBoxFontSize = model.ListBoxFontSize;
|
||||
comboxPopupEdit.ControlObj = this;
|
||||
comboxPopupEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||
if (!isLoadBorder) comboxPopupEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
@@ -4357,6 +4362,7 @@ namespace Lskj.Control.Model
|
||||
case ControlType.LabComboxPopupMutilText:
|
||||
// 弹出多选列表框
|
||||
LabelComboxMutilPopupEdit comboxMutilPopupEdit = new LabelComboxMutilPopupEdit();
|
||||
comboxMutilPopupEdit.ListBoxFontSize = model.ListBoxFontSize;
|
||||
comboxMutilPopupEdit.ControlObj = this;
|
||||
comboxMutilPopupEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||
if (!isLoadBorder) comboxMutilPopupEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
|
||||
Reference in New Issue
Block a user