コード例 #1
0
        private object QueryParValueEvent(string parName)
        {
            switch (parName)
            {
            case "系统_申请ID":
                if (_curBizData == null)
                {
                    return(null);
                }
                return(DataHelper.GetItemValueByApplyId(_curBizData));

            case "系统_患者ID":
                if (_curBizData == null)
                {
                    return(null);
                }
                return(DataHelper.GetItemValueByPatientId(_curBizData));

            case "系统_申请识别码":
                if (_curBizData == null)
                {
                    return(null);
                }
                return(DataHelper.GetItemValueByApplyCode(_curBizData));

            case "系统_患者识别码":
                if (_curBizData == null)
                {
                    return(null);
                }
                return(DataHelper.GetItemValueByPatientCode(_curBizData));

            case "系统_患者姓名":
                if (_curBizData == null)
                {
                    return(null);
                }
                return(DataHelper.GetItemValueByPatientName(_curBizData));

            case "系统_用户ID":
                return(_userData.UserId);

            case "系统_用户名称":
                return(_userData.Name);

            case "系统_用户账号":
                return(_userData.Account);

            case "系统_设备ID":
                return(_stationInfo.DeviceId);

            case "系统_设备名称":
                return(_stationInfo.DeviceName);

            case "系统_房间ID":
                return(_stationInfo.RoomId);

            case "系统_房间名称":
                return(_stationInfo.RoomName);

            case "系统_科室ID":
                return(_stationInfo.DepartmentId);

            case "系统_科室名称":
                return(_stationInfo.DepartmentName);

            case "系统_院区编码":
                return(_stationInfo.DistrictCode);

            case "系统_本地日期":
                return(DateTime.Now);

            case "系统_服务器日期":
                DBModel dmDate = new DBModel(_dbQuery);
                return(dmDate.GetServerDate());

            case "系统_本机IP":
                return(Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString());

            case "系统_本机名称":
                return(Dns.GetHostName());

            default:
                if (_curBizData != null && _curBizData.Count > 0)
                {
                    parName = parName.Replace("系统_", "");
                    if (_curBizData.ContainsKey(parName))
                    {
                        return(_curBizData[parName]);
                    }
                }
                return(null);
            }
        }
コード例 #2
0
        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);
            }
        }