ab56a9bcf7
SVN-Revision: r240
142 lines
5.0 KiB
C#
142 lines
5.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
using DevExpress.XtraEditors;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Util;
|
|
using DevExpress.XtraTab;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Model;
|
|
using System.Diagnostics;
|
|
using Lskj.Core;
|
|
using Lskj.Business;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace Lskj.Control
|
|
{
|
|
public partial class AdditionalFrm : BaseForm
|
|
{
|
|
public AdditionalFrm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
/// <summary>
|
|
/// 单据入口参数模型
|
|
/// </summary>
|
|
public DynamicPubAccraditionPopModel SysModel;
|
|
/// <summary>
|
|
/// 选中行
|
|
/// </summary>
|
|
public DataRow item;
|
|
/// <summary>
|
|
/// <para>说明:初始化控件/para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2018-01-09</para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void InitControl(DynamicPubAccraditionPopModel sysModel, DataRow dr)
|
|
{
|
|
WaitForm.ShowForm();
|
|
try
|
|
{
|
|
this.SysModel = sysModel;
|
|
this.item = dr;
|
|
BindTab();
|
|
BindTabData();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
|
|
}
|
|
finally
|
|
{
|
|
// 加载完统一显示控件
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:绑定选项卡</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-04-15 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void BindTab()
|
|
{
|
|
this.tcTabs.Model = this.SysModel;
|
|
this.tcTabs.InitTabPages(GetTabDetails());
|
|
this.tcTabs.OnRightCallback += new EventHandler(AuditTab_OnRightCallback);
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:单据右键菜单执行后刷新Tab标签数据</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-04-15 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
|
protected void AuditTab_OnRightCallback(object sender, EventArgs e)
|
|
{
|
|
GridDetailModel model = this.tcTabs.GetFocusTabPageGridDetailModel();
|
|
string sqlValue = ReplaceHelper.ReplaceRowParam(item, model.DetailSql);
|
|
|
|
this.tcTabs.SetGridDataSource(MainImpl.GetDataTableResult(sqlValue));
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:绑定tabs的数据源</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-04-15</para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void BindTabData()
|
|
{
|
|
foreach (XtraTabPage tabPage in this.tcTabs.TabControlObj.TabPages)
|
|
{
|
|
GridDetailModel model = this.tcTabs.GetGridDetailModel(tabPage);
|
|
string sqlValue = ReplaceHelper.ReplaceRowParam(item, model.DetailSql);
|
|
|
|
this.tcTabs.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(sqlValue));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:获取选项卡数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-15 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <returns>List<GridDetailModel>.</returns>
|
|
private List<GridDetailModel> GetTabDetails()
|
|
{
|
|
List<GridDetailModel> details = new List<GridDetailModel>();
|
|
DataTable table = BaseAuditImpl.GetAttachTabs(this.SysModel.ModuleCode, this.SysModel.StepCode);
|
|
|
|
foreach (DataRow item in table.Rows)
|
|
{
|
|
DataTable dtGridColumns = BaseAuditImpl.GetBottomBasicInformation(item["formKey"] + "");
|
|
details.Add(new GridDetailModel(item, dtGridColumns, GridCustomColumnStruct.AuditPopupDetailGridView + item["formKey"] + ""));
|
|
}
|
|
return details;
|
|
}
|
|
}
|
|
} |