Exemplo n.º 1
0
        private void btnAddKanJi_Click(object sender, EventArgs e)
        {
            FormFieldKanJi frm = new FormFieldKanJi(null);

            if (frm.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            Level3KanJiReplacementRuleItem f = frm.Field;

            if (f == null)
            {
                return;
            }

            foreach (Level3KanJiReplacementRuleItem field in Program.ServiceMgt.Config.L3KanJiReplacement.Fields)
            {
                if (field.Table == f.Table &&
                    field.FieldName == f.FieldName)
                {
                    MessageBox.Show(this, "Field " + f.ToString() + " is already in the list.", "Warning",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }

            Program.ServiceMgt.Config.L3KanJiReplacement.Fields.Add(f);
            RefreshFieldKanJiList();
        }
Exemplo n.º 2
0
        private void EditKanJi()
        {
            if (this.listViewKanJi.SelectedItems.Count < 1)
            {
                return;
            }
            Level3KanJiReplacementRuleItem f = this.listViewKanJi.SelectedItems[0].Tag as Level3KanJiReplacementRuleItem;

            if (f == null)
            {
                return;
            }
            FormFieldKanJi frm = new FormFieldKanJi(f);

            if (frm.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            RefreshFieldKanJiList();
        }