示例#1
0
        // adding this section for the new constructor module, that should make the old version obsolete.
        private void original_key_format(ACH_FILE search_file)
        {
            this.working_file = search_file;
            foreach (Tuple <string, string> a in working_file.entryAddenda.Keys)
            {
                string my_key = $"{a.Item1},\t{ENTRY_FORM.padding_router("Amount     ", a.Item2, true)}";
                try
                {
                    display_keys.Add(my_key, a); // update with the new keys amount.
                }
                catch (Exception e)
                {
#if UPDATE_20190807
                    Program.encountered_Exceptions.Add(e);
#endif
                    string e_Key        = $"{my_key}";
                    int    allowed_runs = 100;
                    bool   m            = false;
                    while (m != true)
                    {
                        try
                        {
                            e_Key = $"[DUPLICATE]{e_Key}";
                            display_keys.Add(e_Key, a); // this should be fine.
                            m = true;
                            break;                      // not relying on the system to work correctly.
                        }
                        catch (Exception e2)
                        {
#if UPDATE_20190807
                            Program.encountered_Exceptions.Add(e2);
#endif
                            // this would be the alternative.
                            if (allowed_runs <= 0)
                            {
                                break;
                            }
                            allowed_runs--;
                        }
                    }
                }
            }
        }
示例#2
0
 /// <summary>
 /// use this instead of the "ShowDialog" method.
 /// </summary>
 /// <param name="search_file"></param>
 public void InterruptShowDialog(ACH_FILE search_file)
 {
     original_key_format(search_file); // these versions should keep *most* of the behavior the same
     Interrupt();
     this.ShowDialog();
 }
示例#3
0
 /// <summary>
 /// Use this instead of the "Show" method.
 /// </summary>
 /// <param name="search_file"></param>
 public void InterruptShow(ACH_FILE search_file)
 {
     original_key_format(search_file);
     Interrupt();
     this.Show();
 }
示例#4
0
        // UPDATING 7-18-2019 - removing some of the input parameters (reforming through preprocessor commands.
        // allowing these commands to be processed later will allow us to construct most of the form, while separating it from the underlying code.
        /// <summary>
        ///
        /// </summary>
        public ACCESS_RECORD(
#if UPDATE_20190718
#else
            ACH_FILE search_file
#endif
            )
        {
            this.display_keys = new Dictionary <string, Tuple <string, string> >(); // forgot that this needed to be initialized.
#if UPDATE_20190718
            // following portion immediately attempts to establish the keys on initialization -
            // we're going to set up a process to set the keys up as a prerequisite to display -
            // possibly with an override to the "Show()" and "ShowDialog()" methods.
#else
            this.working_file = search_file;
            foreach (Tuple <string, string> a in working_file.entryAddenda.Keys)
            {
                // this is the location that causes an issue.
                // set it up to pretty print the amount and pair with the name.
                // it almost looked like item 2 was assigned as amount.

                /*
                 */
                string my_key = $"{a.Item1},\t{ENTRY_FORM.padding_router("Amount     ", a.Item2, true)}";
                try
                {
                    display_keys.Add(my_key, a); // update with the new keys amount.
                }
                catch (Exception e)
                {
                    // we'll, I would think this should capture the duplicate keys.
                    // looks like this case is that key is duplicate - we'll need to adjust the key.
                    my_key = $"[DUPLICATE]{my_key}";
                    display_keys.Add(my_key, a);
                }// this will help identify duplicates while we're at it.
            }
#endif
            // this function has been modified in the 20190723 update.
            InitializeComponent();

            this.label1.Text  = "Selected Record";
            this.label2.Text  = "Original Names and Amounts:";
            this.label3.Text  = "Amounts to left will show the original names and amounts remaining\nin the file. As you add and delete, they will appear to the left.\nEdits can be viewed in the window above.";
            this.button1.Text = "Edit";
            this.button2.Text = "Save and Quit";
            this.button3.Text = "Add";
            this.button4.Text = "Delete";
#if UPDATE_20190723
#if UPDATE_20190725
            foreach (Control c in this.Controls)
            {
                Program.set_font(c); // let's see if this works.
            }
#if UPDATE_20190807
            //this.label4.Text = "File Hash";
            this.label4.Text       = "File Credit Amount"; // we'll do the same output for this as we did with the debit.
            this.label5.Text       = "File Debit Amount";  // focusing on how much we are drafting, not paying (for now);
            this.textBox2.ReadOnly = true;
            this.textBox3.ReadOnly = true;                 // we'll need to add some update methods.
#endif
#endif

            this.button5.Text   = "Search";
            this.button5.Click += searchInteractionClick;

            // let's try this on for size.
            // we're going to need to outsource these as a function...
            //this.listBox1.Font = new System.Drawing.Font("Consolas",10);
#endif

            this.textBox1.Multiline  = true;
            this.textBox1.ScrollBars = ScrollBars.Horizontal;
            this.textBox1.ReadOnly   = true;

            this.listBox1.SelectedIndexChanged += ListBoxItemClick;// let's give this a go
            //
            foreach (string a in this.display_keys.Keys)
            {
                listBox1.Items.Add(a);
            }

            foreach (Control c in this.Controls)
            {
                if (c.Name.Contains("button"))
                {
                    c.Click += ButtonObjectClick; // this should handle all of the clicks in a centralized place.
                }
            }
        }