Esempio n. 1
0
        private void addNewRecord()
        {
            int[] values = new int[record_size];
            labelStatus.Content = "";
            try
            {
                int key = Int32.Parse(textBoxKey.Text);

                values[0] = Int32.Parse(textBoxFirst.Text); values[1] = Int32.Parse(textBoxSecond.Text);
                values[2] = Int32.Parse(textBoxThird.Text); values[3] = Int32.Parse(textBoxFourth.Text);
                values[4] = Int32.Parse(textBoxFifth.Text); values[5] = Int32.Parse(textBoxSixth.Text);
                values[6] = Int32.Parse(textBoxSeventh.Text); values[7] = Int32.Parse(textBoxEighth.Text);
                values[8] = Int32.Parse(textBoxNineth.Text); values[9] = Int32.Parse(textBoxTenth.Text);

                if (action == 'N')
                {
                    savesCounter = 0;
                    loadsCounter = 0;
                    if (key > 0)
                    {
                        c = new MyRecord(key, values);
                        logic.addRecord(c, ref savesCounter, ref loadsCounter);
                    }
                }
                else if (action == 'E')
                {
                    c = new MyRecord(key, values, c.getOverflowPointer(), c.isDeleted());
                    logic.Edit(c, FileName);
                }
            }
            catch (Exception ex)
            {
                labelStatus.Content = "Błąd!";
            }
        }
Esempio n. 2
0
        private void addRecordButton_Click(object sender, RoutedEventArgs e)
        {
            Random r   = new Random();
            int    loa = 0;
            int    sav = 0;

            int i = r.Next(1, 100);

            int[]    values = newTable(i);
            MyRecord c      = new MyRecord(i, values);

            logic.addRecord(c, ref sav, ref loa);
        }