public void ConfirmSelect() { int stokbrg = Convert.ToInt32(customGridView1.SelectedCells[0].OwningRow.Cells["StokAkhir"].Value); if (stokbrg <= 0) { return; } idbarangpilih = customGridView1.SelectedCells[0].OwningRow.Cells["KodeBarang"].Value.ToString(); if (this.Caller is POS.FrmPOS) { POS.FrmPOS frmCaller = (POS.FrmPOS) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(); } else if (this.Caller is POS.FrmPOS0401) { POS.FrmPOS0401 frmCaller = (POS.FrmPOS0401) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(); } else if (this.Caller is POS.FrmPOSbengkel) { POS.FrmPOSbengkel frmCaller = (POS.FrmPOSbengkel) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(); } this.Close(); }
public void ConfirmSelect() { int stokbrg = Convert.ToInt32(customGridView1.SelectedCells[0].OwningRow.Cells["StokAkhir"].Value); if (stokbrg <= 0) { MessageBox.Show("Nilai stok barang <= 0. Tidak bisa bertransaksi. Hubungi Manager Anda."); return; } idbarangpilih = customGridView1.SelectedCells[0].OwningRow.Cells["KodeBarang"].Value.ToString(); //if (this.Caller is POS.FrmPOS) //{ POS.FrmPOS frmCaller = (POS.FrmPOS) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(stokbrg); //} this.Close(); }
public void ConfirmSelect() { String BarangID = customGridView1.SelectedCells[0].OwningRow.Cells["KodeBarang"].Value.ToString(); if (BarangID.Length == 13) { //if ((Convert.ToInt32(customGridView1.SelectedCells[0].OwningRow.Cells["StokAkhir"].Value) <=0 )) //{ // return; //} int stokbrg = Convert.ToInt32(customGridView1.SelectedCells[0].OwningRow.Cells["StokAkhir"].Value); if (stokbrg > 0) { DataTable dtAppSet; using (Database db = new Database()) { db.Commands.Add(db.CreateCommand("usp_AppSetting_LIST")); db.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "POS")); dtAppSet = db.Commands[0].ExecuteDataTable(); } if (dtAppSet.Rows.Count > 0) { if (dtAppSet.Rows[0]["Value"].ToString() == "1") { MessageBox.Show("Stok minus, sebaiknya dilakukan sampling opname stok"); } else { MessageBox.Show("Nilai stok barang <= 0. Tidak bisa bertransaksi. Hubungi Manager Anda."); return; } } idbarangpilih = customGridView1.SelectedCells[0].OwningRow.Cells["KodeBarang"].Value.ToString(); //if (this.Caller is POS.FrmPOS) //{ POS.FrmPOS frmCaller = (POS.FrmPOS) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(stokbrg); } else { MessageBox.Show("Nilai stok barang <= 0. Tidak bisa bertransaksi. Hubungi Manager Anda."); return; } } else { idbarangpilih = customGridView1.SelectedCells[0].OwningRow.Cells["KodeBarang"].Value.ToString(); //if (this.Caller is POS.FrmPOS) //{ POS.FrmPOS frmCaller = (POS.FrmPOS) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarangJasa(); //} } this.Close(); }
public void ConfirmSelect() { if (GlobalVar.Gudang != "2808") { int stokbrg = Convert.ToInt32(customGridView1.SelectedCells[0].OwningRow.Cells["StokAkhir"].Value); if (stokbrg <= 0) { DataTable dtAppSet; using (Database db = new Database()) { db.Commands.Add(db.CreateCommand("usp_AppSetting_LIST")); db.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "POS")); dtAppSet = db.Commands[0].ExecuteDataTable(); } if (GlobalVar.Gudang.Substring(0, 2) == "28") { if (dtAppSet.Rows.Count > 0) { if (dtAppSet.Rows[0]["Value"].ToString() == "1") { MessageBox.Show("Stok minus, sebaiknya dilakukan sampling opname stok"); } //else //{ // MessageBox.Show("Stok minus, tidak dapat melanjutkan Penjualan Tunai, hubungi supervisor"); // return; //} } //else //{ // MessageBox.Show("Stok minus, tidak dapat melanjutkan Penjualan Tunai, hubungi supervisor"); // return; //} } } } idbarangpilih = customGridView1.SelectedCells[0].OwningRow.Cells["KodeBarang"].Value.ToString(); if (this.Caller is POS.FrmPOS) { POS.FrmPOS frmCaller = (POS.FrmPOS) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; //frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(); } else if (this.Caller is POS.FrmPOS0401) { POS.FrmPOS0401 frmCaller = (POS.FrmPOS0401) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; //frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(); } else if (this.Caller is POS.FrmPOSbengkel) { POS.FrmPOSbengkel frmCaller = (POS.FrmPOSbengkel) this.Caller; frmCaller.TxtBarcode.Text = idbarangpilih; //frmCaller.TxtBarcode.Focus(); frmCaller.AmbilBarang2(); } this.Close(); }