/// <summary> /// 默认不可编辑 /// </summary> /// <param name="bEditable"></param> public void SetEditable(bool bEditable = false) { btnDelete.Visible = bEditable; if (bEditable) { // 如果是管理员的话 FormHelper.InitUserModeEvent(this); } }
public CDatabaseConfigForm() { InitializeComponent(); InitUI(); InAdvanceMode(m_bIsAdvanceMode); this.cmb_DatabaseType.SelectedIndex = 0; m_bIsAdvanceMode = false; FormHelper.InitUserModeEvent(this); this.chkChangeDBConfig.Checked = false; this.chkChangeDBConfig_CheckedChanged(this.chkChangeDBConfig, null); }
public CUserMgrForm() { InitializeComponent(); InitUI(); InitDataSource(); // 绑定消息 this.FormClosing += new FormClosingEventHandler(this.EH_FormClosing); FormHelper.InitUserModeEvent(this); }
public CStationDataAddForm() { InitializeComponent(); InitUI(); m_currentStation = null; m_entityRain = null; m_entityVoltage = null; m_entityWater = null; FormHelper.InitUserModeEvent(this); }
/// <summary> /// 设置当前模式,默认是查询模式 /// </summary> /// <param name="bEditable">是否可编辑</param> public void SetEditable(bool bEditable) { m_bIsEditable = bEditable; if (m_bIsEditable) { // 如果可以编辑,调整位置 Point pNewRecord = btnNewRecord.Location; btnNewRecord.Location = btnExit.Location; btnExit.Location = pNewRecord; btnNewRecord.Visible = true; btnApply.Visible = true; //cmbQueryInfo.Items.Add(CS_CMB_SoilData); // 将控件启用编辑状态 m_dgvRain.Editable = true; m_dgvWater.Editable = true; m_dgvVoltage.Editable = true; m_dgvSoilData.Editable = true; this.Text = "数据校正"; labelInfoSelect.Text = "配置检索信息"; FormHelper.InitUserModeEvent(this); } else { //cmbQueryInfo.Items.Add(CS_CMB_SoilData); // 不可以编辑,判断当前的位置 m_dgvRain.Editable = false; m_dgvVoltage.Editable = false; m_dgvWater.Editable = false; m_dgvSoilData.Editable = false; if (btnNewRecord.Visible) { // 如果由编辑模式调整为非编辑模式,需要调整退出按钮的位置 Point pNewRecord = btnNewRecord.Location; btnNewRecord.Location = btnExit.Location; btnExit.Location = pNewRecord; btnNewRecord.Visible = false; btnApply.Visible = false; this.Text = "数据查询"; labelInfoSelect.Text = "配置查询信息"; } else { btnApply.Visible = false; btnNewRecord.Visible = false; } }//end of bIsEditable }
public CWaterFlowMapForm() { InitializeComponent(); m_listImport = new List <CEntityWaterFlowMap>(); lastTime = new DateTime(); lastCurrQ = 0; try { InitDataSource(); InitUI(); } catch (Exception exp) { }; FormHelper.InitUserModeEvent(this); }
public CWaterFlowMapForm() { InitializeComponent(); m_listImport = new List <CEntityWaterFlowMap>(); lastTime = new DateTime(); lastCurrQ = 0; try { InitDataSource(); InitUI(); } #pragma warning disable CS0168 // 声明了变量“exp”,但从未使用过 catch (Exception exp) { }; #pragma warning restore CS0168 // 声明了变量“exp”,但从未使用过 FormHelper.InitUserModeEvent(this); }
public CSerialPortConfigForm() { InitializeComponent(); Init(); FormHelper.InitUserModeEvent(this); }
public CProtocolConfigForm(bool bIsInChannelType = true) { InitializeComponent(); m_bIsInChannelType = bIsInChannelType; this.txt_ChannelProtocolName.Enabled = false; this.txt_ChannelProtocolName.ReadOnly = true; this.txt_DataProtocolName.ReadOnly = true; this.txt_DataProtocolName.Enabled = false; m_openFileDialog.Filter = "库文件(*.dll)|*.dll|所有文件(*.*)|*.*"; m_openFileDialog.RestoreDirectory = true; if (m_bIsInChannelType) { m_openFileDialog.Title = "选择通讯方式"; this.lbl_ClassNames.Visible = false; this.lbl_Interfaces.Visible = false; this.cmb_ClassNames.Visible = false; this.cmb_Interfaces.Visible = false; this.txt_ChannelClassName.Visible = false; this.lbl_ChannelClassName.Visible = false; this.lbl_ToolTip1.Visible = false; this.Text = "通讯方式配置"; } else { m_openFileDialog.Title = "选择数据协议"; this.lbl_ClassNames.Visible = false; this.lbl_Interfaces.Visible = false; this.cmb_ClassNames.Visible = false; this.cmb_Interfaces.Visible = false; this.lbl_ToolTip2.Visible = false; this.lbl_DataFlash.Visible = false; this.lbl_DataUDisk.Visible = false; this.lbl_DataUp.Visible = false; this.lbl_DataDown.Visible = false; this.txt_DataUDisk.Visible = false; this.txt_DataUp.Visible = false; this.txt_DataFlash.Visible = false; this.txt_DataDown.Visible = false; this.Text = "数据协议配置"; } //m_openFileDialog.InitialDirectory = @"E:\陈乐宁相关\水文监测\HelloWorld.1228\MDITest\bin\Debug"; m_mapChannelInfo = new Dictionary <string, XmlDllInfo>(); m_mapClassInterface = new Dictionary <string, string>(); panel4DataAdd.Visible = false; panel4ChannelAdd.Visible = false; this.cmb_ChannelInterfaceNames.Items.Add(GetInterfaceNameWithoutNamespace(CS_DEFINE.I_CHANNEL_Transparen)); this.cmb_ChannelInterfaceNames.Items.Add(GetInterfaceNameWithoutNamespace(CS_DEFINE.I_CHANNEL_GSM)); this.cmb_ChannelInterfaceNames.Items.Add(GetInterfaceNameWithoutNamespace(CS_DEFINE.I_CHANNEL_GPRS)); this.cmb_ChannelInterfaceNames.Items.Add(GetInterfaceNameWithoutNamespace(CS_DEFINE.I_CHANNEL_HDGPRS)); this.cmb_ChannelInterfaceNames.Items.Add(GetInterfaceNameWithoutNamespace(CS_DEFINE.I_CHANNEL_BEIDOU_NORMAL)); this.cmb_ChannelInterfaceNames.Items.Add(GetInterfaceNameWithoutNamespace(CS_DEFINE.I_CHANNEL_BEIDOU_500)); this.cmb_ChannelInterfaceNames.Items.Add(GetInterfaceNameWithoutNamespace(CS_DEFINE.I_CHANNEL_CABLE)); this.cmb_ChannelInterfaceNames.DropDownStyle = ComboBoxStyle.DropDownList; this.cmb_ChannelInterfaceNames.SelectedIndex = 0; m_iPreProtocolSelectedIndex = -1; LoadData(); FormHelper.InitUserModeEvent(this); }
public CSubStationMgrForm() { InitializeComponent(); Init(); FormHelper.InitUserModeEvent(this); }
public CWebGsmConfigForm() { InitializeComponent(); Init(); FormHelper.InitUserModeEvent(this); }