public AddConnector(string title, bool IsEdit, string connectorType, string switchType, string remark) { InitializeComponent(); this.StartPosition = FormStartPosition.CenterParent; this.Text = title; connectorLibraryManager = new TConnectorLibraryManager(); connectorLibraryDetailManager = new TConnectorLibraryDetailManager(); if (IsEdit) { this.tb_connectorType.Text = connectorType; this.tb_switchType.Text = switchType; this.tb_remark.Text = remark; this.tb_connectorType.ReadOnly = true; RefreshPin(connectorType); } RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, 2); this.btn_applay.Click += Btn_applay_Click; this.btn_cancel.Click += Btn_cancel_Click; this.btn_addPin.Click += Btn_addPin_Click; this.btn_batchAddpin.Click += Btn_batchAddpin_Click; this.btn_deletePin.Click += Btn_deletePin_Click; this.btn_deleteAllPin.Click += Btn_deleteAllPin_Click; }
private void Menu_importFromConnectorType_Click(object sender, EventArgs e) { if (!IsValidInterfaceNO()) { return; } ImportInterfacePointByConnector importConnector = new ImportInterfacePointByConnector(); if (importConnector.ShowDialog() == DialogResult.OK) { var testMethod = importConnector.testMethod; var connectorType = importConnector.connectorType; TConnectorLibraryDetailManager connectorLibraryManager = new TConnectorLibraryDetailManager(); var dt = connectorLibraryManager.GetDataSetByFieldsAndWhere("InterfacePointName", $"where ConnectorName='{connectorType}'").Tables[0]; if (dt.Rows.Count < 1) { return; } int iRow = 1; if (testMethod == "二线法") { foreach (DataRow dr in dt.Rows) { var interfacePointValue = dr["InterfacePointName"].ToString(); var switchPointNo = iRow; if (IsExistSwitchPointNo(interfacePointValue, switchPointNo.ToString(), testMethod)) { return; } AddGridViewRow(interfacePointValue, testMethod, switchPointNo.ToString(), connectorType); iRow++; } } else if (testMethod == "四线法") { foreach (DataRow dr in dt.Rows) { var interfacePointValue = dr["InterfacePointName"].ToString(); var switchPointNo = iRow + "," + (iRow + 1); if (IsExistSwitchPointNo(interfacePointValue, switchPointNo.ToString(), testMethod)) { return; } AddGridViewRow(interfacePointValue, testMethod, switchPointNo.ToString(), connectorType); iRow += 2; } } } }
public RadConnectorLibrary() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterParent; RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, 5); connectorLibraryManager = new TConnectorLibraryManager(); connectorLibraryDetailManager = new TConnectorLibraryDetailManager(); InitFuncState(); this.tool_add.Click += Tool_add_Click; this.tool_delete.Click += Tool_delete_Click; this.tool_query.Click += Tool_query_Click; this.tool_edit.Click += Tool_edit_Click; this.tool_export.Click += Tool_export_Click; }