private void RemoveAllChannel() { if (MsgBox.QuestionShow("确认清空所有通道吗?") == MsgBoxResult.OK) { ChannelCollection?.Clear(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { ChannelCollection cc = SessionManager.WaterUserSession.WaterUser.ChannelCollection; cc.Clear(); foreach (ListItem item in this.clChannel.Items) { if (item.Selected) { int id = Convert.ToInt32(item.Value); ChannelClass c = ChannelFactory.CreateChannel(id); cc.Add(c); } } Response.Redirect("WaterUser.aspx"); }