Esempio n. 1
0
        public LoadQty GetLoadInfo(string loadNo, string userid, out string resultMessage)
        {
            resultMessage = string.Empty;
            LoadQty loadQty = null;

            try
            {
                ProcParam procPara = new ProcParam(4)
                {
                    ProcedureName = "SCANNER_PACK_FG.GET_LOADING_INFO"
                };
                procPara.AddParamRefCursor(0, "io_cursor");
                procPara.AddParamInput(1, "strLOADING_NO", loadNo);
                procPara.AddParamOutput(2, "resultmsg", OracleDbType.Varchar2, 255);
                procPara.AddParamInput(3, "strUser_id", userid);

                OraDataReader.Instance.OraReader = GlobalDB.Instance.DataAc.ExecuteDataReader(procPara);

                this.executionTime = GlobalDB.Instance.DataAc.ExecuteTime;

                if (OraDataReader.Instance.OraReader.HasRows)
                {
                    while (OraDataReader.Instance.OraReader.Read())
                    {
                        loadQty = new LoadQty();

                        loadQty.LOADING_NO = OraDataReader.Instance.GetString("LOADING_NO");
                        loadQty.LOADED_BOX = OraDataReader.Instance.GetInteger("LOADED_BOX");
                        loadQty.LOADED_QTY = OraDataReader.Instance.GetInteger("LOADED_QTY");
                    }
                }
                else
                {
                    OracleString result = (OracleString)procPara.ReturnValue(2);
                    if (!result.IsNull)
                    {
                        resultMessage = result.Value;
                    }
                }

                // always call Close when done reading.
                OraDataReader.Instance.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(loadQty);
        }
Esempio n. 2
0
    public LoadQty GetLoadInfo(string loadNo, string userid, out string resultMsg)
    {
        resultMsg = string.Empty;
        LoadQty loadQty = null;

        try
        {
            using (ProductCardLOADBLL prdLoadingBll = new ProductCardLOADBLL())
            {
                loadQty = prdLoadingBll.GetLoadInfo(loadNo, userid, out resultMsg);
            }
        }
        catch (Exception ex)
        {
            loadQty = null;
            throw ex;
        }
        return(loadQty);
    }