ab56a9bcf7
SVN-Revision: r240
116 lines
4.5 KiB
C#
116 lines
4.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Lskj.Control;
|
|
using Lskj.Model;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Util;
|
|
using Lskj.Data;
|
|
|
|
|
|
namespace Lskj.PubChart
|
|
{
|
|
public partial class FrmMain : BaseForm
|
|
{
|
|
public DynamicPubchartModel PubchartModel;
|
|
/// <summary>
|
|
/// 系统模块实体对象
|
|
/// </summary>
|
|
/// <value>The system model.</value>
|
|
public ModuleModel SysModel { get; private set; }
|
|
/// <summary>
|
|
/// 控件数据源
|
|
/// </summary>
|
|
private DataTable _controlTable;
|
|
/// <summary>
|
|
/// 查询条件
|
|
/// </summary>
|
|
private DataTable _queryTable = new DataTable();
|
|
/// <summary>
|
|
/// 控件对象
|
|
/// </summary>
|
|
public MyControl SearchObj { get; private set; }
|
|
/// <summary>
|
|
/// 数据源
|
|
/// </summary>
|
|
private DataTable dtData;
|
|
public FrmMain()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:窗体加载时</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-09-01 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected override void OnLoad(EventArgs e)
|
|
{
|
|
WaitForm.ShowForm();
|
|
try
|
|
{
|
|
this.PubchartModel.Privilege = this.PubchartModel.Privilege.Equals("3") ? "1" : PubchartModel.ModuleId > 0 ? BaseImpl.GetUserPurviewsByMenuId(PubchartModel.ModuleId + "") + "" : BaseImpl.GetUserPurviewsByMenuCode(PubchartModel.ModuleCode) + "";
|
|
this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.PubchartModel.ModuleCode));
|
|
this._queryTable = BaseModuleImpl.GetCustomQueryFields(this.SysModel.CondKey);
|
|
this.SearchObj = new MyControl(this.SysModel.MenuSql, this.chartControlEx.GridControlObj);
|
|
this.pl_right_where.Height = this.SearchObj.InitSearchControl(_queryTable, this.pl_right_where, null);
|
|
this.SearchObj.OnSearchAfterCallBack += new EventHandler(OnSearchAfter);
|
|
DataTable gridColumn = BaseModuleImpl.GetBaseGridColumns(this.PubchartModel.ModuleCode);
|
|
this.chartControlEx.PanelControlObj.Visible = true;
|
|
this.chartControlEx.GridControlObj.GridView.OptionsView.ColumnAutoWidth = true;
|
|
this.chartControlEx.GridControlObj.SetEditColumns(gridColumn);
|
|
this.chartControlEx.GridControlObj.gridControl.DataSource = dtData;
|
|
this.chartControlEx.SetCharts(BaseModuleImpl.GetChartParams(SysModel.FormKey));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex, ResourceKeys.ChartModel);
|
|
//MessageUtil.Show(ex.Message + "\r\n" + ex.StackTrace);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
|
this.chartControlEx.Visible = true;
|
|
}
|
|
|
|
WaitForm.HideForm();
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:查询条件执行后</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2019-11-13 </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 OnSearchAfter(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
dtData = this.chartControlEx.GridControlObj.gridControl.DataSource as DataTable;
|
|
this.chartControlEx.CreateChart(dtData);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|