Ejemplo n.º 1
0
        /// <summary>
        ///更新记录
        /// </summary>
        /// <param name="Courseware"></param>
        /// <returns></returns>
        public bool GetUpdate(M_Courseware courseware)
        {
            string sqlStr = "UPDATE [dbo].[ZL_Courseware] SET [Courseware] = @Courseware,[CoursNum] = @CoursNum,[Listen] = @Listen,[UpdateTime] = @UpdateTime,[FileUrl] = @FileUrl,[CourseID] = @CourseID,[Speaker]=@Speaker,[SJName]=@SJName,[Status]=@Status,[Description]=@Description,[Classification]=@Classification,[CoursType]=@CoursType,[CreationTime]=@CreationTime WHERE [ID] = @ID";

            SqlParameter[] cmdParams = courseware.GetParameters();
            return(SqlHelper.ExecuteSql(sqlStr, cmdParams));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///添加记录
        /// </summary>
        /// <param name="Courseware"></param>
        /// <returns></returns>
        public int GetInsert(M_Courseware courseware)
        {
            string sqlStr = "INSERT INTO [dbo].[ZL_Courseware] ([Courseware],[CoursNum],[Listen],[UpdateTime],[FileUrl],[CourseID],[Speaker],[SJName],[Status],[Description],[Classification],[CoursType],[CreationTime]) VALUES (@Courseware,@CoursNum,@Listen,@UpdateTime,@FileUrl,@CourseID,@Speaker,@SJName,@Status,@Description,@Classification,@CoursType,@CreationTime);select @@IDENTITY";

            SqlParameter[] cmdParams = courseware.GetParameters();
            return(SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqlStr, cmdParams)));
        }