ab56a9bcf7
SVN-Revision: r240
110 lines
3.7 KiB
C#
110 lines
3.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Lskj.Model;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Business.Impl;
|
|
using DevExpress.XtraEditors;
|
|
|
|
namespace Lskj.ProductBarCode
|
|
{
|
|
public partial class addControl : UserControl
|
|
{
|
|
/// <summary>
|
|
/// 查询条件
|
|
/// </summary>
|
|
private DataTable _controlTable = new DataTable();
|
|
/// <summary>
|
|
/// 系统模块实体对象
|
|
/// </summary>
|
|
/// <value>The system model.</value>
|
|
public ModuleModel SysModel { get; private set; }
|
|
/// <summary>
|
|
/// 控件对象
|
|
/// </summary>
|
|
public MyControl ControlObj { get; private set; }
|
|
/// <summary>
|
|
/// 调用动态链接库默认传递参数对象
|
|
/// </summary>
|
|
public DynamicModel Model { get; private set; }
|
|
/// <summary>
|
|
/// 添加条码条件
|
|
/// </summary>
|
|
public string addbtnSql;
|
|
/// <summary>
|
|
/// 添加按钮回调sql
|
|
/// </summary>
|
|
public string addCellSql;
|
|
/// <summary>
|
|
/// 点击增加条码触发事件
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
public event EventHandler OnAddGridCallback;
|
|
public addControl()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:创建界面</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-09-12 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="menuCode">The menu code.</param>
|
|
public void InitControls(DynamicModel model,string addbtnSql)
|
|
{
|
|
this.Model = model;
|
|
this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
|
|
this.ControlObj = new MyControl();
|
|
this.ControlObj = new MyControl(this.SysModel.MenuSql, null);
|
|
this._controlTable = BaseModuleImpl.GetControlLocation(this.SysModel.FormKey, this.Model.ModuleCode);
|
|
this.ControlObj.InitControl(this._controlTable, this.panelMain, BaseModuleImpl.GetAddGroupData(this.SysModel.FormKey));
|
|
this.btn_add.Click += new EventHandler(OnAddBtnClick);
|
|
this.addbtnSql = addbtnSql;
|
|
}
|
|
/// <summary>
|
|
/// 增加条码事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
public void OnAddBtnClick(object sender, EventArgs e)
|
|
{
|
|
addCellSql = this.ControlObj.ReplaceControlValue(addbtnSql);
|
|
if (OnAddGridCallback != null)
|
|
{
|
|
this.OnAddGridCallback(sender, e);
|
|
}
|
|
}
|
|
#region 初始化属性
|
|
/// <summary>
|
|
/// <para>说明:隐藏搜索</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-01-09</para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void HideControls()
|
|
{
|
|
foreach (System.Windows.Forms.Control control in this.panelMain.Controls)
|
|
{
|
|
if (control is SimpleButton)
|
|
{
|
|
SimpleButton simpleButton = control as SimpleButton;
|
|
simpleButton.Visible = false;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|