Files
cyf ab56a9bcf7 基线 SVN r240
SVN-Revision: r240
2025-02-06 06:46:06 +00:00

105 lines
3.9 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.Control.Model;
using Lskj.Util;
using Lskj.Business.Impl;
using Lskj.Data;
using Lskj.Model;
namespace Lskj.BaseSelect
{
public partial class FrmMain : BaseForm
{
public string ParmaryKey;
public DataTable QueryTable = new DataTable();
public DataTable GridColumns = new DataTable();
public MyControl SearchObj = new MyControl();
public DynamicBaseSelectModel Model;
/// <summary>
/// 系统模块实体对象
/// </summary>
/// <value>The system model.</value>
public ModuleModel SysModel { get; private set; }
public FrmMain()
{
InitializeComponent();
}
/// <summary>
/// <para>说明:初始化</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期: </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
{
DataRow modelRow = MainImpl.GetSystemdllTab(this.Model.ModuleCode);
if (modelRow == null)
{
MessageUtil.Show("模块编号[" + this.Model.ModuleCode + "],配置错误!\r\n该模块信息未找到!");
return;
}
this.lblTotal.Text = Model.AmountValue;
this.SysModel = new ModuleModel(modelRow);
this.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
this.QueryTable = BaseModuleImpl.GetCustomQueryFields(this.SysModel.CondKey);
this.GridColumns = BaseModuleImpl.GetBaseGridColumns(this.Model.ModuleCode);
this.SearchObj = new MyControl(this.SysModel.MenuSql, gcMain, null, null, null);
this.PlSearch.Height = this.SearchObj.InitSearchControl(QueryTable, this.PlSearch);
if (this.QueryTable == null || this.QueryTable.Rows.Count > 0)
{
this.PlSearch.Visible = false;
}
this.gcMain.SetEditColumns(this.GridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);
this.gcMain.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(this.Model.ModuleCode));
this.gcMain.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(this.Model.ModuleCode), this.Model, OnGridViewRightCallBack, this.SearchObj, null);
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex, ResourceKeys.BaseModule);
//MessageUtil.Show(ex.Message + "\r\n" + ex.StackTrace);
throw;
}
WaitForm.HideForm();
}
/// <summary>
/// <para>说明:右键菜单执行后刷新数据,刷新规则按照上一次查询条件刷新</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-11-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected void OnGridViewRightCallBack(object sender, EventArgs e)
{
this.SearchObj.SearchLastGrid();
}
}
}