/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(book_shop.Model.UserInfoRoleModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update UserInfoRole set ");
#warning 系统发现缺少更新的字段,请手工确认如此更新是否正确!
            strSql.Append("UserInfo_ID=@UserInfo_ID,");
            strSql.Append("Role_ID=@Role_ID");
            strSql.Append(" where UserInfo_ID=@UserInfo_ID and Role_ID=@Role_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserInfo_ID", SqlDbType.Int, 4),
                new SqlParameter("@Role_ID",     SqlDbType.Int, 4)
            };
            parameters[0].Value = model.UserInfo_ID;
            parameters[1].Value = model.Role_ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(book_shop.Model.UserInfoRoleModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into UserInfoRole(");
            strSql.Append("UserInfo_ID,Role_ID)");
            strSql.Append(" values (");
            strSql.Append("@UserInfo_ID,@Role_ID)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserInfo_ID", SqlDbType.Int, 4),
                new SqlParameter("@Role_ID",     SqlDbType.Int, 4)
            };
            parameters[0].Value = model.UserInfo_ID;
            parameters[1].Value = model.Role_ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public book_shop.Model.UserInfoRoleModel GetModel(int UserInfo_ID, int Role_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 UserInfo_ID,Role_ID from UserInfoRole ");
            strSql.Append(" where UserInfo_ID=@UserInfo_ID and Role_ID=@Role_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserInfo_ID", SqlDbType.Int, 4),
                new SqlParameter("@Role_ID",     SqlDbType.Int, 4)
            };
            parameters[0].Value = UserInfo_ID;
            parameters[1].Value = Role_ID;

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public book_shop.Model.UserInfoRoleModel DataRowToModel(DataRow row)
 {
     book_shop.Model.UserInfoRoleModel model = new book_shop.Model.UserInfoRoleModel();
     if (row != null)
     {
         if (row["UserInfo_ID"] != null && row["UserInfo_ID"].ToString() != "")
         {
             model.UserInfo_ID = int.Parse(row["UserInfo_ID"].ToString());
         }
         if (row["Role_ID"] != null && row["Role_ID"].ToString() != "")
         {
             model.Role_ID = int.Parse(row["Role_ID"].ToString());
         }
     }
     return(model);
 }