/// <summary> /// 取某一扩展属性数据 /// </summary> /// <param name="propertyCode">属性编码</param> /// <returns>项目属性数组,出错返回null</returns> public ArrayList GetComExtInfoList(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string propertyCode) { string strSQL = ""; //取SELECT语句 if (this.Sql.GetSql("Manager.ComExtInfo.GetComExtInfoList", ref strSQL) == -1) { this.Err = "没有找到Manager.ComExtInfo.GetComExtInfoList字段!"; return(null); } //格式化SQL语句 try { strSQL = string.Format(strSQL, enuExtendClass, propertyCode); } catch (Exception ex) { this.Err = "格式化SQL语句时出错Manager.ComExtInfo.GetComExtInfoList:" + ex.Message; return(null); } //取项目属性数据 return(this.myGetComExtInfo(strSQL)); }
/// <summary> /// 取项目的字符属性 /// </summary> /// <param name="PropertyCode">属性类别</param> /// <param name="ItemCode">项目编码</param> /// <returns>字符属性</returns> public string GetComExtInfoString(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string PropertyCode, string ItemCode) { //取项目扩展属性实体 Neusoft.HISFC.Models.Base.ExtendInfo ext = this.GetComExtInfo(enuExtendClass, PropertyCode, ItemCode); if (ext == null) { return(""); } else { return(ext.StringProperty); } }
/// <summary> /// 取项目的数值属性 /// </summary> /// <param name="PropertyCode">属性类别</param> /// <param name="ItemCode">项目编码</param> /// <returns>数值属性</returns> public decimal GetComExtInfoNumber(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string PropertyCode, string ItemCode) { //取项目项目的扩展属性实体 Neusoft.HISFC.Models.Base.ExtendInfo ext = this.GetComExtInfo(enuExtendClass, PropertyCode, ItemCode); if (ext == null) { return(0M); } else { return(ext.NumberProperty); } }
/// <summary> /// 取项目的日期属性 /// </summary> /// <param name="PropertyCode">属性类别</param> /// <param name="ItemCode">项目编码</param> /// <returns>日期属性</returns> public DateTime GetComExtInfoDateTime(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string PropertyCode, string ItemCode) { //取项目扩展属性实体 Neusoft.HISFC.Models.Base.ExtendInfo ext = this.GetComExtInfo(enuExtendClass, PropertyCode, ItemCode); if (ext == null) { return(DateTime.MinValue); } else { return(ext.DateProperty); } }
/// <summary> /// 取特定项目、特定编码的扩展属性 /// </summary> /// <param name="enuExtendClass"></param> /// <param name="PropertyCode"></param> /// <param name="ItemCode"></param> /// <returns></returns> public Neusoft.HISFC.Models.Base.ExtendInfo GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string PropertyCode, string ItemCode) { string strSQL = ""; string strWhere = ""; //取SELECT语句 if (this.Sql.GetSql("Manager.ComExtInfo.GetComExtInfoList", ref strSQL) == -1) { this.Err = "没有找到Manager.ComExtInfo.GetComExtInfoList字段!"; return(null); } if (this.Sql.GetSql("Manager.ComExtInfo.And.ItemID", ref strWhere) == -1) { this.Err = "没有找到Manager.ComExtInfo.And.ItemID字段!"; return(null); } //格式化SQL语句 try { strSQL += " " + strWhere; strSQL = string.Format(strSQL, enuExtendClass.ToString(), PropertyCode, ItemCode); } catch (Exception ex) { this.Err = "格式化SQL语句时出错Manager.ComExtInfo.And.ItemID:" + ex.Message; return(null); } //取项目属性数据 ArrayList al = this.myGetComExtInfo(strSQL); if (al == null) { return(null); } if (al.Count == 0) { return(new Neusoft.HISFC.Models.Base.ExtendInfo()); } return(al[0] as Neusoft.HISFC.Models.Base.ExtendInfo); }
/// <summary> /// 删除项目属性表中一条记录 /// </summary> /// <param name="enuExtendClass"></param> /// <param name="itemCode"></param> /// <param name="propertyCode"></param> /// <returns></returns> public int DeleteComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string itemCode, string propertyCode) { string strSQL = ""; //取删除操作的SQL语句 if (this.Sql.GetSql("Manager.ComExtInfo.DeleteComExtInfo", ref strSQL) == -1) { this.Err = "没有找到Manager.ComExtInfo.DeleteComExtInfo字段!"; return(-1); } try { //如果是新增加的项目属性单,则直接返回 strSQL = string.Format(strSQL, enuExtendClass, itemCode, propertyCode); //替换SQL语句中的参数。 } catch (Exception ex) { this.Err = "格式化SQL语句时出错Manager.ComExtInfo.DeleteComExtInfo:" + ex.Message; this.WriteErr(); return(-1); } return(this.ExecNoQuery(strSQL)); }