private IBizDataItems GetDataItem(string moduleName, ActionItem ai, string requestDataName)
        {
            IBizDataItems dataItems = null;

            if (ai.IsParentModuleData)
            {
                if (_dataTransCenter.ParentDataCenter == null)
                {
                    return(null);
                }
                //查询父级窗口中的数据
                dataItems = _dataTransCenter.ParentDataCenter.GetBizDataQuery(requestDataName);
            }
            else
            {
                dataItems = _dataTransCenter.GetBizDataQuery(requestDataName);
            }

            if (dataItems == null)
            {
                MessageBox.Show("(" + moduleName + "." + ai.ActName + ")未找到所请求的数据,请求数据为 [" + requestDataName + "]。", "提示");
                return(null);
            }

            if (dataItems.Count <= 0)
            {
                MessageBox.Show("(" + moduleName + "." + ai.ActName + ")未找到对应的数据项,请求数据为 [" + requestDataName + "]。", "提示");
                return(null);
            }

            return(dataItems);
        }
Esempio n. 2
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case DataViewActionDefine.LoadData:
                    if (bizDatas == null)
                    {
                        return(false);
                    }

                    _curBizDatas = bizDatas;

                    dataViewLayout1.BindDataView(_dbQuery, _dataViewDesign.DataFrom, _dataViewDesign.DBSourceAlias);

                    return(true);


                default:
                    break;
                }

                return(true);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
        private string ParseExecuteTag(string tag, IBizDataItems bizDatas)
        {
            string context = tag;

            if (bizDatas != null)
            {
                IList <string> pars = GetParsName(context);

                if (bizDatas.Count > 0)
                {
                    foreach (string par in pars)
                    {
                        context = context.Replace("[@" + par + "]", bizDatas[0][par].ToString());
                    }
                }
                else
                {
                    foreach (string par in pars)
                    {
                        context = context.Replace("[@" + par + "]", "null");
                    }
                }
            }

            return(context);
        }
Esempio n. 4
0
        private void tsbDebug_Click(object sender, EventArgs e)
        {
            try
            {
                IBizDataItems bizDatas = null;

                Runner run = new Runner();

                run.Init("DEBUG", "0", null, null, null, null, null, null);

                BehindCodeItem bci = new BehindCodeItem();
                bci.FuncName     = tbName.Text;
                bci.FuncContext  = rtbContext.Text;
                bci.ThridDBAlias = cbxDBAlias.Text;
                bci.VerNo        = string.IsNullOrEmpty(txtVer.Text) ? 0 : Convert.ToInt32(txtVer.Text);
                bci.IsBGCompile  = false;

                run.Run(bci, "", null, sender, e, "验证", null, null, out bizDatas, false);

                MessageBox.Show("验证成功。", "提示");
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Esempio n. 5
0
        protected void SetDataToAttach(IBizDataItems attachDatas)
        {
            //检索当前模块所提供的数据,并附加到attachdatas属性中
            foreach (string dataNmae in _provideDataDesc.Keys)
            {
                IBizDataItems bizAttachDatas = QueryDatas(dataNmae);

                attachDatas.AttachDatas.Add(bizAttachDatas);
            }
        }
Esempio n. 6
0
        public bool Run(BehindCodeItem compileCode, string callModuleName, ISysDesign callModule, object sender, object eventArgs, string actName, string actTag,
                        IBizDataItems sourceBizDatas, out IBizDataItems processBizDatas, bool isBuffer = true)
        {
            processBizDatas = null;

            if (_compilerObj == null)
            {
                _compilerObj = new Dictionary <string, IRunner>();
            }

            if (_isAllowDebug)
            {
                _compilerObj.Remove(compileCode.FuncName);
            }

            IRunner runner = null;

            if (_compilerObj.ContainsKey(compileCode.FuncName))
            {
                runner = _compilerObj[compileCode.FuncName];
            }
            else
            {
                runner = CompilerCode(compileCode);

                if (isBuffer && _isAllowDebug == false)
                {
                    //缓存编译对象
                    //调试状态不缓存编译对象
                    _compilerObj.Add(compileCode.FuncName, runner);
                }
            }

            if (runner != null)
            {
                IDBQuery thridDb = null;

                if (string.IsNullOrEmpty(compileCode.ThridDBAlias) == false)
                {
                    string strErr = "";
                    thridDb = SqlHelper.GetThridDBHelper(compileCode.ThridDBAlias, _dbHelper, ref strErr);
                    if (thridDb == null)
                    {
                        MessageBox.Show("动态方法 [" + compileCode.FuncName + "] 对应的数据源 [" + compileCode.ThridDBAlias + "] 链接对象创建失败," + strErr, "提示");
                        return(false);
                    }
                }

                runner.Init(_winRelateModules, _dbHelper, thridDb, _userData, _stationInfo, _dataTransCenter, _owiner);
                return(runner.Run(callModuleName, callModule, sender, eventArgs, actName, actTag, sourceBizDatas, out processBizDatas));
            }

            return(false);
        }
Esempio n. 7
0
        static public IBizDataItems GetDataItem(IBizDataTransferCenter transferCenter, string action, string moduleName, string dataName)
        {
            IBizDataItems dataItems = transferCenter.GetBizDataQuery(dataName);

            if (dataItems == null)
            {
                MessageBox.Show("(" + moduleName + "." + action + ")未找到所请求的数据,请求数据为 [" + dataName + "]。", "提示");
                return(null);
            }

            if (dataItems.Count <= 0)
            {
                MessageBox.Show("(" + moduleName + "." + action + ")未找到对应的数据项,请求数据为 [" + dataName + "]。", "提示");
                return(null);
            }

            return(dataItems);
        }
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                _returnData = null;

                if (_dbHelpers == null)
                {
                    _dbHelpers = new Dictionary <string, IDBQuery>();

                    foreach (DataOperItem doi in _dataOperDesign.DataOperItems)
                    {
                        if (_dbHelpers.ContainsKey(doi.DBAlias))
                        {
                            continue;
                        }

                        string   strErr        = "";
                        IDBQuery thridDbHelper = null;

                        thridDbHelper = SqlHelper.GetThridDBHelper(doi.DBAlias, _dbQuery, ref strErr);

                        if (thridDbHelper == null)
                        {
                            MessageBox.Show("数据处理项 [" + doi.ItemName + "] 对应数据源实例化失败:" + strErr, "提示");
                            return(false);
                        }

                        _dbHelpers.Add(doi.DBAlias, thridDbHelper);
                    }
                }

                _curBizData = null;
                if (bizDatas != null)
                {
                    _curBizData = bizDatas[0] as BizDataItem;
                }

                IDBQuery curDBHelper = null;

                switch (actName)
                {
                case DataOperActionDefine.RunProcess:

                    _returnData = new BizDataItems();

                    BizDataItem returnItem = new BizDataItem();

                    if (string.IsNullOrEmpty(tag))
                    {
                        using (TransactionScope ts = new TransactionScope())
                        {
                            foreach (DataOperItem doi in _dataOperDesign.DataOperItems)
                            {
                                if (string.IsNullOrEmpty(doi.DBAlias))
                                {
                                    curDBHelper = _dbQuery;
                                }
                                else
                                {
                                    curDBHelper = _dbHelpers[doi.DBAlias];
                                }

                                DataTable dtResult = SqlHelper.GetDataSource(doi.ProcessContext, curDBHelper, QueryParValueEvent);

                                returnItem.Add(doi.ReturnName, dtResult);
                            }

                            ts.Complete();
                        }
                    }
                    else
                    {
                        int index = _dataOperDesign.DataOperItems.FindIndex(T => T.ItemName == tag);
                        if (index < 0)
                        {
                            MessageBox.Show("未找到指定处理项的配置信息。", "提示");
                            return(false);
                        }

                        DataOperItem doiProcess = _dataOperDesign.DataOperItems[index];

                        if (string.IsNullOrEmpty(doiProcess.DBAlias))
                        {
                            curDBHelper = _dbQuery;
                        }
                        else
                        {
                            curDBHelper = _dbHelpers[doiProcess.DBAlias];
                        }

                        DataTable dtResult = SqlHelper.GetDataSource(doiProcess.ProcessContext, curDBHelper, QueryParValueEvent);

                        returnItem.Add(doiProcess.ReturnName, dtResult);
                    }

                    _returnData.Add(returnItem);

                    return(true);

                default:
                    break;
                }

                return(true);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 9
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case ButActionDefine.DoClick:
                    return(DoClick(sender));

                default:
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 10
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case TestActionDefine.CreateTestData:
                    if (_localDatas == null || _localDatas.Count <= 0)
                    {
                        _localDatas = new List <TestDataItem>(_designDatas);
                    }

                    string localDatas = ConstructorData(_localDatas);

                    AppSetting.WriteSetting(this.Name, localDatas);

                    return(true);

                default:
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                _curBizDatas = null;

                switch (actName)
                {
                case DataConvertActionDefine.RunConvert:
                    if (bizDatas == null || bizDatas.Count <= 0)
                    {
                        return(false);
                    }

                    _curBizDatas = bizDatas as BizDataItems;

                    BizDataItem curbizData = _curBizDatas[0] as BizDataItem;

                    foreach (DataConvertItem dci in _dataConvertDesign.ConvertItems)
                    {
                        if (curbizData.ContainsKey(dci.SourceName))
                        {
                            object value        = curbizData[dci.SourceName];
                            object convertValue = null;

                            curbizData.Remove(dci.SourceName);

                            switch (dci.ConvertType)
                            {
                            case "Int16":
                                if (value != null)
                                {
                                    convertValue = Convert.ToInt16(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Int32":
                                if (value != null)
                                {
                                    convertValue = Convert.ToInt32(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Int64":
                                if (value != null)
                                {
                                    convertValue = Convert.ToInt64(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Double":
                                if (value != null)
                                {
                                    convertValue = Convert.ToDouble(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Single":
                                if (value != null)
                                {
                                    convertValue = Convert.ToSingle(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Decimal":
                                if (value != null)
                                {
                                    convertValue = Convert.ToDecimal(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "String":
                                if (value != null)
                                {
                                    convertValue = Convert.ToString(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "DateTime":
                                if (value != null)
                                {
                                    convertValue = Convert.ToDateTime(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Boolean":
                                if (value != null)
                                {
                                    convertValue = Convert.ToBoolean(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Byte":
                                if (value != null)
                                {
                                    convertValue = Convert.ToByte(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;

                            case "Char":
                                if (value != null)
                                {
                                    convertValue = Convert.ToChar(value);
                                }
                                curbizData.Add(dci.ConvertName, convertValue);
                                break;


                            default:
                                break;
                            }
                        }
                    }

                    return(true);

                default:
                    break;
                }

                return(true);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 12
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            switch (actName)
            {
            case PedalActionDefine.PedalConfig:    //检查刷新
                bool isOk = ShowPedalConfig(_pc);

                if (isOk)
                {
                    OpenPedal();
                }

                return(isOk);

            default:
                return(false);
            }
        }
Esempio n. 13
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            switch (actName)
            {
            case HistoryActionDefine.LoadHistory:    //载入历史

                if (bizDatas == null)
                {
                    return(false);
                }

                _applyId = DataHelper.GetItemValueByApplyId(bizDatas[0]);

                if (string.IsNullOrEmpty(_applyId))
                {
                    MessageBox.Show("未检索到对应的申请ID,请求数据项名称为 [" + bizDatas.DataName + "]。", "提示");
                    return(false);
                }

                LoadHistory(_applyId);

                break;

            case HistoryActionDefine.ReportPreview:
                if (_preview == null)
                {
                    MessageBox.Show("报告尚未加载,不能进行预览。", "提示");
                    return(false);
                }

                _preview.preview();

                break;

            case HistoryActionDefine.TextSend:    //执行发送选择文本事件
                DoBindActions(_designEvents[HistoryEventDefine.SendTextToReport], sender);

                break;

            case HistoryActionDefine.ImagesPreview:
                //执行图像预览操作
                PreviewImage();

                break;

            default:
                break;
            }

            return(true);
        }
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            switch (actName)
            {
            case WebProviderActionDefine.Action_OpenUrl:    //打开网页
                string urlAddres = ParseExecuteTag(tag, bizDatas);

                webBrowser1.Url = new Uri(urlAddres);

                break;

            default:
                break;
            }

            return(true);
        }
        /// <summary>
        /// 执行绑定事件
        /// </summary>
        /// <param name="ea"></param>
        /// <returns></returns>
        protected bool DoBindActions(EventActionReleation ea, object sender, object eventArgs = null)
        {
            if (_regBizModules.Count <= 0)
            {
                return(true);
            }

            string moduleName = "";
            string methodName = "";

            foreach (KeyValuePair <string, ActionItem> act in ea.Actions)
            {
                moduleName = act.Key.Split('.')[0];
                methodName = act.Key.Split('.')[1];

                ISysDesign exeModule = null;
                if (act.Value.IsParentModule)
                {
                    if (_regBizModules.ParentWindowBizModules == null)
                    {
                        exeModule = null;
                    }
                    else
                    {
                        if (_regBizModules.ParentWindowBizModules.ContainsKey(moduleName))
                        {
                            exeModule = _regBizModules.ParentWindowBizModules[moduleName];
                        }
                    }
                }
                else
                {
                    if (_regBizModules.ContainsKey(moduleName))
                    {
                        exeModule = _regBizModules[moduleName];
                    }
                }

                if (exeModule == null)
                {
                    if (MessageBox.Show("[" + moduleName + "] 未能加载,不能执行该模块方法, 是否继续?", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
                    {
                        return(false);
                    }
                }


                ActionItem ai = act.Value;

                IBizDataItems bizDatas = null;
                if (string.IsNullOrEmpty(ai.RequestDataName) == false)
                {
                    bizDatas = GetDataItem(_moduleName, ai, ai.RequestDataName);
                    if (bizDatas == null)
                    {
                        return(false);
                    }

                    bizDatas.DataName = ai.RequestDataName;
                }


                if (bizDatas != null)
                {
                    foreach (string requestDataName in ai.RequestAttachDataNames)
                    {
                        IBizDataItems curRequestData = GetDataItem(_moduleName, ai, requestDataName);

                        bizDatas.AttachDatas.Add(curRequestData);
                    }
                }

                if (exeModule.ExecuteAction(_moduleName, this, sender, act.Value.ActName, act.Value.ActTag, bizDatas) == false)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 16
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case CharActionDefine.LoadChars:
                    LoadChars();
                    break;

                case CharActionDefine.CharsSetting:
                    CharsConfig();
                    break;

                default:
                    break;
                }

                return(true);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 17
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case QueryActionDefine.Query:
                    return(ExecuteQuery());

                case QueryActionDefine.PopupQuery:
                    return(ExecuteQuery(true));

                default:
                    break;
                }

                return(true);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 18
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case QueueCallActionDefine.Refresh:
                    BindLastCall();
                    return(true);

                default:
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 19
0
 public virtual bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
 {
     return(false);
 }
Esempio n. 20
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            switch (actName)
            {
            case ImgActionDefine.OpenImageProcess:    //打开单张图像

                if (bizDatas == null)
                {
                    return(false);
                }

                _applyId = DataHelper.GetItemValueByApplyId(bizDatas[0]);

                _selectImgId = DataHelper.GetItemValueByImageId(bizDatas[0]);

                OpenImageProcess();

                break;

            case ImgActionDefine.OpenImagePreview:    //打开单图预览
                if (bizDatas == null)
                {
                    return(false);
                }


                string file = DataHelper.GetItemValueByFile(bizDatas[0]);

                if (File.Exists(file) == false)
                {
                    return(false);
                }

                ImagePreview.ShowImagePreview(file, 3000, this);
                break;

            case ImgActionDefine.CloseImagePreview:
                ImagePreview.CloseImagePreview();

                break;


            default:
                break;
            }

            return(true);
        }
Esempio n. 21
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case LabActionDefine.LoadText:
                    labContext.Text = "";

                    if (bizDatas == null || bizDatas.Count <= 0)
                    {
                        return(true);
                    }

                    if (bizDatas[0].Count <= 0)
                    {
                        return(true);
                    }

                    if (string.IsNullOrEmpty(tag))
                    {
                        foreach (KeyValuePair <string, object> kv in bizDatas[0])
                        {
                            labContext.Text = Convert.ToString(kv.Value);
                            return(true);
                        }
                    }
                    else
                    {
                        labContext.Text = Convert.ToString(bizDatas[0][tag]);
                    }

                    return(true);

                case LabActionDefine.ClearText:
                    labContext.Text = "";

                    return(true);


                default:
                    break;
                }

                return(true);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 22
0
 public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
 {
     throw new Exception("暂无可执行的方法。");
 }
Esempio n. 23
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            switch (actName)
            {
            case "远程":
                OpenRemote();

                break;

            case "医嘱":
                break;

            case "费用":
                break;

            default:
                break;
            }

            return(true);
        }
Esempio n. 24
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case InfoActionDefine.LoadInfo:
                    if (bizDatas != null)
                    {
                        _curBizData = bizDatas[0];
                    }
                    else
                    {
                        _curBizData = new BizDataItem();
                    }

                    //重载数据
                    ReloadData();

                    return(true);


                default:
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
 public virtual bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
 {
     throw new Exception("方法ExecuteAction尚未实现.");
 }
Esempio n. 26
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            switch (actName)
            {
            case JoyActionDefine.JoyConfig:    //手柄设置
                bool isOk = ShowJoyConfig(_joyPar);

                if (isOk)
                {
                    OpenJoy();
                }

                return(isOk);

            default:
                return(false);
            }
        }
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case TimerActionDefine.Start:
                    timer1.Start();
                    return(true);

                case TimerActionDefine.Stop:
                    timer1.Stop();
                    return(true);

                default:
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case QueueQuickActionDefine.Refresh:
                    BindQueueCall();
                    return(true);

                case QueueQuickActionDefine.ChangeQueue:
                    if (bizDatas == null)
                    {
                        return(false);
                    }

                    string queueName = DataHelper.GetItemValueByQueueName(bizDatas[0]);

                    return(Action_ChangeQueue(queueName, null));

                default:
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 29
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModuleInstance, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            try
            {
                switch (actName)
                {
                case ViewTableProviderActionDefine.Action_LoadData:
                    if (bizDatas == null)
                    {
                        return(false);
                    }

                    if (bizDatas.Count == 1)
                    {
                        IBizDataItem bd = bizDatas[0];
                        //先提取HIS服务配置,然后再做其他事情,避免_hisServerCfgData为空
                        if (bd.ContainsKey("HIS服务配置"))
                        {
                            _hisServerCfgData = bd["HIS服务配置"];
                        }
                        else
                        {
                            _hisServerCfgData = null;
                        }
                        if (bd.ContainsKey("查询结果"))
                        {
                            DataTable dt  = bd["查询结果"] as DataTable;
                            DataTable rdt = CustomizeDT(dt);
                            RefreshTable(rdt);
                        }
                    }

                    break;

                default:
                    break;
                }
                return(true);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return(false);
            }
        }
Esempio n. 30
0
        public override bool ExecuteAction(string callModuleName, ISysDesign callModule, object sender, string actName, string tag, IBizDataItems bizDatas, object eventArgs = null)
        {
            switch (actName)
            {
            case ImageActionDefine.LoadImages:    //刷新申请图像

                if (bizDatas == null)
                {
                    return(false);
                }

                _applyId = DataHelper.GetItemValueByApplyId(bizDatas[0]);

                LoadApplyImages(_applyId);

                break;

            case ImageActionDefine.RefreshImage:
                if (string.IsNullOrEmpty(_applyId))
                {
                    _images.Clear();
                    imageView1.Clear();

                    splitPage1.BindNull(0, _imgViewCount);

                    return(true);
                }

                LoadApplyImages(_applyId);

                break;

            case ImageActionDefine.AddImage:    //添加图像

                if (bizDatas == null)
                {
                    return(false);
                }

                TileImageInfo imgInfo = new TileImageInfo();

                imgInfo.MediaId       = DataHelper.GetItemValueByImageId(bizDatas[0]);
                imgInfo.SerialId      = DataHelper.GetItemValueBySerialId(bizDatas[0]);
                imgInfo.MediaType     = DataHelper.GetItemValueByMediaType(bizDatas[0]);
                imgInfo.Order         = DataHelper.GetItemValueByMediaOrder(bizDatas[0]);
                imgInfo.File          = DataHelper.GetItemValueByFile(bizDatas[0]);
                imgInfo.IsKeyImage    = false;
                imgInfo.IsReportImage = false;

                if (File.Exists(imgInfo.File) == false)
                {
                    MessageBox.Show("未找到本地图像文件 [" + imgInfo.File + "],不能进行加载。", "提示");
                    return(false);
                }

                FileInfo fi = new FileInfo(imgInfo.File);
                imgInfo.MediaName = fi.Name;

                if (_images == null)
                {
                    _images = new List <TileImageInfo>();
                }

                _images.Insert(0, imgInfo);

                splitPage1.UpdatePage(_images.Count);
                imageView1.AddImage(imgInfo);

                imageView1.RefreshImageRange();

                break;

            case ImageActionDefine.ImageSetting:    //影像相关参数设置
                ShowImageConfig();

                break;

            default:
                break;
            }

            return(true);
        }