Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }