Пример #1
0
        /// <summary>
        /// 根据床位等级编码提取BedFeeItem信息
        /// </summary>
        /// <param name="minFeeCode">最小费用编码</param>
        /// <returns>成功: 床位信息数组, 失败 null, 没有找到数据:元素为0的ArrayList</returns>
        public ArrayList QueryBedFeeItemByMinFeeCode(string minFeeCode)
        {
            string sql = string.Empty;             //查询SQL语句

            if (this.Sql.GetSql("Fee.BedFeeItem.SelectByFeeCode", ref sql) == -1)
            {
                this.Err = "没有找到索引为:Fee.BedFeeItem.SelectByFeeCode的SQL语句";

                return(null);
            }

            if (this.ExecQuery(sql, minFeeCode) == -1)
            {
                return(null);
            }

            try
            {
                ArrayList bedFeeItems = new ArrayList();

                //循环读取数据
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.Fee.BedFeeItem bedFeeItem = new Neusoft.HISFC.Models.Fee.BedFeeItem();

                    bedFeeItem.PrimaryKey     = this.Reader[0].ToString();
                    bedFeeItem.FeeGradeCode   = this.Reader[1].ToString();
                    bedFeeItem.ID             = this.Reader[2].ToString();
                    bedFeeItem.Name           = this.Reader[3].ToString();
                    bedFeeItem.Qty            = NConvert.ToDecimal(this.Reader[4].ToString());
                    bedFeeItem.SortID         = NConvert.ToInt32(this.Reader[5].ToString());
                    bedFeeItem.IsBabyRelation = NConvert.ToBoolean(this.Reader[6].ToString());
                    bedFeeItem.IsTimeRelation = NConvert.ToBoolean(this.Reader[7].ToString());
                    bedFeeItem.BeginTime      = NConvert.ToDateTime(this.Reader[8].ToString());
                    bedFeeItem.EndTime        = NConvert.ToDateTime(this.Reader[9].ToString());
                    bedFeeItem.ValidState     = (EnumValidState)NConvert.ToInt32(this.Reader[10]);
                    bedFeeItem.ExtendFlag     = this.Reader[13].ToString();

                    bedFeeItems.Add(bedFeeItem);
                }

                this.Reader.Close();

                return(bedFeeItems);
            }
            catch (Exception e)
            {
                this.Err = e.Message;

                if (!this.Reader.IsClosed)
                {
                    this.Reader.Close();
                }

                return(null);
            }
        }
Пример #2
0
        /// <summary>
        /// 更新床位信息一条记录
        /// </summary>
        /// <param name="bedFeeItem">床位信息实体</param>
        /// <returns>成功 1 失败 -1 没有删除到记录 0</returns>
        public int UpdateBedFeeItem(Neusoft.HISFC.Models.Fee.BedFeeItem bedFeeItem)
        {
            string sql = string.Empty;             //更新fin_com_bedfeegrade表的SQL语句

            if (this.Sql.GetSql("Fee.BedFeeItem.UpdateBedFeeItem", ref sql) == -1)
            {
                this.Err = "没有找到索引为: Fee.BedFeeItem.UpdateBedFeeItem 的SQL语句";

                return(-1);
            }

            return(this.ExecNoQuery(sql, this.GetBedFeeItemParms(bedFeeItem)));
        }
Пример #3
0
        /// <summary>
        /// 通过实体获得字符参数数组
        /// </summary>
        /// <param name="bedFeeItem">床位费实体</param>
        /// <returns></returns>
        private string[] GetBedFeeItemParms(Neusoft.HISFC.Models.Fee.BedFeeItem bedFeeItem)
        {
            string[] parms = { bedFeeItem.PrimaryKey,
                               bedFeeItem.FeeGradeCode,
                               bedFeeItem.ID,
                               bedFeeItem.Name,
                               bedFeeItem.Qty.ToString(),
                               bedFeeItem.SortID.ToString(),
                               NConvert.ToInt32(bedFeeItem.IsBabyRelation).ToString(),
                               NConvert.ToInt32(bedFeeItem.IsTimeRelation).ToString(),
                               bedFeeItem.BeginTime.ToString(),
                               bedFeeItem.EndTime.ToString(),
                               ((int)bedFeeItem.ValidState).ToString(),
                               this.Operator.ID };

            return(parms);
        }
Пример #4
0
        public int Update(Neusoft.HISFC.Models.Fee.BedFeeItem info)
        {
            string strSql = "";

            if (this.Sql.GetSql("Fee.BedFeeItem.UpdateBedFeeItem", ref strSql) == -1)
            {
                return(-1);
            }

            try
            {
                strSql = string.Format(strSql, info.ID, info.FeeGradeCode, info.ID, info.Name, info.Qty,

                                       info.SortID,
                                       FrameWork.Function.NConvert.ToInt32(info.IsBabyRelation),
                                       FrameWork.Function.NConvert.ToInt32(info.IsTimeRelation),

                                       info.BeginTime, info.EndTime,
                                       info.ValidState,
                                       this.Operator.ID);
            }
            catch (Exception ex)
            {
                this.ErrCode = ex.Message;
                this.Err     = ex.Message;
                return(-1);
            }

            try
            {
                return(this.ExecNoQuery(strSql));
            }
            catch (Exception ex)
            {
                this.ErrCode = ex.Message;
                this.Err     = ex.Message;
                return(-1);
            }
        }
Пример #5
0
        public ArrayList SelectByFeeCode(string feeCode)
        {
            string strSql = "";

            if (this.Sql.GetSql("Fee.BedFeeItem.SelectByFeeCode", ref strSql) == -1)
            {
                return(null);
            }

            try
            {
                strSql = string.Format(strSql, feeCode);
            }
            catch (Exception ex)
            {
                this.ErrCode = ex.Message;
                this.Err     = ex.Message;
                return(null);
            }

            try
            {
                ArrayList List = new ArrayList();
                this.ExecQuery(strSql);
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.Fee.BedFeeItem obj = new Neusoft.HISFC.Models.Fee.BedFeeItem();
                    obj.ID           = Reader[0].ToString();
                    obj.FeeGradeCode = Reader[1].ToString();
                    obj.ID           = Reader[2].ToString();
                    obj.Name         = Reader[3].ToString();
                    obj.Qty          = FrameWork.Function.NConvert.ToDecimal(Reader[4].ToString());

                    obj.SortID         = FrameWork.Function.NConvert.ToInt32(Reader[5].ToString());
                    obj.IsBabyRelation = FrameWork.Function.NConvert.ToBoolean(Reader[6].ToString());
                    obj.IsTimeRelation = FrameWork.Function.NConvert.ToBoolean(Reader[7].ToString());

                    obj.BeginTime = (DateTime)Reader[8];
                    obj.EndTime   = (DateTime)Reader[9];

                    obj.ValidState = (EnumValidState)NConvert.ToInt32(Reader[10]);
                    obj.ExtendFlag = Reader[13].ToString();

                    List.Add(obj);
                }

                this.Reader.Close();

                return(List);
            }
            catch (Exception ex)
            {
                this.ErrCode = ex.Message;
                this.Err     = ex.Message;
                if (!Reader.IsClosed)
                {
                    Reader.Close();
                }
                return(null);
            }
        }