Ejemplo n.º 1
0
        public TransferOrderHdr GetTransferOrder(string qcReturnNo)
        {
            TransferOrderHdr TOhdr = null;

            try
            {
                ProcParam param = new ProcParam(3)
                {
                    ProcedureName = "TO_PACK.GET_TO_HDR"
                };

                param.AddParamRefCursor(0, "io_cursor");
                param.AddParamInput(1, "strFindAll", DBNull.Value);
                param.AddParamInput(2, "strTO_NO", qcReturnNo);


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

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

                if (OraDataReader.Instance.OraReader.HasRows)
                {
                    OraDataReader.Instance.OraReader.FetchSize = OraDataReader.Instance.OraReader.RowSize * 1;

                    while (OraDataReader.Instance.OraReader.Read())
                    {
                        TOhdr = new TransferOrderHdr();

                        TOhdr.TO_NO         = OraDataReader.Instance.GetString("TO_NO");
                        TOhdr.TO_DATE       = OraDataReader.Instance.GetDateTime("TO_DATE");
                        TOhdr.REF_NO        = OraDataReader.Instance.GetString("REF_NO");
                        TOhdr.PROD_TYPE     = OraDataReader.Instance.GetString("PROD_TYPE");
                        TOhdr.TO_DEST       = OraDataReader.Instance.GetString("TO_DEST");
                        TOhdr.DELIVERY_DATE = OraDataReader.Instance.GetDateTime("DELIVERY_DATE");
                        TOhdr.REMARK        = OraDataReader.Instance.GetString("REMARK");
                        TOhdr.ISSUED_BY     = OraDataReader.Instance.GetString("ISSUED_BY");
                        TOhdr.ISSUED_DATE   = OraDataReader.Instance.GetDateTime("ISSUED_DATE");
                        TOhdr.UPDATE_BY     = OraDataReader.Instance.GetString("UPDATE_BY");
                        TOhdr.UPDATE_DATE   = OraDataReader.Instance.GetDateTime("UPDATE_DATE");
                        TOhdr.REC_STAT      = (OraDataReader.Instance.GetString("REC_STAT").ToUpper() == "Y");
                        TOhdr.POST_REF      = OraDataReader.Instance.GetString("POST_REF");
                    }
                }

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

            return(TOhdr);
        }
Ejemplo n.º 2
0
        public string InsertTransferOrder(ref TransferOrderHdr TO_HDR, string userid)
        {
            string resultMsg = string.Empty;

            try
            {
                #region "Transaction Header"

                ProcParam paramHDR = new ProcParam(10);

                paramHDR.ProcedureName = "TO_PACK.TO_HDR_INS";

                paramHDR.AddParamInOutput(0, "strTO_NO", OracleDbType.Varchar2, 255, TO_HDR.TO_NO);
                paramHDR.AddParamInput(1, "strTO_DATE ", TO_HDR.TO_DATE);
                paramHDR.AddParamInput(2, "strREF_NO", TO_HDR.REF_NO);
                paramHDR.AddParamInput(3, "strPROD_TYPE", TO_HDR.PROD_TYPE);
                paramHDR.AddParamInput(4, "strTO_DEST", TO_HDR.TO_DEST);
                paramHDR.AddParamInput(5, "strDELIVERY_DATE", TO_HDR.DELIVERY_DATE);
                paramHDR.AddParamInput(6, "strREMARK", TO_HDR.REMARK);


                paramHDR.AddParamInput(7, "strREC_STAT", (TO_HDR.REC_STAT ? "Y" : "N"));
                paramHDR.AddParamInput(8, "strUSER_ID", userid);

                paramHDR.AddParamOutput(9, "RESULTMSG", OracleDbType.Varchar2, 255);

                #endregion

                GlobalDB.Instance.DataAc.ExecuteNonQuery(paramHDR);

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

                OracleString resultDB = (OracleString)paramHDR.ReturnValue(0);
                OracleString result   = (OracleString)paramHDR.ReturnValue(9);

                if (!result.IsNull)
                {
                    TO_HDR.TO_NO = resultDB.Value;
                    resultMsg    = result.Value;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(resultMsg);
        }