/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public static yny_005.Model.Member_OperationRecord DataRowToModel(DataRow row)
 {
     yny_005.Model.Member_OperationRecord model = new yny_005.Model.Member_OperationRecord();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["MID"] != null)
         {
             model.MID = row["MID"].ToString();
         }
         if (row["LevelCode"] != null)
         {
             model.LevelCode = row["LevelCode"].ToString();
         }
         if (row["RoleCode"] != null)
         {
             model.RoleCode = row["RoleCode"].ToString();
         }
         if (row["Time"] != null && row["Time"].ToString() != "")
         {
             model.Time = DateTime.Parse(row["Time"].ToString());
         }
         if (row["TypeCode"] != null)
         {
             model.TypeCode = row["TypeCode"].ToString();
         }
         if (row["Operation"] != null)
         {
             model.Operation = row["Operation"].ToString();
         }
     }
     return(model);
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public yny_005.Model.Member_OperationRecord GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,MID,LevelCode,RoleCode,Time,TypeCode,Operation from Member_OperationRecord ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            yny_005.Model.Member_OperationRecord model = new yny_005.Model.Member_OperationRecord();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }