Example #1
0
        private void provider_addbutton_Click(object sender, EventArgs e)
        {
            ProviderAddEdit providerChange = new ProviderAddEdit();

            providerChange.tCompanyName.Clear();
            providerChange.tCity.Clear();
            providerChange.tStreet.Clear();
            providerChange.tHouseNumber.Clear();
            providerChange.tPhone.Clear();
            providerChange.tEmail.Clear();

            if (providerChange.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ConnectionDB.executeQuery(@"insert into [Provider] (companyName,city,street,houseNumber,phone,email)  VALUES(N'"
                                          + providerChange.tCompanyName.Text + "',N'" + providerChange.tCity.Text + "',N'" + providerChange.tStreet.Text + "',N'" + providerChange.tHouseNumber.Text + "',N'" + providerChange.tPhone.Text + "',N'" + providerChange.tEmail.Text + "');");

                providerTableAdapter.Update(this.medicineCentreDataSet.Provider);
                providerBindingSource.EndEdit();
                ConnectionDB.executeQuery(@"select * from [Provider];");
            }
            else
            {
                providerBindingSource.CancelEdit();
            }
        }
Example #2
0
        private void provider_addbutton_Click(object sender, EventArgs e)
        {
            ProviderAddEdit providerChange = new ProviderAddEdit();

            this.Hide();
            providerChange.ShowDialog();
            update();
            this.Show();
        }
Example #3
0
        private void provider_editbuttom_Click(object sender, EventArgs e)
        {
            ProviderAddEdit providerChange = new ProviderAddEdit();

            if (providerChange.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ConnectionDB.executeQuery(@"update [Provider] set companyName=N'" + providerChange.tCompanyName.Text + "' , city =N'" + providerChange.tCity.Text + "' , street =N'" + providerChange.tCity.Text + "' , houseNumber =N'" + providerChange.tHouseNumber.Text + @"' , phone ='" + providerChange.tPhone.Text + "', email ='" + providerChange.tEmail.Text + "'  where id=" + dataGrid_provider.CurrentRow.Cells[0].Value + ";");
                providerTableAdapter.Update(this.medicineCentreDataSet.Provider);
                providerBindingSource.EndEdit();
            }
        }