Example #1
0
 private void btn_Save_Click(object sender, EventArgs e)
 {
     try
     {
         int j = side_number.Items.Count;
         values = new ArrayList();
         Description_of_values  = new ArrayList();
         card_Format_for_values = new ArrayList();
         for (int i = 0; i < dataGridView1.Rows.Count; i++)
         {
             string val         = (string)dataGridView1[0, i].Value;
             string desc_of_val = (string)dataGridView1[1, i].Value;
             string card_val    = (string)dataGridView1[2, i].Value;
             if ((val == null) || (desc_of_val == null) || (card_val == null))
             {
                 MessageBox.Show("Please fill in all the fields in this grid.");
                 return;
             }
             values.Add(val);
             Description_of_values.Add(desc_of_val);
             card_Format_for_values.Add(card_val);
         }
         if (deck_id == 0)
         {
             importscreen4 imp = new importscreen4(FirstForm, this, filename, num_of_items, array_delimiter,
                                                   values, card_Format_for_values,
                                                   Description_of_values);
             imp.Show();
             this.Visible = false;
         }
         else
         {
             importscreen5 imp = new importscreen5(FirstForm, this, filename, num_of_items, array_delimiter,
                                                   values, card_Format_for_values,
                                                   Description_of_values, deck_id);
             imp.Show();
             this.Visible = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #2
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {

                int j = side_number.Items.Count;
                values = new ArrayList();
                Description_of_values = new ArrayList();
                card_Format_for_values = new ArrayList();
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    string val = (string) dataGridView1[0, i].Value;
                    string desc_of_val = (string)dataGridView1[1, i].Value;
                    string card_val = (string)dataGridView1[2, i].Value;
                    if ((val == null) || (desc_of_val == null) || (card_val == null))
                    {
                        MessageBox.Show("Please fill in all the fields in this grid.");
                        return;
                    }
                    values.Add(val);
                    Description_of_values.Add(desc_of_val);
                    card_Format_for_values.Add(card_val);

                }
                if (deck_id == 0)
                {
                    importscreen4 imp = new importscreen4(FirstForm, this, filename, num_of_items, array_delimiter,
                                                          values, card_Format_for_values,
                                                          Description_of_values);
                    imp.Show();
                    this.Visible = false;
                }
                else
                {
                    importscreen5 imp = new importscreen5(FirstForm, this, filename, num_of_items, array_delimiter,
                                                          values, card_Format_for_values,
                                                          Description_of_values, deck_id);
                    imp.Show();
                    this.Visible = false;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }