private void btnAddSubscribers_Click(object sender, EventArgs e)
 {
     if (id_subscriber != -1)
     {
         // Edit Subscriber
         FablabDB.editSubscriber(id_subscriber,
                                 txtName.Text,
                                 txtSurname.Text,
                                 txtDateOfBirth.Text,
                                 txtAddress.Text,
                                 txtCity.Text,
                                 txtCountry.Text,
                                 txtPostcode.Text,
                                 txtTelephone.Text,
                                 txtEmail.Text);
     }
     else
     {
         // New Subscriber
         FablabDB.addSubscriber(txtName.Text,
                                txtSurname.Text,
                                txtDateOfBirth.Text,
                                txtAddress.Text,
                                txtCity.Text,
                                txtCountry.Text,
                                txtPostcode.Text,
                                txtTelephone.Text,
                                txtEmail.Text);
     }
     Close();
 }
Exemple #2
0
        private void btnDeleteSubscriber_Click(object sender, EventArgs e)
        {
            FablabDB.deleteSubscriber(dataGridViewSubscribers.CurrentRow.Index);
            //int (dataGridViewSubscribers.CurrentRow.Index);
            ////string MyString = "\n";
            ////Console.WriteLine("Hello{0}World!", MyString);
            ////string TrimString = MyString.Trim();
            ////Console.WriteLine("Hello{0}World!", TrimString);
            //////       The example displays the following output:
            //////             Hello Big   World!
            //////             HelloBigWorld!

            //char[] charsToTrim = { ' ' };
            //string banner = "Much Ado \n AboutNothing\n ciao";

            //QUI                \/

            //banner = banner.Replace("\n", " ");

            //QUI                /\

            //string result = banner.Trim(charsToTrim);
            //Console.WriteLine("Trimmmed\n   {0}\nto\n   '{1}'", banner, result);
            //// The example displays the following output:
            ////       Trimmmed
            ////          *** Much Ado About Nothing ***
            ////       to
            ////


            //Console.ReadLine();

            //USAR . REPLACE CHE TOGLIE OGNI \N CON ALTRO (NULL)
        }
 private void Subscriber_Load(object sender, EventArgs e)
 {
     if (id_subscriber != -1)
     {
         // Edit Subscriber
         string[] subscriber_array = new string[8];
         btnAddSubscribers.Text = "Edit";
         subscriber_array       = FablabDB.loadSubsciber(id_subscriber);
         txtName.Text           = subscriber_array[0];
         txtSurname.Text        = subscriber_array[1];
         txtDateOfBirth.Text    = subscriber_array[2];
         txtAddress.Text        = subscriber_array[3];
         txtCity.Text           = subscriber_array[4];
         txtCountry.Text        = subscriber_array[5];
         txtPostcode.Text       = subscriber_array[6];
         txtTelephone.Text      = subscriber_array[7];
         txtEmail.Text          = subscriber_array[8];
     }
 }
Exemple #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     FablabDB.deleteAllFile();
 }
Exemple #5
0
 private void MainWindow_Load(object sender, EventArgs e)
 {
     FablabDB.startController();
     FablabDB.showAllSubscribers();
     updateGridSubscribers();
 }