private void Button12_Click(object sender, EventArgs e) { baglanti(); yeni = false; OleDbCommand cmd = new OleDbCommand("UPDATE STOKKARTI SET Cinsi='" + TextBox2.Text + "',Birimi='" + ComboBox1.Text + "',Sinifi='" + ComboBox2.Text + "',Grubu='" + ComboBox3.Text + "',RafNo='" + TextBox3.Text + "',GozNo='" + TextBox4.Text + "',Aciklama='" + TextBox5.Text + "',Fiyat='" + TextBox6.Text + "',OzelKod1='" + TextBox9.Text + "',OzelKod2='" + TextBox10.Text + "',IskontoOrani='" + TextBox7.Text + "',KDVOrani='" + TextBox8.Text + "',StokResmi='" + a + "' Where StokKodu='" + TextBox1.Text + "'", bag); cmd.ExecuteNonQuery(); MessageBox.Show("Kayıt Güncellendi.", "İŞLEM TAMAM", MessageBoxButtons.OK, MessageBoxIcon.Information); Form13 frm13 = new Form13(); frm13.tumkayitlar(); }
private void Timer2_Tick(object sender, EventArgs e) { toolStripProgressBar1.Value += 1; if (toolStripProgressBar1.Value >= 100) { Timer2.Enabled = false; if (f == 1) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm16 = new Form16(); frm16.ShowDialog(); return; } if (f == 2) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm10 = new Form10(); frm10.ShowDialog(); return; } if (f == 3) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm12 = new Form12(); frm12.ShowDialog(); return; } if (f == 4) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; this.WindowState = FormWindowState.Maximized; Form frm5 = new Form5(); frm5.ShowDialog(); } if (f == 5) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm7 = new Form7(); frm7.ShowDialog(); return; } if (f == 6) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm8 = new Form8(); frm8.ShowDialog(); return; } if (f == 7) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm9 = new Form9(); frm9.ShowDialog(); return; } if (f == 8) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm13 = new Form13(); frm13.ShowDialog(); return; } if (f == 10) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm6 = new Form6(); frm6.ShowDialog(); return; } if (f == 11) { toolStripProgressBar1.Style = ProgressBarStyle.Blocks; toolStripProgressBar1.Value = 0; Form frm15 = new Form15(); frm15.ShowDialog(); return; } } }
private void Button4_Click(object sender, EventArgs e) { baglanti(); string duzen; if (TextBox1.Text == "" || TextBox2.Text == "") { duzen = Microsoft.VisualBasic.Interaction.InputBox("Güncellenecek kaydın Stok Kodunu giriniz.", "DÜZENLEME"); if (duzen == "") { return; } OleDbCommand cmd = new OleDbCommand("SELECT * FROM STOKKARTI WHERE StokKodu='" + duzen + "'", bag); OleDbDataReader oku = cmd.ExecuteReader(); if (oku.Read()) { foreach (Control c in this.Controls) { if (c is TextBox) { c.Enabled = true; } } ComboBox1.Enabled = true; ComboBox2.Enabled = true; ComboBox3.Enabled = true; Button1.Enabled = true; Button8.Enabled = true; Button9.Enabled = true; Button10.Enabled = true; Button11.Enabled = true; TextBox1.Enabled = false; TextBox1.Text = oku[0].ToString().Trim(); TextBox2.Text = oku[1].ToString().Trim(); ComboBox1.Text = oku[2].ToString().Trim(); ComboBox2.Text = oku[3].ToString().Trim(); ComboBox3.Text = oku[4].ToString().Trim(); TextBox3.Text = oku[5].ToString().Trim(); TextBox4.Text = oku[6].ToString().Trim(); TextBox5.Text = oku[7].ToString().Trim(); TextBox6.Text = oku[8].ToString().Trim(); TextBox9.Text = oku[9].ToString().Trim(); TextBox10.Text = oku[10].ToString().Trim(); TextBox7.Text = oku[11].ToString().Trim(); TextBox8.Text = oku[12].ToString().Trim(); if (oku[13].ToString() != "") { PictureBox1.Image = Image.FromFile(oku[13].ToString()); } Button12.Visible = true; Button4.Visible = false; } else { duzen = ""; MessageBox.Show("Bu stok koduna ait ürün bulunamadı.", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error); oku.Close(); return; } oku.Close(); } else { foreach (Control c in this.Controls) { if (c is TextBox) { c.Enabled = true; } } Form13 frm13 = (Form13)Application.OpenForms["Form13"]; OleDbCommand cmd = new OleDbCommand("SELECT * FROM STOKKARTI WHERE StokKodu='" + frm13.DataGridView1.CurrentRow.Cells[0].Value.ToString() + "'", bag); OleDbDataReader oku = cmd.ExecuteReader(); if (oku.Read()) { ComboBox1.Enabled = true; ComboBox2.Enabled = true; ComboBox3.Enabled = true; ComboBox1.Text = oku[2].ToString().Trim(); ComboBox2.Text = oku[3].ToString().Trim(); ComboBox3.Text = oku[4].ToString().Trim(); Button1.Enabled = true; Button8.Enabled = true; Button9.Enabled = true; Button10.Enabled = true; Button11.Enabled = true; TextBox1.Enabled = false; Button12.Visible = true; Button4.Visible = false; } } }