public DialogCollectChannel(DialogStation _frmDialogStation, int _maxChannelNum, Dictionary <int, int> _useChannelList) { InitializeComponent(); this.frmDialogStation = _frmDialogStation; this.MaxChannelNum = _maxChannelNum; this.UseChannelList = _useChannelList; //新建通道 this.Text = "添加采集器通道"; //刷新可用的通道列表 RefreshCanUseChannel(); //将列表的第1项放到textBox_Channel if (listview_CanUseChannel.Items.Count < 1) { MessageBox.Show("对不起,这个采集器的所有通道都已经使用了。您无法再添加新的通道了。", "通道设置", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { textBox_Channel.Text = listview_CanUseChannel.Items[0].SubItems[0].Text; } com_ChannelType.SelectedIndex = 0; this.Width = 303; this.listview_CanUseChannel.Visible = true; }
private void DataGridView_Station_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0) { DialogStation diglog = new DialogStation(false, Convert.ToInt32(this.DataGridView_Station.Rows[e.RowIndex].Cells["ID"].Value), this.mainform); diglog.ShowDialog(this); } }
private void btn_Update_Click(object sender, EventArgs e) { if (this.DataGridView_Station.SelectedRows.Count > 0) { DialogStation diglog = new DialogStation(true, Convert.ToInt32(this.DataGridView_Station.SelectedRows[0].Cells["ID"].Value), this.mainform); diglog.ShowDialog(this); } else { MessageBox.Show("请先选择一个您要查看的基站。", "详细信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btn_New_Click(object sender, EventArgs e) { //if (Global.IsTempVersion && DB_Service.MainDataSet.Tables["StationTable"].Rows.Count >= 5) //{ // MessageBox.Show("对不起,您的软件为演示版。基站数目不能超过4个。请购买正式版本。", "新建基站", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; //} DialogStation diglog = new DialogStation(this.mainform); diglog.ShowDialog(this); label_AllStation.Text = "共有基站 " + DB_Service.MainDataSet.Tables["StationTable"].Rows.Count.ToString() + " 个"; }
/// <summary> /// 通过指定的StationID初始化本窗体默认显示的基站 /// </summary> /// <param name="DataGridViewIndex"></param> public void ShowStationInfoByID(int stationID) { DialogStation diglog = new DialogStation(false, stationID, this.mainform); diglog.ShowDialog(this); }