Пример #1
0
        public void DeleteDefaultChannelInEventExecutor()
        {
            AMSEventSqlAdapter.Instance.ClearAll();
            AMSChannelSqlAdapter.Instance.ClearAll();

            AMSChannel channel = DataHelper.PrepareChannelData();

            AMSChannelSqlAdapter.Instance.Update(channel);

            AMSEvent eventData = DataHelper.PrepareEventData(channel.ID);

            AMSEventSqlAdapter.Instance.Update(eventData);

            AMSChannel newChannel = DataHelper.PrepareChannelData();

            AMSChannelSqlAdapter.Instance.Update(newChannel);

            AMSEventSqlAdapter.Instance.AddChannel(eventData.ID, new string[] { newChannel.ID });

            AMSDeleteChannelsInEventExecutor executor = new AMSDeleteChannelsInEventExecutor(eventData.ID, channel.ID);

            executor.Execute();

            AMSChannelCollection channels = AMSEventSqlAdapter.Instance.LoadRelativeChannels(eventData.ID);

            channels.Output();
            Assert.AreEqual(2, channels.Count);
        }
Пример #2
0
        protected void deleteChannelButton_Click(object sender, EventArgs e)
        {
            AMSDeleteChannelsInEventExecutor executor = new AMSDeleteChannelsInEventExecutor(this.EventID, this.dataGrid.SelectedKeys.ToArray());

            executor.Execute();

            this.RefreshChannelsAndList();
        }