/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public webs_YueyxShop.Model.SysCodeBase DataRowToModel(DataRow row)
 {
     webs_YueyxShop.Model.SysCodeBase model=new webs_YueyxShop.Model.SysCodeBase();
     if (row != null)
     {
         if(row["sc_ID"]!=null && row["sc_ID"].ToString()!="")
         {
             model.sc_ID= new Guid(row["sc_ID"].ToString());
         }
         if(row["sc_BianM"]!=null)
         {
             model.sc_BianM=row["sc_BianM"].ToString();
         }
         if(row["sc_MingCh"]!=null)
         {
             model.sc_MingCh=row["sc_MingCh"].ToString();
         }
         if(row["sc_CengJ"]!=null && row["sc_CengJ"].ToString()!="")
         {
             model.sc_CengJ=int.Parse(row["sc_CengJ"].ToString());
         }
         if(row["sc_ParentId"]!=null && row["sc_ParentId"].ToString()!="")
         {
             model.sc_ParentId= new Guid(row["sc_ParentId"].ToString());
         }
         if(row["sc_CreatedBy"]!=null && row["sc_CreatedBy"].ToString()!="")
         {
             model.sc_CreatedBy= new Guid(row["sc_CreatedBy"].ToString());
         }
         if(row["sc_CreatedOn"]!=null && row["sc_CreatedOn"].ToString()!="")
         {
             model.sc_CreatedOn=DateTime.Parse(row["sc_CreatedOn"].ToString());
         }
         if(row["sc_StateCode"]!=null && row["sc_StateCode"].ToString()!="")
         {
             model.sc_StateCode=int.Parse(row["sc_StateCode"].ToString());
         }
         if(row["sc_DeleteStateCode"]!=null && row["sc_DeleteStateCode"].ToString()!="")
         {
             model.sc_DeleteStateCode=int.Parse(row["sc_DeleteStateCode"].ToString());
         }
         if(row["sc_LeiB"]!=null && row["sc_LeiB"].ToString()!="")
         {
             model.sc_LeiB=int.Parse(row["sc_LeiB"].ToString());
         }
         if(row["sc_SuoSMK"]!=null)
         {
             model.sc_SuoSMK=row["sc_SuoSMK"].ToString();
         }
     }
     return model;
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public webs_YueyxShop.Model.SysCodeBase GetModel(Guid sc_ID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 sc_ID,sc_BianM,sc_MingCh,sc_CengJ,sc_ParentId,sc_CreatedBy,sc_CreatedOn,sc_StateCode,sc_DeleteStateCode,sc_LeiB,sc_SuoSMK from SysCodeBase ");
            strSql.Append(" where sc_ID=@sc_ID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@sc_ID", SqlDbType.UniqueIdentifier,16)			};
            parameters[0].Value = sc_ID;

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