using System; using System.Collections.Generic; using System.Linq; using System.Text; using Lskj.Util; using Lskj.Business; using System.Windows.Forms; using Lskj.Model; using Lskj.Business.Impl; using Lskj.Control; namespace Lskj.Report { /// /// c#库被调用统一接口类 /// public sealed class DllBaseClass : IForm { public DllBaseClass() { } public DllBaseClass(string[] obj) { try { DynamicReportModel reportModel = new DynamicReportModel(obj); //int formType = ReportImpl.GetBaseType(reportModel.ModuleCode); GridEnum gridEnum = GridEnum.GridView; //if (formType == 1) gridEnum = GridEnum.BandedGridView; //if (formType == 2) gridEnum = GridEnum.TreeListGridView; FrmMain mainForm = new FrmMain(); //mainForm.Model = reportModel; //mainForm.Model.GridEnumObj = gridEnum; //this.SubForm = mainForm; //判断是否存在存储过程 string results = BaseImpl.GetResult("IF EXISTS(SELECT *FROM SYSOBJECTS WHERE NAME ='p_Get_NewDesignPlatform_BasicFile' AND TYPE = 'P') begin select 1 end else Begin select 2 end").ToString(); if (results.Equals("1") && SystemInfo.Instance.isExecload) { int formType; int _errCode; System.Data.DataSet dsConfig = ReportImpl.GetNewDesignPlatform(reportModel.ModuleId, reportModel.ModuleCode, Lskj.Data.ResourceKeys.SettingTableName, out formType, out _errCode); Lskj.Data.Caches.CacheSYSConfig.Instance().BaseType = formType; Lskj.Data.Caches.CacheSYSConfig.Instance().ErrCode = _errCode; Lskj.Data.Caches.CacheSYSConfig.Instance().SetData(dsConfig); if (formType == 1) gridEnum = GridEnum.BandedGridView; if (formType == 2) gridEnum = GridEnum.TreeListGridView; // 基础档案暂时注释GridEnum.TreeListGridView此类型,TrcReport和手机端显示卡片冲突. mainForm.Model = reportModel; mainForm.Model.GridEnumObj = gridEnum; this.SubForm = mainForm; } else { int formType = ReportImpl.GetBaseType(reportModel.ModuleCode); if (formType == 1) gridEnum = GridEnum.BandedGridView; if (formType == 2) gridEnum = GridEnum.TreeListGridView; mainForm.Model = reportModel; mainForm.Model.GridEnumObj = gridEnum; this.SubForm = mainForm; } } catch (Exception ex) { MessageUtil.Show(ex); LogHelper.Instance.WriteError(ex); LogUtil.WriteError("Lskj.Report.dll--参数错误-->" + obj.ToString(), ex); } } /// /// 窗口 /// public Form SubForm { get; set; } } }