SVN r263
SVN-Revision: r263
This commit is contained in:
@@ -1645,17 +1645,6 @@ namespace Lskj.Control
|
||||
foreach (DataRow item in rowItems)
|
||||
{
|
||||
WaitForm.ShowForm("正在审核[" + item[this.BaseAccraditModelObj.TmpParmaryField] + "]单据!");
|
||||
//string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, item[this.BaseAccraditModelObj.TmpStepField] + "", item[this.BaseAccraditModelObj.TmpParmaryField] + "", "", this.AuditComModelObj.ProcedureName, "F", "", "批量审批同意");
|
||||
|
||||
//if ("1".Equals(result))
|
||||
//{
|
||||
// success++;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// fault++;
|
||||
// tipMsg = result + "\r\n";
|
||||
//}
|
||||
bool isComplete = true;//判断必填项
|
||||
string BillDocumentId = item[this.BaseAccraditModelObj.TmpParmaryField] + "";//单据号
|
||||
//主表必填
|
||||
@@ -1754,6 +1743,7 @@ namespace Lskj.Control
|
||||
if (SelectGridControlEx != null && oldRowHandle > 0)
|
||||
{
|
||||
SelectGridControlEx.GridView.SelectRowHandler(oldRowHandle);
|
||||
OnPcgridRowCellClick(SelectGridControlEx.GridView, null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2673,6 +2663,9 @@ namespace Lskj.Control
|
||||
/// <param name="code"></param>
|
||||
public void RefreshTabPage()
|
||||
{
|
||||
DataTable detailTable = gcDetail.GridControl.DataSourceTable();
|
||||
detailTable.Clear();
|
||||
this.ControlObj.ResetControlValue();
|
||||
foreach (TabPageObj tab in this._tabPageObjs)
|
||||
{
|
||||
int cnt = 0;
|
||||
@@ -2749,37 +2742,4 @@ namespace Lskj.Control
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 优化加载速度
|
||||
/// </summary>
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
CreateParams cp = base.CreateParams;
|
||||
cp.ExStyle |= 0x02000000;
|
||||
return cp;
|
||||
}
|
||||
}
|
||||
|
||||
public EventHandler GridView_DoubleClick { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出明细
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void simpleButton2_Click(object sender, EventArgs e)
|
||||
{
|
||||
LogUtil.WriteDebug(this.SysModel.ModuleCode, "导出数据", this.SysModel.FormText, "单据明细导出", this.SysModel.ModuleId + "");
|
||||
this.gcDetail.GridControl.ToExcel(this.SysModel.FormText);
|
||||
}
|
||||
}
|
||||
}
|
||||
string M
|
||||
@@ -669,7 +669,7 @@ namespace Lskj.Control
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(model.SqlSource))
|
||||
if (!string.IsNullOrEmpty(model.SqlSource) && !(model.FieldType == ControlType.LabSelectReturnIdNew || model.FieldType == ControlType.LabSelectReturnTextNew))
|
||||
{
|
||||
Task<DataTable> sourceTask = new Task<DataTable>(() =>
|
||||
{
|
||||
@@ -1047,6 +1047,7 @@ namespace Lskj.Control
|
||||
mLoading = true;
|
||||
try
|
||||
{
|
||||
if (this.OnDataSourceBindCallBack != null) this.OnDataSourceBindCallBack(null, null);
|
||||
SetColumnsSource();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1056,7 +1057,7 @@ namespace Lskj.Control
|
||||
finally
|
||||
{
|
||||
mControlSourceDic.Clear();
|
||||
if (this.OnDataSourceBindCallBack != null) this.OnDataSourceBindCallBack(null, null);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1070,6 +1071,7 @@ namespace Lskj.Control
|
||||
foreach (GridColumnModel item in mControlList)
|
||||
{
|
||||
if (this.DisableFieldSources && item.isVislble) continue;
|
||||
if(item.FieldType == ControlType.LabSelectReturnIdNew || item.FieldType == ControlType.LabSelectReturnTextNew) continue;
|
||||
if (!string.IsNullOrWhiteSpace(item.SqlSource))
|
||||
{
|
||||
DataTable dataTable = new DataTable();
|
||||
|
||||
@@ -346,4 +346,9 @@ namespace Lskj.Control
|
||||
_lookUpForm.NewSourceSQL = sqlValue;
|
||||
_lookUpForm.AddModuleResult = Model.AddModuleResult;
|
||||
_lookUpForm.InitControls(UnionModuleCodel);
|
||||
Di
|
||||
DialogResult result = _lookUpForm.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
string value = Model.FieldType == ControlType.LabSelectReturnIdNew ? _lookUpForm.EditValue : _lookUpForm.EditText;
|
||||
this.EditValue = value;
|
||||
|
||||
@@ -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,7 +1405,9 @@ 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);
|
||||
DataTable table = new DataTable();
|
||||
if (model.FieldType != ControlType.LabSelectReturnIdNew && model.FieldType != ControlType.LabSelectReturnTextNew)
|
||||
{
|
||||
if (mControlSourceDic.ContainsKey(model))
|
||||
{
|
||||
table = mControlSourceDic[model].Result;
|
||||
@@ -1408,6 +1416,7 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
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);
|
||||
//else
|
||||
@@ -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))
|
||||
|
||||
@@ -555,7 +555,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
ReplaceHelper.ReplaceWhereCond(this.NewSourceSQL) + where;
|
||||
this.DataSource = MainImpl.GetDataTableResult(sqlValue);
|
||||
this.SetSelectionBox();
|
||||
this.SetDefaultValue();
|
||||
//this.SetDefaultValue();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
@@ -636,7 +636,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
this.SearchObj.ParentUnionField = this.ParentUnionField;
|
||||
this.pl_top.Height = 0;
|
||||
this.pl_top.Height = this.SearchObj.InitSearchControl(queryTable, this.pl_top);
|
||||
this.SearchObj.OnSearchAfterCallBack += SearchObj_OnSearchAfterCallBack;
|
||||
//this.SearchObj.OnSearchAfterCallBack += SearchObj_OnSearchAfterCallBack;
|
||||
|
||||
if (LeftTreeViewEx != null && LeftTreeViewEx.TreeView.Nodes.Count > 0)
|
||||
{
|
||||
@@ -659,7 +659,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
this.SetDefaultValue();
|
||||
|
||||
//查询
|
||||
if(this.SysModel.CsHasDefultSearch) this.SearchObj.SearchGrid();
|
||||
if (this.SysModel.CsHasDefultSearch) this.SearchObj.SearchGrid();
|
||||
|
||||
//单选模式不需要设置下方表中选中行
|
||||
//if (!SingleChoiceMode) this.SetDefaultValue();
|
||||
@@ -671,12 +671,9 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
{
|
||||
if (isFirstSearch)
|
||||
{
|
||||
//this.SetSelectionBox();
|
||||
this.SetDefaultValue();
|
||||
}
|
||||
isFirstSearch = false;
|
||||
//this.SetSelectionBox();
|
||||
//this.SetReadOnlyColumns();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -813,7 +810,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
DataRow rowItem = this.gcMain.GridView.GetFocusedDataRow();
|
||||
if (rowItem != null)
|
||||
{
|
||||
DataRow Item = (this.gcDetail.GridControl.DataSource as DataTable).Rows.Cast<DataRow>().FirstOrDefault(x => x[ValueMember] + "" == rowItem[ValueMember]+"");
|
||||
DataRow Item = (this.gcDetail.GridControl.DataSource as DataTable).Rows.Cast<DataRow>().FirstOrDefault(x => x[ValueMember] + "" == rowItem[ValueMember] + "");
|
||||
if (Item == null) (this.gcDetail.GridControl.DataSource as DataTable).Rows.Add(rowItem.ItemArray);
|
||||
rowItem.AcceptChanges();
|
||||
}
|
||||
@@ -833,13 +830,49 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
/// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs"/> instance containing the event data.</param>
|
||||
private void OnRowCellClickRadio(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
EditValue = string.Empty;
|
||||
EditText = string.Empty;
|
||||
ModuleResultDic.Clear();
|
||||
DataRow dr = this.gcMain.GridView.GetFocusedDataRow();
|
||||
if (dr != null)
|
||||
{
|
||||
this.EditValue = dr[ValueMember] + "";
|
||||
this.EditText = dr[TextField] + "";
|
||||
|
||||
if (!string.IsNullOrEmpty(AddModuleResult))
|
||||
{
|
||||
string[] resultFields = AddModuleResult.Split(',');
|
||||
foreach (string resultField in resultFields)
|
||||
{
|
||||
Match match = Regex.Match(resultField, @"^\s*([^\s]+)\s+AS\s+([^\s]+)\s*$", RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
string beforeAs = match.Groups[1].Value.Trim();
|
||||
string afterAs = match.Groups[2].Value.Trim();
|
||||
string value = "";
|
||||
|
||||
if (dr.Table.Columns.Contains(beforeAs))
|
||||
{
|
||||
value += dr[beforeAs] + "";
|
||||
}
|
||||
|
||||
ModuleResultDic.Add(afterAs, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
string value = "";
|
||||
|
||||
if (dr.Table.Columns.Contains(resultField))
|
||||
{
|
||||
value += dr[resultField] + "";
|
||||
}
|
||||
|
||||
ModuleResultDic.Add(resultField, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user