Пример #1
0
        /// <summary>
        /// 向数据表tb_Word更新一条记录。
        /// </summary>
        /// <param name="_tb_WordModel">_tb_WordModel</param>
        /// <returns>影响的行数</returns>
        public int Update(tb_WordEntity _tb_WordModel)
        {
            string sqlStr = "update tb_Word set [RoleId]=@RoleId,[UserId]=@UserId,[Word]=@Word,[Status]=@Status,[Addtime]=@Addtime,[Updatetime]=@Updatetime where Id=@Id";

            SqlParameter[] _param =
            {
                new SqlParameter("@Id",         SqlDbType.Int),
                new SqlParameter("@RoleId",     SqlDbType.Int),
                new SqlParameter("@UserId",     SqlDbType.Int),
                new SqlParameter("@Word",       SqlDbType.VarChar),
                new SqlParameter("@Status",     SqlDbType.Int),
                new SqlParameter("@Addtime",    SqlDbType.DateTime),
                new SqlParameter("@Updatetime", SqlDbType.DateTime)
            };
            _param[0].Value = _tb_WordModel.Id;
            _param[1].Value = _tb_WordModel.RoleId;
            _param[2].Value = _tb_WordModel.UserId;
            _param[3].Value = _tb_WordModel.Word;
            _param[4].Value = _tb_WordModel.Status;
            _param[5].Value = _tb_WordModel.Addtime;
            _param[6].Value = _tb_WordModel.Updatetime;
            return(SqlHelper.ExecuteNonQuery(WebConfig.ExamRW, CommandType.Text, sqlStr, _param));
        }
Пример #2
0
 public void Update(tb_WordEntity tb_WordEntity)
 {
     tb_Worddal.Update(tb_WordEntity);
 }
Пример #3
0
 public int Insert(tb_WordEntity tb_WordEntity)
 {
     return(tb_Worddal.Insert(tb_WordEntity));
 }