public static void Arama(SqlCommand komut, DosyaBul form)
        {
            komut.Connection = baglan;
            baglan.Open();
            SqlDataAdapter da = new SqlDataAdapter(komut);
            DataTable      dt = new DataTable();

            da.Fill(dt);
            form.bulunanDataGrid.DataSource = dt;
            baglan.Close();
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (true == sayiKontrol(txtDosyaNo.Text) && txtDosyaNo.Text != "")
            {
                sevkDataView.Rows.Clear();
                SqlCommand sqlCommand = new SqlCommand();
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.CommandText = "hastaBilgi";
                sqlCommand.Parameters.Add("@dosyaNo", int.Parse(txtDosyaNo.Text));

                hasta = DatabaseControl.hastaGetir(sqlCommand);
                cmBoxOncekiIslemler.Items.Clear();
                Sevk.oncekiIslemler(txtDosyaNo.Text, this, cmBoxOncekiIslemler);
                /* Sonradan eklenen kod */
                //
                sevkDataView.Rows.Clear();
                //

                toplamTutarHesap();
                // Sevk.SevkleriGetir(txtDosyaNo.Text, this);
                if (hasta != null)
                {
                    Hasta.BilgiGoster(this, hasta);
                }
                else
                {
                    MessageBox.Show("Bu dosya numarası yok");
                }
            }
            else
            {
                if (txtDosyaNo.Text == "")
                {
                    DosyaBul dosyaBul = new DosyaBul();
                    dosyaBul.Show();
                }
                else
                {
                    MessageBox.Show("Bir dosya numarası giriniz..");
                }
            }

            //DosyaBul dosyaBul = new DosyaBul();

            //dosyaBul.Show();
        }