/// <summary> /// 得到一个对象实体 /// </summary> public HisClient.Model.comm_icd10 DataRowToModel(DataRow row) { HisClient.Model.comm_icd10 model=new HisClient.Model.comm_icd10(); if (row != null) { if(row["ID"]!=null) { model.ID=row["ID"].ToString(); } if(row["ICD_CODE"]!=null) { model.ICD_CODE=row["ICD_CODE"].ToString(); } if(row["ICD_NAME"]!=null) { model.ICD_NAME=row["ICD_NAME"].ToString(); } if(row["HELP_CODE"]!=null) { model.HELP_CODE=row["HELP_CODE"].ToString(); } if(row["TYPE_CODE"]!=null) { model.TYPE_CODE=row["TYPE_CODE"].ToString(); } } return model; }
/// <summary> /// 得到一个对象实体 /// </summary> public HisClient.Model.comm_icd10 GetModel(string ID) { StringBuilder strSql=new StringBuilder(); strSql.Append("select ID,ICD_CODE,ICD_NAME,HELP_CODE,TYPE_CODE from comm_icd10 "); strSql.Append(" where ID=@ID "); MySqlParameter[] parameters = { new MySqlParameter("@ID", MySqlDbType.VarChar,18) }; parameters[0].Value = ID; HisClient.Model.comm_icd10 model=new HisClient.Model.comm_icd10(); DataSet ds=DbHelperMySQL.Query(strSql.ToString(),parameters); if(ds.Tables[0].Rows.Count>0) { return DataRowToModel(ds.Tables[0].Rows[0]); } else { return null; } }