private void Taksitle_click(object sender, RoutedEventArgs e) { if (id[0] == 0) { MessageBox.Show("Satir secin !"); } else { int i = 0; for (i = 0; id[i] != 0; i++) { Taksitle_basla(id[i].ToString()); } for (i = 0; i < 50; i++) { id[i] = 0; } sayi = 0; MessageBox.Show("Seçimler sifirlandi"); show = true; Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); textBlock.Text = "Secilen IDler: "; } }
public MainWindow() { InitializeComponent(); hepsini_kapat(); Ad_TextBox.Background = Brushes.LightSteelBlue; Soyad_textbox.Background = Brushes.LightSteelBlue; Telefon_Texbox.Background = Brushes.LightSteelBlue; KartNo_TextBox.Background = Brushes.LightSteelBlue; Email_TextBox.Background = Brushes.LightSteelBlue; Adres_TextBox.Background = Brushes.LightSteelBlue; Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }
public Window2() { InitializeComponent(); Mcc_comboBox.Items.Add("Bakkal"); Mcc_comboBox.Items.Add("Kırtasiye"); Mcc_comboBox.Items.Add("Giyim"); Mcc_comboBox.Items.Add("Otomobil"); Mcc_comboBox.Items.Add("Züccaciye"); kapat(); musteri_ekle(); Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }
private void Guncelle_click(object sender, RoutedEventArgs e) { if (id == 0) { MessageBox.Show("Tabladon Bir satir Secin"); } else { int i = 0; int z = 0; for (i = 0; i < 4; i++) { if (kontrol[i]) { z++; } } if (z <= 3) { MessageBox.Show("Eksik Veya Yanlış Doldurdugunuz Bilgiler Var(Hepsinin Yanında Tik işareti olduğundan Emin olun) !"); } else { string CmdString = string.Empty; string musteri = MusteriID_ComboBox.SelectedItem.ToString(); musteri = Regex.Match(musteri, @"\d+").Value; int mus = int.Parse(musteri); SqlConnection connnn = new SqlConnection("Data Source=pc-name;Initial Catalog=SampleDatabase;Integrated Security=True"); connnn.Open(); CmdString = "Update Islem_tablo Set Tutar=@Tutar,Tarih=@Tarih,MCC=@MCC,MusteriID=@MusteriID where ID=" + id; SqlCommand cmd = new SqlCommand(CmdString, connnn); cmd.Parameters.AddWithValue("Tarih", Tarih.SelectedDate); cmd.Parameters.AddWithValue("Tutar", Tutar_textbox.Text); cmd.Parameters.AddWithValue("MCC", Mcc_comboBox.SelectedItem); cmd.Parameters.AddWithValue("MusteriID", mus); cmd.ExecuteNonQuery(); int max = Convert.ToInt32(id); ek_guncelle(max); connnn.Close(); MessageBox.Show("Kayit Guncellendi !"); Temizle.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); goster_tablo = true; Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); id = 0; } } }
public Window3() { InitializeComponent(); SqlConnection connn = new SqlConnection("Data Source=pc-name;Initial Catalog=SampleDatabase;Integrated Security=True"); connn.Open(); int i = 0; for (i = 0; i < 50; i++) { id[i] = 0; } Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }
public void Guncelle_click(object sender, EventArgs e) { if (id == 0) { MessageBox.Show("Tabladon Bir satir Secin"); } else { int i = 0; int z = 0; for (i = 0; i < 6; i++) { if (tb_check[i]) { z++; } } if (z <= 5) { MessageBox.Show("Eksik Veya Yanlış Doldurdugunuz Bilgiler Var(Hepsinin Yanında Tik işareti olduğundan Emin olun) !"); } else { string CmdString = string.Empty; SqlConnection connnn = new SqlConnection("Data Source=pc-name;Initial Catalog=SampleDatabase;Integrated Security=True"); connnn.Open(); CmdString = "Update Musteri_Tab Set AD=@AD,SOYAD=@SOYAD,TELEFON=@TELEFON,KARTNO=@KARTNO,EMAIL=@EMAIL,ADRES=@ADRES where ID=" + id; SqlCommand cmd = new SqlCommand(CmdString, connnn); cmd.Parameters.AddWithValue("AD", Ad_TextBox.Text); cmd.Parameters.AddWithValue("SOYAD", Soyad_textbox.Text); cmd.Parameters.AddWithValue("TELEFON", Telefon_Texbox.Text); cmd.Parameters.AddWithValue("KARTNO", KartNo_TextBox.Text); cmd.Parameters.AddWithValue("EMAIL", Email_TextBox.Text); cmd.Parameters.AddWithValue("ADRES", Adres_TextBox.Text); cmd.ExecuteNonQuery(); connnn.Close(); MessageBox.Show("Kayit Guncellendi !"); Temizle.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); show = true; Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); id = 0; } } }
private void Ekle_Click(object sender, RoutedEventArgs e) { int i = 0; int z = 0; for (i = 0; i < 4; i++) { if (kontrol[i]) { z++; } } if (z <= 3) { MessageBox.Show("Eksik Veya Yanlış Doldurdugunuz Bilgiler Var(Hepsinin Yanında Tik işareti olduğundan Emin olun) !"); } else { string CmdString = string.Empty; SqlConnection connnn = new SqlConnection("Data Source=pc-name;Initial Catalog=SampleDatabase;Integrated Security=True"); connnn.Open(); string musteri = MusteriID_ComboBox.SelectedItem.ToString(); musteri = Regex.Match(musteri, @"\d+").Value; int mus = int.Parse(musteri); CmdString = "Insert Into Islem_tablo(Tutar,Tarih,MCC,MusteriID) Values(@Tutar,@Tarih,@MCC,@MusteriID)"; SqlCommand cmd = new SqlCommand(CmdString, connnn); cmd.Parameters.Add(new SqlParameter("Tarih", Tarih.SelectedDate)); cmd.Parameters.Add(new SqlParameter("Tutar", Tutar_textbox.Text)); cmd.Parameters.Add(new SqlParameter("MCC", Mcc_comboBox.SelectedItem)); cmd.Parameters.Add(new SqlParameter("MusteriID", mus)); cmd.ExecuteNonQuery(); ID_Bul(); connnn.Close(); MessageBox.Show("Kayit Eklendi !"); Temizle.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); goster_tablo = true; Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); id = 0; } }
public void Sil_Click(object sender, EventArgs e) { if (id == 0) { MessageBox.Show("Tabloda bir satır seçin !"); } else { SqlConnection connn = new SqlConnection("Data Source=pc-name;Initial Catalog=SampleDatabase;Integrated Security=True"); connn.Open(); SqlCommand cmd = new SqlCommand("Delete from Musteri_Tab where ID=" + id, connn); cmd.ExecuteNonQuery(); connn.Close(); MessageBox.Show("Kayit Silindi !"); Temizle.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); show = true; Goster.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); id = 0; } }