Esempio n. 1
0
        /// <summary>
        /// 设置接口实例
        /// </summary>
        private void GetInterface()
        {
            this.Clear();

            //通过反射方式读取Factory文件 这样 可以将 Factory与其他相关的类型文件全部挪出UFC 实现自定义

            MatFactory factory = new MatFactory();

            this.IManager = factory.GetApplyInstance(this.PrivType, this);

            if (this.IManager == null)
            {
                System.Windows.Forms.MessageBox.Show("根据申请类别获取对应接口实例失败");
                return;
            }

            this.neuSpread1_Sheet1.DataAutoSizeColumns = false;

            this.neuSpread1_Sheet1.DataSource = null;
            //为了实现过滤 赋值DefaultView
            DataTable dtTemp = this.IManager.InitDataTable();

            if (dtTemp != null)
            {
                this.neuSpread1_Sheet1.DataSource = dtTemp.DefaultView;
            }
            else
            {
                this.neuSpread1_Sheet1.DataSource = dtTemp;
            }

            this.IManager.SetFormat();                          //格式化

            this.IManager.SetFocusSelect();                     //焦点设置

            this.neuPanel1.SuspendLayout();
            this.neuPanel3.SuspendLayout();
            this.neuPanel4.SuspendLayout();
            this.panelItemSelect.SuspendLayout();
            this.SuspendLayout();

            this.AddItemInputUC(this.IManager.InputModualUC);

            this.neuPanel1.ResumeLayout();
            this.neuPanel3.ResumeLayout();
            this.neuPanel4.ResumeLayout();
            this.panelItemSelect.ResumeLayout();
            this.ResumeLayout();
        }
Esempio n. 2
0
        /// <summary>
        /// 设置接口实例
        /// </summary>
        private void GetInterface()
        {
            this.Clear();

            //通过反射方式读取Factory文件 这样 可以将 Factory与其他相关的类型文件全部挪出UFC 实现自定义
            //.


            ////入库界面 对于申请权限的会报错...
            //if (this.PrivType.Memo == "13" || this.PrivType.Memo == "18")
            //{
            //    this.PrivType.Memo = "11";
            //    this.PrivType.Name = "一般入库";
            //}
            //..


            //{9E7FB328-89B3-4f43-A417-2EC3ACFC7093}
            //先释放掉事件资源
            if (this.IManager != null)
            {
                this.IManager.Dispose();
            }

            if (this.matFactory == null)
            {
                this.matFactory = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.Components.Material.IFactory)) as Neusoft.HISFC.Components.Material.IFactory;
            }

            if (this.matFactory == null)
            {
                MatFactory factory = new MatFactory();
                this.matFactory = factory as Neusoft.HISFC.Components.Material.IFactory;
            }
            this.IManager = this.matFactory.GetInInstance(this.PrivType, this);

            if (this.IManager == null)
            {
                System.Windows.Forms.MessageBox.Show("根据入库类别获取对应接口实例失败");
                return;
            }

            this.neuSpread1_Sheet1.DataAutoSizeColumns = false;

            this.neuSpread1_Sheet1.DataSource = null;
            //为了实现过滤 赋值DefaultView
            DataTable dtTemp = this.IManager.InitDataTable();

            if (dtTemp != null)
            {
                this.neuSpread1_Sheet1.DataSource = dtTemp.DefaultView;
            }
            else
            {
                this.neuSpread1_Sheet1.DataSource = dtTemp;
            }

            this.IManager.SetFormat();                          //格式化

            this.IManager.SetFocusSelect();                     //焦点设置

            this.neuPanel1.SuspendLayout();
            this.neuPanel3.SuspendLayout();
            this.neuPanel4.SuspendLayout();
            this.panelItemSelect.SuspendLayout();
            this.SuspendLayout();

            this.AddItemInputUC(this.IManager.InputModualUC);

            this.neuPanel1.ResumeLayout();
            this.neuPanel3.ResumeLayout();
            this.neuPanel4.ResumeLayout();
            this.panelItemSelect.ResumeLayout();
            this.ResumeLayout();
        }