Ejemplo n.º 1
0
        public int AddComment(T_CommentUserModel t_CommentUserModel)
        {
            int CommentId = new T_CommentDAL().Add(new T_CommentModel()
            {
                CommentTxt = t_CommentUserModel.CommentTxt, RoomId = t_CommentUserModel.RoomId
            });

            t_CommentUserModel.CommentId = CommentId;
            return(new T_CommentUserDAL().Add(t_CommentUserModel));
        }
Ejemplo n.º 2
0
        public int Add(T_CommentUserModel t_CommentUserModel)
        {
            var sqlparams = new SqlParameter[] {
                new SqlParameter("@CommentId", t_CommentUserModel.CommentId),
                new SqlParameter("@UserId", t_CommentUserModel.UserId),
                new SqlParameter("@RoomId", t_CommentUserModel.RoomId),
                new SqlParameter("@CommentTxt", t_CommentUserModel.CommentTxt),
                new SqlParameter("@CreateTime", DateTime.Now),
            };
            string sql = @" INSERT INTO  [T_CommentUser]
           ([CommentId]
           ,[UserId]
           ,[RoomId]
           ,[CommentTxt]
           ,[CreateTime])
           VALUES
           (@CommentId
           ,@UserId
           ,@RoomId
           ,@CommentTxt
           ,@CreateTime)";

            return(SqlHelper.ExecuteNonQuery(ConnectionString.WTVDns, CommandType.Text, sql, sqlparams));
        }