예제 #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();
            }
        }
예제 #2
0
        private void provider_addbutton_Click(object sender, EventArgs e)
        {
            ProviderAddEdit providerChange = new ProviderAddEdit();

            this.Hide();
            providerChange.ShowDialog();
            update();
            this.Show();
        }
예제 #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();
            }
        }
예제 #4
0
        private void provider_editbuttom_Click(object sender, EventArgs e)
        {
            ProviderAddEdit providerChange = new ProviderAddEdit();

            providerChange.id.Text           = dataGrid_provider.CurrentRow.Cells[0].Value.ToString();
            providerChange.tCompanyName.Text = dataGrid_provider.CurrentRow.Cells[1].Value.ToString();
            providerChange.tCity.Text        = dataGrid_provider.CurrentRow.Cells[2].Value.ToString();
            providerChange.tStreet.Text      = dataGrid_provider.CurrentRow.Cells[3].Value.ToString();
            providerChange.tHouseNumber.Text = dataGrid_provider.CurrentRow.Cells[4].Value.ToString();
            providerChange.tPhone.Text       = dataGrid_provider.CurrentRow.Cells[5].Value.ToString();
            providerChange.tEmail.Text       = dataGrid_provider.CurrentRow.Cells[6].Value.ToString();


            this.Hide();
            providerChange.ShowDialog();
            if (provider_editbuttom.Text == "Изменить")
            {
                Connection.queryExecute(@"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 + ";");
            }
            update();
            this.Show();
        }