public GetChannel ( int idChannel ) : TvDatabase.Channel | ||
idChannel | int | |
Результат | TvDatabase.Channel |
private void AddSelectedItemsToGroup(MPListView sourceListView) { if (_channelGroup == null) { return; } TvBusinessLayer layer = new TvBusinessLayer(); foreach (ListViewItem sourceItem in sourceListView.SelectedItems) { Channel channel = null; if (sourceItem.Tag is Channel) { channel = (Channel)sourceItem.Tag; } else if (sourceItem.Tag is RadioGroupMap) { channel = layer.GetChannel(((RadioGroupMap)sourceItem.Tag).IdChannel); } else { continue; } RadioGroupMap groupMap = null; layer.AddChannelToRadioGroup(channel, _channelGroup); //get the new group map and set the listitem tag SqlBuilder sb = new SqlBuilder(StatementType.Select, typeof (RadioGroupMap)); sb.AddConstraint(Operator.Equals, "idChannel", channel.IdChannel); sb.AddConstraint(Operator.Equals, "idGroup", _channelGroup.IdGroup); SqlStatement stmt = sb.GetStatement(true); groupMap = ObjectFactory.GetInstance<RadioGroupMap>(stmt.Execute()); foreach (ListViewItem item in listView1.Items) { if ((item.Tag as Channel) == channel) { item.Tag = groupMap; break; } } } }