Ejemplo n.º 1
0
        private void LoadBPP()
        {
            try
            {
                using (Database db = new Database(GlobalVar.DBFinance))
                {
                    db.Commands.Add(db.CreateCommand("usp_LoadBPP_Lookup"));
                    db.Commands[0].Parameters.Add(new Parameter("@searchArg", SqlDbType.VarChar, tbNoBPP.Text));
                    db.Commands[0].Parameters.Add(new Parameter("@KodeGudang", SqlDbType.VarChar, GlobalVar.Gudang));
                    db.Commands[0].Parameters.Add(new Parameter("@KodeCollector", SqlDbType.VarChar, _KodeCollector));

                    dtBPP = db.Commands[0].ExecuteDataTable();
                }

                if (dtBPP.Rows.Count == 1)
                {
                    tbNoBPP.Text = Tools.isNull(dtBPP.Rows[0]["NoBPP"], "").ToString();
                }
                else
                {
                    frmLookupBPP frm = new frmLookupBPP(tbNoBPP.Text, dtBPP, GlobalVar.Gudang, _KodeCollector);
                    frm.ShowDialog();
                    if (frm.DialogResult == DialogResult.OK)
                    {
                        GetDialogResult(frm);
                    }
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }