SVN r591
SVN-Revision: r591
This commit is contained in:
@@ -779,7 +779,7 @@ namespace Lskj.Control.Model
|
||||
if (model.SqlDirectExecution)
|
||||
{
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowData, sqlValue);
|
||||
if(this.ControlObj != null && sqlValue.Contains(ReplaceHelper.ReplaceParentLeftKey))
|
||||
if (this.ControlObj != null && sqlValue.Contains(ReplaceHelper.ReplaceParentLeftKey))
|
||||
{
|
||||
List<string> paramFields = ReplaceHelper.GetParamFields(sqlValue);
|
||||
foreach (string item in paramFields)
|
||||
@@ -789,9 +789,9 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
}
|
||||
int NumberOfImpacts = MainImpl.ExecSqlValue(sqlValue);
|
||||
return NumberOfImpacts>0;
|
||||
return NumberOfImpacts > 0;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
// 将sql语句组装成Parameter方式,兼容配置语句.
|
||||
@@ -1068,7 +1068,7 @@ namespace Lskj.Control.Model
|
||||
tp.ShowCloseButton = DefaultBoolean.True;
|
||||
tp.Dock = DockStyle.Fill;
|
||||
//配置了右键刷新的情况下,在当前页签关闭时触发刷新
|
||||
if ( model.Refresh && this.OnRightCallback != null)
|
||||
if (model.Refresh && this.OnRightCallback != null)
|
||||
{
|
||||
tp.Disposed += new EventHandler(OnTp_Disposed);
|
||||
}
|
||||
@@ -1421,7 +1421,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
if (model.Mergeexec)//合并执行
|
||||
{
|
||||
if (model.ActionType == 0)
|
||||
if (model.ActionType == 0)
|
||||
{
|
||||
actionSql = ReplaceHelper.ReplaceRowParam(rows, model.Action, "'", "'");
|
||||
}
|
||||
@@ -1470,7 +1470,7 @@ namespace Lskj.Control.Model
|
||||
string paramsql1 = paramList[3];
|
||||
paramList[3] = ReplaceHelper.ReplaceRowParam(rows, paramsql1, "'", "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (model.DllName.ToLower().Contains("Lskj.PubArgoxPrint.dll".ToLower()))
|
||||
{
|
||||
string mainsql = paramList[2];
|
||||
@@ -1565,7 +1565,7 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string firstChar = fieldValue.Length > 0 ? fieldValue.Substring(0, 1) : "";
|
||||
switch (firstChar)
|
||||
{
|
||||
@@ -1576,7 +1576,22 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
break;
|
||||
case "#": // 需要传入的sql语句
|
||||
handleParamList.Add(ReplaceHelper.ReplaceRowParam(rowData, fieldValue.Replace("#", "")) + "");
|
||||
if (rowDatas == null)
|
||||
{
|
||||
handleParamList.Add(ReplaceHelper.ReplaceRowParam(rowData, fieldValue.Replace("#", "")) + "");
|
||||
}
|
||||
else
|
||||
{
|
||||
//多条合并执行时替换参数
|
||||
fieldValue = 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, "", "") + "");
|
||||
}
|
||||
break;
|
||||
case "[": //[FormTitle_格式数据
|
||||
if (fieldValue.StartsWith("[FormTitle_"))
|
||||
@@ -1600,9 +1615,9 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
foreach (DataRow row in rowDatas)
|
||||
{
|
||||
if (dictionary.ContainsKey(row)&&!string.IsNullOrWhiteSpace(dictionary[row]))
|
||||
if (dictionary.ContainsKey(row) && !string.IsNullOrWhiteSpace(dictionary[row]))
|
||||
{
|
||||
fieldValue +=dictionary[row]+",";
|
||||
fieldValue += dictionary[row] + ",";
|
||||
}
|
||||
}
|
||||
fieldValue = fieldValue.Trim(',');
|
||||
@@ -1681,4 +1696,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user