private void bunifuThinButton21_Click(object sender, EventArgs e) { aaaForm1 a = (aaaForm1)Application.OpenForms["aaaForm1"]; string sifre = "12345"; if (textbox1.Text.Equals(sifre)) { if (ney_olsun == 0) { double toplam = 0; for (int i = 0; i < a.dataGridView1.RowCount; i++) { string veri = a.dataGridView1.Rows[i].Cells[2].Value.ToString().Trim(); if (!veri.Equals("")) { double sayi = Convert.ToDouble(veri); toplam += sayi; } } MessageBox.Show("Toplam tutar: " + toplam); } else if (ney_olsun == 1) { DialogResult dialogResult = MessageBox.Show("Tüm siparişleri silmek istediğinizden emin misiniz ?", "Uyarı !", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { veritabani_islemleri vt = new veritabani_islemleri(); vt.butun_verileri_sil(); } } } }
void doldur() { veritabani_islemleri a = new veritabani_islemleri(); DataTable tablo = a.verileri_ver(); dataGridView1.DataSource = tablo; }
private void bunifuThinButton21_Click(object sender, EventArgs e) { veritabani_islemleri a = new veritabani_islemleri(); bool sonuc = a.giris(textBox1.Text, textBox2.Text); if (sonuc) { aaaForm1 b = new aaaForm1(); b.Show(); this.Hide(); } else { bunifuCustomLabel1.Visible = true; } }
private void button2_Click(object sender, EventArgs e) { veritabani_islemleri islem = new veritabani_islemleri(); if (a.Text.Trim() == "") { MessageBox.Show("İsim girmediniz"); } else { string alinanlar = ""; frm_musteri form = (frm_musteri)Application.OpenForms["frm_musteri"]; ListBox lst = (ListBox)form.Controls.Find("lst_alınanlar", true)[0]; for (int i = 0; i < lst.Items.Count; i++) { alinanlar += lst.Items[i].ToString().Trim() + ","; } if (alinanlar.Contains(",")) { alinanlar = alinanlar.Substring(0, alinanlar.LastIndexOf(",")); } string eksta = ""; if (checkBox1.Checked) { eksta += " , " + checkBox1.Text; } if (checkBox2.Checked) { eksta += " , " + checkBox2.Text; } if (checkBox3.Checked) { eksta += " ," + checkBox3.Text; } if (radioButton1.Checked) { eksta += " , " + radioButton1.Text; } if (radioButton2.Checked) { eksta += " , " + radioButton2.Text; } if (eksta.Contains(",")) { eksta = eksta.Trim(); eksta = eksta.Substring(1); } bool kayit = islem.siparis_kaydet(a.Text, b.Text, alinanlar, eksta); if (kayit == true) { MessageBox.Show("Siparişiniz verildi. Lütfen isminiz söylenene kadar bekleyiniz"); frm_musteri frm = (frm_musteri)Application.OpenForms["frm_musteri"]; frm.anasayfayi_ac(); frm.txt_hesap_goster.Clear(); a.Clear(); b.Clear(); lst_alınanlar.Items.Clear(); } else { MessageBox.Show("Teknik bir sıkıntı oluştu. Lütfen kasiyere haber veriniz"); } } }