private void sek_iptal_Load(object sender, EventArgs e) { label3.Text = bolunmusSeriIptal ? "Kaynak Seri:" : "Palet:"; label1.Text = bolunmusSeriIptal ? "Hedef Seri:" : "Seri|Palet:"; if (bolunmusSeriIptal) { MiktarSor sevkEmriSor = new MiktarSor(); sevkEmriSor.Text = "Sevk Emri Gir"; if (sevkEmriSor.ShowDialog() != DialogResult.OK) { this.Close(); return; } sevkEmri = sevkEmriSor.metin; BolunmusSeriGetir(); button6.Visible = false; } textBoxPalet.Focus(); }
private void button6_Click(object sender, EventArgs e) { DataTable dt = (DataTable)dataGrid1.DataSource; if (dt != null) { MiktarSor mk = new MiktarSor(); if (mk.ShowDialog() != DialogResult.OK) { return; } int gmiktar = (int)mk.miktar; try { Utility.Engine.dat.TInsert("begin transaction xx5"); try { textBoxSeri.Text = dataGrid1[dataGrid1.CurrentRowIndex, 7].ToString(); } catch (Exception ee) { Utility.WriteTrace(ee.Message); } string xsal = "update kasa_transfer set GelenMiktar = isnull(GelenMiktar,0) + N'" + gmiktar.ToString() + "' where ids=N'" + dataGrid1[dataGrid1.CurrentRowIndex, 6].ToString() + "'"; if (!Utility.Engine.dat.TInsert(xsal)) { Utility.Engine.dat.TInsert("rollback transaction xx5"); MessageBox.Show("Gelen Miktarlar Kayit Edilirken Hata Oluştu..! <" + Utility.Engine.dat.STR_HataMesaji + ">"); return; } Utility.Engine.dat.TInsert("commit transaction xx5"); } catch (Exception exc) { Utility.Engine.dat.TInsert("rollback transaction xx5"); MessageBox.Show("Genel Hata:" + exc.Message, "HATA!"); } panel1.Location = new Point(368, 216); basla(); } }
private void BarkodEkle() { if (textBoxBARKOD.Text.Length < 1) { textBoxBARKOD.Focus(); textBoxBARKOD.SelectAll(); return; } if (comboBoxDonem.SelectedItem == null) { Utility.Engine.Hata("Donem Kodu Secilmedi!"); comboBoxDonem.Focus(); return; } if (textBoxSayimDepo.Text.Length < 1) { Utility.Engine.Hata("Depo Kodu Secilmedi!"); return; } double anabirimMilktar = 0; if (comboBox1.SelectedIndex == 0) { MiktarSor ms = new MiktarSor(); if (ms.ShowDialog() == DialogResult.OK) { anabirimMilktar = ms.miktar; } } Utility.Engine.sql = string.Format( @"EXEC [dbo].[sbulsayim] N'{0}',N'{1}',N'{2}',N'{3}',N'{4}',N'{5}',N'{6}',N'{7}'", Utility.Engine.Turkcele(textBoxBARKOD.Text).Trim().ToUpper().Replace("\r", "").Replace("\n", "").Replace("\r\n", ""), Utility.Engine.KullaniciID, comboBoxDonem.SelectedItem.ToString(), Utility.Engine.SqlTemizle(textBoxSayimDepo.Text).Replace("\r", "").Replace("\n", "").Replace("\r\n", ""), Utility.Engine.CihazID, Utility.Engine.SqlTemizle(textBoxPalet.Text).Trim().Replace("\r", "").Replace("\n", "").Replace("\r\n", ""), comboBox1.SelectedIndex.ToString(), anabirimMilktar ); DataTable dt = null; dt = Utility.Engine.dat.TableDon(Utility.Engine.sql); if (dt.Rows.Count < 1) { Utility.Engine.Hata("Sunucu Yanit Vermedi <" + Utility.Engine.dat.Fault + ">"); menuItem_Bilgi.Text = listView1.Items.Count.ToString(); Cursor.Current = Cursors.Default; textBoxBARKOD.Text = ""; textBoxBARKOD.Focus(); return; } string snc = ""; snc = dt.Rows[0][0].ToString().Trim(); if (snc == "-1") { Utility.Engine.Hata(dt.Rows[0][1].ToString().Trim()); menuItem_Bilgi.Text = listView1.Items.Count.ToString(); Cursor.Current = Cursors.Default; textBoxBARKOD.Text = ""; textBoxBARKOD.Focus(); return; } Utility.Engine.dat.tabledenListDoldur(dt, listView1); menuItem_Bilgi.Text = listView1.Items.Count.ToString(); Cursor.Current = Cursors.Default; textBoxBARKOD.Text = ""; textBoxBARKOD.Focus(); return; }