public bool UpdateWechatHomeList(WechatHomeList model) { using (var conn = ProcessConnection.OpenConfiguration) { return(dal.UpdateWechatHomeList(conn, model)); } }
public int AddWechatHomeListToInt(WechatHomeList model) { using (var connection = ProcessConnection.OpenConfiguration) { return(dal.AddWechatHomeListToInt(connection, model)); } }
public bool UpdateWechatHomeList(SqlConnection conn, WechatHomeList model) { string sql = @" UPDATE Configuration.dbo.WechatHomeList SET Title = @Title , IsEnabled = @IsEnabled , UDateTime = GETDATE(), OrderBy=@OrderBy,IsNewUser=@IsNewUser,TypeName=@TypeName,IsShownButtom=@IsShownButtom,HomePageConfigID=@HomePageConfigID,Headings=@Headings,Subtitle=@Subtitle,ImageUrl=@ImageUrl,Uri=@Uri WHERE ID = @ID;"; return(conn.Execute(sql, model) > 0); }
public int AddWechatHomeListToInt(SqlConnection conn, WechatHomeList model) { string sql = @"INSERT INTO Configuration.dbo.WechatHomeList ( Title , IsEnabled , CDateTime , UDateTime,OrderBy,IsNewUser,TypeName,IsShownButtom,HomePageConfigID,Headings,Subtitle,ImageUrl,Uri ) VALUES ( @Title , -- Title - varchar(30) @IsEnabled , -- IsEnabled - int GETDATE() , -- CDateTime - datetime GETDATE(), -- UDateTime - datetime @OrderBy,@IsNewUser,@TypeName,@IsShownButtom,@HomePageConfigID,@Headings,@Subtitle,@ImageUrl,@Uri ); SELECT @@IDENTITY AS ID"; return(Convert.ToInt32(conn.ExecuteScalar(sql, model))); }
public bool AddWechatHomeList(SqlConnection conn, WechatHomeList model) { string sql = @"INSERT INTO Configuration.dbo.WechatHomeList ( Title , IsEnabled , CDateTime , UDateTime,OrderBy,IsNewUser,TypeName,IsShownButtom,HomePageConfigID,Headings,Subtitle,ImageUrl,Uri ) VALUES ( @Title , -- Title - varchar(30) @IsEnabled , -- IsEnabled - int GETDATE() , -- CDateTime - datetime GETDATE(), -- UDateTime - datetime @OrderBy,@IsNewUser,@TypeName,@IsShownButtom,@HomePageConfigID,@Headings,@Subtitle,@ImageUrl,@Uri )"; return conn.Execute(sql, model) > 0; }