/// <summary> /// 保存按钮 /// </summary> private void BtnSave_Click(object sender, EventArgs e) { if (dataGridView.Rows.Count == 1) { DialogUtils.ShowDialogWarning("未添加任何数据"); return; } string count = tbButtonCountPerRow.Text.Trim(); if (count.Equals("")) { DialogUtils.ShowDialogWarning("未填写每行按钮数"); return; } int countInt = -1; if (!int.TryParse(count, out countInt)) { DialogUtils.ShowDialogWarning("每行按钮数量填写格式有误"); return; } string fieldDlbm = tbDlbmFieldName.Text = tbDlbmFieldName.Text.Replace(" ", ""); string fieldDlmc = tbDlmcFieldName.Text = tbDlmcFieldName.Text.Replace(" ", ""); //if (fieldDlbm.Equals("") || fieldDlmc.Equals("")) //{ // DialogUtils.ShowDialogWarning("字段名称不允许为空"); // return; //} Save(countInt); _actionSave.Invoke(); Close(); }
private void btnSave_Click(object sender, EventArgs e) { string fieldName = tbFieldName.Text = tbFieldName.Text.Trim(); string fieldValue = tbFieldName.Text = tbFieldValue.Text.Trim(); try { File.WriteAllText(Config.PATH_BZ_CONFIG_FILE, fieldName + "," + fieldValue); _actionSave.Invoke(fieldName, fieldValue); Close(); } catch (Exception) { DialogUtils.ShowDialogWarning("配置文件保存失败,请关闭可能占用的应用程序后重试"); } }
private void BtnAdd_Click(object sender, EventArgs e) { string dlbm = tbDlbm.Text = tbDlbm.Text.Trim(); string dlmc = tbDlmc.Text = tbDlmc.Text.Trim(); if (dlbm.Contains(' ')) { DialogUtils.ShowDialogWarning("地类编码包含空格"); return; } if (dlmc.Contains(' ')) { DialogUtils.ShowDialogWarning("地类名称包含空格"); return; } _actionAddNewRow.Invoke(dlbm, dlmc); // _actionAddNewRow(dlbm, dlmc); Close(); }
private void btnBz_Click(object sender, EventArgs e) { Init(); try { if (Config._currentLayerName == null || Config._currentLayerName.Equals("")) { DialogUtils.ShowDialogWarning("未选择图层,请在赋值界面选择图层"); return; } if (_fieldName == null || _fieldName == null) { DialogUtils.ShowDialogWarning("未设置字段名和字段值"); return; } IEnumLayer layers = Utils.getFeatureLayers(mMap); if (layers == null || layers.Next() == null) { Utils.ShowDialogWarning("没有矢量图层"); return; } if (Config._currentLayerName == null || Config._currentLayerName.Equals("")) { Utils.ShowDialogWarning("请先选择图层"); return; } if (mDocument != null) { Utils.setValue(mMap, Config._currentLayerName, _fieldName, _fieldValue); //Utils.setValue(mMap, _currentLayerName, _fieldNameDlbm, vals[0], true, 400); mDocument.ActiveView.Refresh(); } } catch (Exception) { throw; } }