internal static void SaveTopic(ds.FeedRow feed, ds.TopicRow row) { try { using (dsTableAdapters.TopicTableAdapter ta = new dsTableAdapters.TopicTableAdapter()) { if (row.Id <= 0) { topics.AddTopicRow(row); } ta.Update(row); ta.Update(topics); if (feed.ShowRead) ta.FillBy(topics, feed.Id); else ta.FillUnread(topics, feed.Id); } } catch { var dr = feeds.GetErrors(); if (dr.Length > 0) { Notificator.NotifyMessage(dr[0].RowError); } throw; } }
internal static DataTable GetTopics(ds.FeedRow feed) { try { using (dsTableAdapters.TopicTableAdapter ta = new dsTableAdapters.TopicTableAdapter()) { if(feed.ShowRead) ta.FillBy(topics, feed.Id); else ta.FillUnread(topics, feed.Id); return topics; } } catch { var dr = feeds.GetErrors(); if (dr.Length > 0) { Notificator.NotifyMessage(dr[0].RowError); } throw; } }