示例#1
0
        protected void deleteChannelButton_Click(object sender, EventArgs e)
        {
            AMSDeleteChannelsInEventExecutor executor = new AMSDeleteChannelsInEventExecutor(this.EventID, this.dataGrid.SelectedKeys.ToArray());

            executor.Execute();

            this.RefreshChannelsAndList();
        }
示例#2
0
        public void DeleteChannelInEventExecutor()
        {
            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, newChannel.ID);

            executor.Execute();

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

            channels.Output();
            Assert.AreEqual(1, channels.Count);
        }