Exemplo n.º 1
0
        private void AddFieldCodes_Click(object sender, EventArgs e)
        {
            int i, q;

            ListViewItem item;
            ComboboxItem CItem = (ComboboxItem)Fields.Items[Fields.SelectedIndex];

            i = (int)CItem.Value;
            FieldCodes DatabaseFieldCodesStuff = new FieldCodes(DatabaseName.Text, "", "", i);

            DatabaseFieldCodesStuff.ShowDialog();
            if (DatabaseFieldCodesStuff.LocalSave)
            {
                item = DatabaseGrid.Items.Add(DatabaseFieldCodesStuff.LocalFieldCode);
                item.SubItems.Add(DatabaseFieldCodesStuff.LocalFieldCodeDescription);

                for (q = 0; q < Dimensioned; q = q + 2)
                {
                    if (string.IsNullOrEmpty(StoredStuff[i, q]))
                    {
                        StoredStuff[i, q]     = DatabaseFieldCodesStuff.LocalFieldCode;
                        StoredStuff[i, q + 1] = DatabaseFieldCodesStuff.LocalFieldCodeDescription;
                        item.Tag = q;
                        break;
                    }
                }
                Save.Enabled = true;
            }
        }
Exemplo n.º 2
0
        private void DatabaseGrid_DoubleClick(object sender, EventArgs e)
        {
            int          index, index1;
            ComboboxItem comboitem = new ComboboxItem();

            comboitem = (ComboboxItem)Fields.Items[Fields.SelectedIndex];
            index     = (int)comboitem.Value;

            ListViewItem item = DatabaseGrid.SelectedItems[0];

            index1 = (int)item.Tag;
            FieldCodes DatabaseFieldCodesStuff = new FieldCodes(DatabaseName.Text, StoredStuff[index, index1], StoredStuff[index, index1 + 1], index);

            DatabaseFieldCodesStuff.ShowDialog();
            if (DatabaseFieldCodesStuff.LocalSave)
            {
                StoredStuff[index, index1]     = DatabaseFieldCodesStuff.LocalFieldCode;
                StoredStuff[index, index1 + 1] = DatabaseFieldCodesStuff.LocalFieldCodeDescription;
                Save.Enabled = true;
            }
            FillDataBaseGrid();
        }