public bool GetUpdate(M_Page page) { string sqlStr = "UPDATE [dbo].[ZL_Page] SET [Proname]=@Proname,[PageTitle] = @PageTitle,[KeyWords] = @KeyWords,[Description] = @Description,[LOGO] = @LOGO,[Domain] = @Domain,[Style] = @Style,[HeadHeight] = @HeadHeight,[HeadColor] = @HeadColor,[CommonModelID] = @CommonModelID,[TableName] = @TableName,[Hits] = @Hits,[InfoID] = @InfoID,[Best] = @Best,[Status] = @Status,[UserID] = @UserID,[UserName] = @UserName,[ParentPageID] = @ParentPageID,[ParentUserID] = @ParentUserID,[PageInfo] = @PageInfo,[TopWords] = @TopWords,[BottonWords] = @BottonWords,[CreateTime] = @CreateTime,[NodeStyle]=@NodeStyle,[HeadBackGround]=@HeadBackGround WHERE [ID] = @ID"; SqlParameter[] cmdParams = page.GetParameters(); return(SqlHelper.ExecuteSql(sqlStr, cmdParams)); }
public int GetInsert(M_Page page) { string sqlStr = "SET IDENTITY_INSERT [ZL_Page] ON;INSERT INTO [dbo].[ZL_Page] ([ID],[Proname],[PageTitle],[KeyWords],[Description],[LOGO],[Domain],[Style],[HeadHeight],[HeadColor],[CommonModelID],[TableName],[Hits],[InfoID],[Best],[Status],[UserID],[UserName],[ParentPageID],[ParentUserID],[PageInfo],[TopWords],[BottonWords],[CreateTime],[NodeStyle],[HeadBackGround]) VALUES (@ID,@Proname,@PageTitle,@KeyWords,@Description,@LOGO,@Domain,@Style,@HeadHeight,@HeadColor,@CommonModelID,@TableName,@Hits,@InfoID,@Best,@Status,@UserID,@UserName,@ParentPageID,@ParentUserID,@PageInfo,@TopWords,@BottonWords,@CreateTime,@NodeStyle,@HeadBackGround);select @@IDENTITY;SET IDENTITY_INSERT [ZL_Page] OFF;"; SqlParameter[] cmdParams = page.GetParameters(); return(SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqlStr, cmdParams))); }
public int insert(M_Page model) { return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model))); }
public bool UpdateByID(M_Page model) { return(Sql.UpdateByIDs(strTableName, PK, model.ID.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters())); }