示例#1
0
        /// <summary>
        /// 初始化费别列表
        /// </summary>
        private void InitChargeTypeDictList()
        {
            if (this.cboChargeType == null || this.cboChargeType.IsDisposed)
            {
                return;
            }
            if (this.cboChargeType.Items.Count > 0)
            {
                return;
            }
            //加载科室列表
            List <ChargeTypeDictInfo> lstChargeTypeDictInfos = null;

            if (EMRDBAccess.Instance.GetChargeTypeDictInfos(ref lstChargeTypeDictInfos) != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("费别列表下载失败!");
                return;
            }
            if (lstChargeTypeDictInfos == null || lstChargeTypeDictInfos.Count <= 0)
            {
                return;
            }
            for (int index = 0; index < lstChargeTypeDictInfos.Count; index++)
            {
                ChargeTypeDictInfo chargeTypeDictInfo = lstChargeTypeDictInfos[index];
                this.cboChargeType.Items.Add(chargeTypeDictInfo);
            }
        }
示例#2
0
        public short GetChargeTypeDictInfos(ref List <ChargeTypeDictInfo> lstChargeTypeDictInfo)
        {
            string szField = string.Format("{0},{1},{2}"
                                           , SystemData.ChargeTypeDicView.SERIAL_NO, SystemData.ChargeTypeDicView.CHARGE_TYPE_CODE
                                           , SystemData.ChargeTypeDicView.CHARGE_TYPE_NAME
                                           );

            string szSQL = string.Format(SystemData.SQL.SELECT_FROM, szField, SystemData.DataView.CHARGE_TYPE_DICT_V
                                         );
            IDataReader dataReader = null;

            try
            {
                dataReader = base.MedQCAccess.ExecuteReader(szSQL, CommandType.Text);
                if (dataReader == null || dataReader.IsClosed || !dataReader.Read())
                {
                    return(SystemData.ReturnValue.RES_NO_FOUND);
                }
                if (lstChargeTypeDictInfo == null)
                {
                    lstChargeTypeDictInfo = new List <ChargeTypeDictInfo>();
                }
                do
                {
                    ChargeTypeDictInfo chargeTypeDictInfo = new ChargeTypeDictInfo();
                    if (!dataReader.IsDBNull(0))
                    {
                        chargeTypeDictInfo.SerialNo = int.Parse(dataReader.GetValue(0).ToString());
                    }
                    if (!dataReader.IsDBNull(1))
                    {
                        chargeTypeDictInfo.ChargeTypeCode = dataReader.GetString(1);
                    }
                    if (!dataReader.IsDBNull(2))
                    {
                        chargeTypeDictInfo.ChargeTypeName = dataReader.GetString(2);
                    }
                    lstChargeTypeDictInfo.Add(chargeTypeDictInfo);
                } while (dataReader.Read());
                return(SystemData.ReturnValue.OK);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("EMRDBAccess.GetChargeTypeDictInfos", new string[] { "szSQL" }, new object[] { szSQL }, ex);
                return(SystemData.ReturnValue.EXCEPTION);
            }
            finally
            {
                if (dataReader != null)
                {
                    dataReader.Close();
                    dataReader.Dispose();
                    dataReader = null;
                }
                base.MedQCAccess.CloseConnnection(false);
            }
        }