protected override void OnLoad(EventArgs e)
        {
            try
            {
                this.operDept = ((Neusoft.HISFC.Models.Base.Employee) this.drugStoreManager.Operator).Dept;

                this.DataInit();

                //{9FA792B0-A60F-48d8-A3F5-1C52450C44A5} 获取打印类型 取消原代码 需在报表接口维护内对实现进行配置
                object factoryInstance = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory)) as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory;
                if (factoryInstance != null)
                {
                    this.factory = factoryInstance as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory;
                }

                this.cmbQueryType.DropDownStyle         = ComboBoxStyle.DropDownList;
                this.cmbQueryType.SelectedIndexChanged += new EventHandler(cmbQueryType_SelectedIndexChanged);
            }
            catch
            { }

            base.OnLoad(e);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //不写这句话窗口无法最大化
            this.WindowState = FormWindowState.Maximized;

            try
            {
                //控制参数管理类
                Neusoft.HISFC.BizProcess.Integrate.Common.ControlParam ctrlIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Common.ControlParam();

                object factoryInstance = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory)) as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory;
                if (factoryInstance != null)
                {
                    Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory factory = factoryInstance as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory;

                    Neusoft.HISFC.Components.DrugStore.Function.IDrugPrint = factory.GetInstance(this.Terminal);

                    if (Neusoft.HISFC.Components.DrugStore.Function.IDrugPrint == null)
                    {
                        this.isCancel = true;
                    }
                }
                else
                {
                    //默认不进行提示
                    //MessageBox.Show("未配置处方单打印的实现,将无法进行处方单据打印", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    this.isCancel = true;

                    //#region 反射读取标签格式

                    //try
                    //{
                    //    #region 标签/清单打印 接口实现

                    //    object[] o = new object[] { };
                    //    string factoryValue = ctrlIntegrate.GetControlParam<string>(Neusoft.HISFC.BizProcess.Integrate.PharmacyConstant.Clinic_Print_Label, true, "Neusoft.Report.DrugStore.OutpatientBillPrint");

                    //    System.Runtime.Remoting.ObjectHandle objHandel = System.Activator.CreateInstance("Report", factoryValue, false, System.Reflection.BindingFlags.CreateInstance, null, o, null, null, null);
                    //    object oLabel = objHandel.Unwrap();

                    //    Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory factory = oLabel as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory;
                    //    if (factory != null)
                    //    {
                    //        Neusoft.HISFC.Components.DrugStore.Function.IDrugPrint = factory.GetInstance(this.Terminal);
                    //    }

                    //    if (Neusoft.HISFC.Components.DrugStore.Function.IDrugPrint == null)
                    //    {
                    //        this.isCancel = true;
                    //    }

                    //    #endregion

                    //}
                    //catch (System.TypeLoadException ex)
                    //{
                    //    Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                    //    MessageBox.Show(Language.Msg("标签命名空间无效\n" + ex.Message));
                    //    this.isCancel = true;
                    //    return;
                    //}

                    //#endregion
                }

                object interfacePrint = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.Pharmacy.IDrugPrint)) as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IDrugPrint;
                if (interfacePrint != null)
                {
                    Neusoft.HISFC.Components.DrugStore.Outpatient.ucClinicDrug.RecipePrint = interfacePrint as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IDrugPrint;

                    if (Neusoft.HISFC.Components.DrugStore.Outpatient.ucClinicDrug.RecipePrint == null)
                    {
                        this.isCancel = true;
                    }
                }
                else
                {
                    //默认不进行提示
                    //MessageBox.Show("未配置处方单打印的实现,将无法进行处方单据打印", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    this.isCancel = true;

                    //#region 门诊处方打印接口实现

                    //object[] o1 = new object[] { };
                    ////门诊处方打印接口类实现
                    //string recipeValue = ctrlIntegrate.GetControlParam<string>(Neusoft.HISFC.BizProcess.Integrate.PharmacyConstant.Clinic_Print_Recipe, true, "Report.Order.ucRecipePrint");

                    ////处方
                    //System.Runtime.Remoting.ObjectHandle objHandel1 = System.Activator.CreateInstance("Report", recipeValue, false, System.Reflection.BindingFlags.CreateInstance, null, o1, null, null, null);
                    //object oLabel1 = objHandel1.Unwrap();

                    //Neusoft.HISFC.Components.DrugStore.Outpatient.ucClinicDrug.RecipePrint = oLabel1 as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IDrugPrint;

                    //if (Neusoft.HISFC.Components.DrugStore.Outpatient.ucClinicDrug.RecipePrint == null)
                    //{
                    //    this.isCancel = true;
                    //}

                    //#endregion
                }

                //控件初始化 需先调用完本窗口初始化信息后再调用控件初始化
                this.ucClinicTree1.Init();
                this.ucClinicDrug1.Init();

                //列表初始化刷新
                this.ucClinicTree1.RefreshOperList(true);
                //大屏幕显示接口启动 发药窗口使用
                if (this.funMode == Neusoft.HISFC.Components.DrugStore.OutpatientFun.Send || this.funMode == Neusoft.HISFC.Components.DrugStore.OutpatientFun.DirectSend)
                {
                    if (this.ucClinicTree1.IsShowFeeData)
                    {
                        this.ucClinicTree1.BeginLEDRefresh(true);
                    }
                }

                //间隔2秒后启动自动刷新程序 如果立刻启动 那么大量单据待打印时会造成打开窗口长时间延迟
                //类似死机(用打印命令方式打印标签时会出现)
                if (!this.tsbRefreshWay.Checked)
                {
                    this.ucClinicTree1.BeginProcessRefresh(2000);
                }

                this.ucClinicTree1.SetFocus();

                //屏蔽暂停按钮
                this.tsbPause.Visible = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.isCancel = true;
            }
        }
Beispiel #3
0
        /// <summary>
        /// 打印初始化
        /// </summary>
        protected virtual void PrintInit()
        {
            object factoryInstance = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory)) as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory;

            if (factoryInstance != null)
            {
                Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory factory = factoryInstance as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IOutpatientPrintFactory;

                this.printFactory = factory;

                if (this.printFactory == null)
                {
                    MessageBox.Show("未配置单据打印的实现,将无法进行配药单据打印", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (this.OperTerminal == null || string.IsNullOrEmpty(this.OperTerminal.ID))
                {
                    return;
                }

                Neusoft.HISFC.Components.DrugStore.Function.IDrugPrint = factory.GetInstance(this.OperTerminal);
            }

            if (Neusoft.HISFC.Components.DrugStore.Function.IDrugPrint == null)
            {
                MessageBox.Show("未配置单据打印的实现,将无法进行配药单据打印", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            return;

            //#region 反射读取标签格式

            ////string dllName = "Report";
            //string className = "Report.DrugStore.ucRecipeLabel";

            ////门诊标签打印接口实现类
            //Neusoft.HISFC.BizProcess.Integrate.Common.ControlParam ctrlIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Common.ControlParam();
            //string labelValue = ctrlIntegrate.GetControlParam<string>(Neusoft.HISFC.BizProcess.Integrate.PharmacyConstant.Clinic_Print_Label, true, "Report.DrugStore.ucRecipeLabel");
            ////门诊草药打印接口实现类
            //string billValue = ctrlIntegrate.GetControlParam<string>(Neusoft.HISFC.BizProcess.Integrate.PharmacyConstant.Clinic_Print_Bill, true, "Report.DrugStore.ucOutHerbalBill");

            ////默认标签打印
            //className = labelValue;
            ////读取本地控制参数 判断是否采用草药打印方式
            //string strErr = "";
            //ArrayList alParm = Neusoft.FrameWork.WinForms.Classes.Function.GetDefaultValue("ClinicDrug", "PrintList", out strErr);
            //if (alParm != null && alParm.Count > 0)
            //{
            //    if ((alParm[0] as string) == "1")
            //    {
            //        className = billValue;
            //        this.isHerbalPrint = true;
            //    }
            //}

            //object[] o = new object[] { };

            //try
            //{
            //    System.Runtime.Remoting.ObjectHandle objHandel = System.Activator.CreateInstance("Report", className, false, System.Reflection.BindingFlags.CreateInstance, null, o, null, null, null);
            //    object oLabel = objHandel.Unwrap();

            //    Neusoft.HISFC.Components.DrugStore.Function.IDrugPrint = oLabel as Neusoft.HISFC.BizProcess.Interface.Pharmacy.IDrugPrint;

            //}
            //catch (System.TypeLoadException ex)
            //{
            //    Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
            //    MessageBox.Show(Language.Msg("标签命名空间无效\n" + ex.Message));
            //}

            //#endregion
        }