Ejemplo n.º 1
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.extend_DiseaseOther DataRowToModel(DataRow row)
 {
     Maticsoft.Model.extend_DiseaseOther model=new Maticsoft.Model.extend_DiseaseOther();
     if (row != null)
     {
         if(row["DiseaseOtherID"]!=null && row["DiseaseOtherID"].ToString()!="")
         {
             model.DiseaseOtherID=int.Parse(row["DiseaseOtherID"].ToString());
         }
         if(row["DO_Type"]!=null && row["DO_Type"].ToString()!="")
         {
             model.DO_Type=int.Parse(row["DO_Type"].ToString());
         }
         if(row["DO_Date"]!=null && row["DO_Date"].ToString()!="")
         {
             model.DO_Date=DateTime.Parse(row["DO_Date"].ToString());
         }
         if(row["DO_Name"]!=null)
         {
             model.DO_Name=row["DO_Name"].ToString();
         }
         if(row["DO_UserID"]!=null && row["DO_UserID"].ToString()!="")
         {
             model.DO_UserID=int.Parse(row["DO_UserID"].ToString());
         }
     }
     return model;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.extend_DiseaseOther GetModel(int DiseaseOtherID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 DiseaseOtherID,DO_Type,DO_Date,DO_Name,DO_UserID from extend_DiseaseOther ");
            strSql.Append(" where DiseaseOtherID=@DiseaseOtherID");
            SqlParameter[] parameters = {
                    new SqlParameter("@DiseaseOtherID", SqlDbType.Int,4)
            };
            parameters[0].Value = DiseaseOtherID;

            Maticsoft.Model.extend_DiseaseOther model=new Maticsoft.Model.extend_DiseaseOther();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }