/// <summary>
        /// 增加一个医院组合项目
        /// </summary>
        public void AddComplexItemByHospital(ComplexItem complexItem)
        {
            if (complexItem.Details.Count == 0)
            {
                throw new CustomException("组合项目的子项目不能为空");
            }
            Model.BASE_COMPLEX_ITEM base_complex_item = new HIS.Model.BASE_COMPLEX_ITEM( );

            base_complex_item.COMPLEX_NAME  = complexItem.ITEM_NAME;
            base_complex_item.ITEM_UNIT     = complexItem.ITEM_UNIT;
            base_complex_item.PRICE         = complexItem.PRICE;
            base_complex_item.PY_CODE       = complexItem.PY_CODE;
            base_complex_item.WB_CODE       = complexItem.WB_CODE;
            base_complex_item.STATITEM_CODE = complexItem.STATITEM_CODE;
            base_complex_item.VALID_FLAG    = complexItem.VALID_FLAG;
            try
            {
                oleDb.BeginTransaction( );
                base_complex_item.COMPLEX_ID = BindEntity <Model.BASE_COMPLEX_ITEM> .CreateInstanceDAL(oleDb).Add(base_complex_item);

                decimal cost = 0;
                foreach (ComplexDetailItem detail in complexItem.Details)
                {
                    if (detail.ITEM_ID == 0) //2010-06-03 组合项目增加明细时,名称为空时,数据库里会增加一条空的记录  heyan
                    {
                        continue;
                    }
                    Model.BASE_COMPLEX_DETAIL base_complex_detail = new HIS.Model.BASE_COMPLEX_DETAIL( );
                    base_complex_detail.COMPLEX_ID      = base_complex_item.COMPLEX_ID;
                    base_complex_detail.NUM             = detail.Num;
                    base_complex_detail.SERVICE_ITEM_ID = detail.ITEM_ID;
                    cost += base_complex_detail.NUM * detail.PRICE;

                    BindEntity <Model.BASE_COMPLEX_DETAIL> .CreateInstanceDAL(oleDb).Add(base_complex_detail);
                }
                //if ( complexItem.PRICE > cost )
                //{
                //    throw new CustomException( "定义的价格不能高于明细总价" );
                //}

                Model.BASE_HOSPITAL_ITEMS base_hospital_items = new HIS.Model.BASE_HOSPITAL_ITEMS( );
                base_hospital_items.COMPLEX_ID = base_complex_item.COMPLEX_ID;
                base_hospital_items.ITEM_ID    = base_complex_item.COMPLEX_ID;
                BindEntity <Model.BASE_HOSPITAL_ITEMS> .CreateInstanceDAL(oleDb).Add(base_hospital_items);

                oleDb.CommitTransaction( );
            }
            catch (CustomException ce)
            {
                oleDb.RollbackTransaction( );
                throw ce;
            }
            catch (Exception err)
            {
                oleDb.RollbackTransaction( );
                throw new CustomException("新增组合项目发生错误!");
            }
        }
        /// <summary>
        /// 为医院增加一个服务项目
        /// </summary>
        /// <param name="Item"></param>
        public void AddServiceItemToHospital(ServiceItem Item)
        {
            string strWhere = Tables.base_hospital_items.ITEM_ID + oleDb.EuqalTo() + Item.ITEM_ID + oleDb.And() + Tables.base_hospital_items.COMPLEX_ID + oleDb.EuqalTo() + "0";

            Model.BASE_HOSPITAL_ITEMS model = BindEntity <Model.BASE_HOSPITAL_ITEMS> .CreateInstanceDAL(oleDb).GetModel(strWhere);

            if (model == null)
            {
                model            = new HIS.Model.BASE_HOSPITAL_ITEMS( );
                model.ITEM_ID    = Item.ITEM_ID;
                model.COMPLEX_ID = 0;
                BindEntity <Model.BASE_HOSPITAL_ITEMS> .CreateInstanceDAL(oleDb).Add(model);
            }
        }