/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.CookingStyles DataRowToModel(DataRow row)
 {
     Maticsoft.Model.CookingStyles model=new Maticsoft.Model.CookingStyles();
     if (row != null)
     {
         if(row["CookingStyleID"]!=null)
         {
             model.CookingStyleID=row["CookingStyleID"].ToString();
         }
         if(row["CookingStyleName"]!=null)
         {
             model.CookingStyleName=row["CookingStyleName"].ToString();
         }
         if(row["ParentID"]!=null)
         {
             model.ParentID=row["ParentID"].ToString();
         }
         if(row["State"]!=null && row["State"].ToString()!="")
         {
             model.State=int.Parse(row["State"].ToString());
         }
         if(row["Photo"]!=null)
         {
             model.Photo=row["Photo"].ToString();
         }
         if(row["SortID"]!=null && row["SortID"].ToString()!="")
         {
             model.SortID=int.Parse(row["SortID"].ToString());
         }
         if(row["CityID"]!=null)
         {
             model.CityID=row["CityID"].ToString();
         }
     }
     return model;
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.CookingStyles GetModel(string CookingStyleID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 CookingStyleID,CookingStyleName,ParentID,State,Photo,SortID,CityID from CookingStyles ");
            strSql.Append(" where [email protected] ");
            SqlParameter[] parameters = {
                    new SqlParameter("@CookingStyleID", SqlDbType.NVarChar,50)			};
            parameters[0].Value = CookingStyleID;

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