Exemplo n.º 1
0
 /// <summary>
 /// �õ�һ������ʵ��
 /// </summary>
 public RuRo.Model.TB_Disease DataRowToModel(DataRow row)
 {
     RuRo.Model.TB_Disease model=new RuRo.Model.TB_Disease();
     if (row != null)
     {
         if(row["ID"]!=null && row["ID"].ToString()!="")
         {
             model.ID=int.Parse(row["ID"].ToString());
         }
         if(row["DiseaseID"]!=null && row["DiseaseID"].ToString()!="")
         {
             model.DiseaseID=int.Parse(row["DiseaseID"].ToString());
         }
         if(row["DiseaseName"]!=null)
         {
             model.DiseaseName=row["DiseaseName"].ToString();
         }
         if(row["MnemonicCode"]!=null)
         {
             model.MnemonicCode=row["MnemonicCode"].ToString();
         }
         if(row["ICDCode"]!=null)
         {
             model.ICDCode=row["ICDCode"].ToString();
         }
     }
     return model;
 }
Exemplo n.º 2
0
        /// <summary>
        /// �õ�һ������ʵ��
        /// </summary>
        public RuRo.Model.TB_Disease GetModel(int ID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 ID,DiseaseID,DiseaseName,MnemonicCode,ICDCode from TB_Disease ");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@ID", SqlDbType.Int,4)			};
            parameters[0].Value = ID;

            RuRo.Model.TB_Disease model=new RuRo.Model.TB_Disease();
            DataSet ds=DbHelperSQL_SY.QuerySY(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }