using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; using Mesnac.Controls.Base; using System.Data; using System.Drawing.Design; using System.Drawing; namespace Mesnac.Controls.Default { [ToolboxBitmap(typeof(PerformanceCounter))] public partial class MCReport : FastReport.Report, IPurviewControl { #region 字段定义 private bool _isValid = true; //保存有效性 private bool _isEventValid = true; //保存事件有效性 #endregion #region 构造方法 public MCReport() { InitializeComponent(); } public MCReport(IContainer container) { container.Add(this); InitializeComponent(); } #endregion #region 接口成员实现 public string MCKey { get; set; } private string _filePath; /// /// 报表文件 /// [DefaultValue("")] [Editor(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] [Description("报表路径"), Category("Data")] public string FilePath { get { return _filePath; } set { _filePath = value; } } private string _sourceName = String.Empty; /// /// 数据源名称 /// [Description("数据源名称"), Category("Data")] public string SourceName { get { return _sourceName; } set { _sourceName = value; } } public object MCValue { get { return this.GetDataSource(this.SourceName); } set { this.RegisterData(value == null ? new DataTable() : (DataTable)value, this.SourceName); } } public IBaseControl MCRoot { get { return null; } set { ; } } [TypeConverter(typeof(DataSourceConverter))] [Description("数据连接"), Category("Data")] public string MCDataSourceID { get; set; } public MCDataSource MCDataSource { get; set; } [Description("是否为数据库控件"), Category("Data")] public bool IsDbControl { get; set; } [Description("初始化SQL"), Category("Data")] public string InitDataSource { get; set; } [Description("执行SQL"), Category("Data")] public string ActionDataSource { get; set; } [Description("绑定数据源"), Category("Data")] public object BindDataSource { get; set; } [Description("操作类型"), Category("Data")] public DbOptionTypes DbOptionType { get; set; } public bool MCVisible { get; set; } public bool MCEnabled { get; set; } public bool MCPurview { get; set; } public bool IsValid { get { return _isValid; } set { _isValid = value; } } public bool IsEventValid { get { return this._isEventValid; } set { this._isEventValid = value; } } #endregion } }