Exemple #1
0
        public TextArray ddrListerPlus(
            string sitecode,
            string file,
            string iens,
            string fields,
            string flags,
            string maxrex,
            string from,
            string part,
            string xref,
            string screen,
            string identifier)
        {
            AbstractConnection cxn = null;

            try
            {
                cxn = (AbstractConnection)ConnectionPools.getInstance().checkOutAlive(sitecode);
                DdrLister ddr = new DdrLister(cxn)
                {
                    File   = file,
                    Iens   = iens,
                    Fields = fields,
                    Flags  = flags,
                    Max    = maxrex,
                    From   = from,
                    Part   = part,
                    Xref   = String.IsNullOrEmpty(xref) ? "#" : xref,
                    Screen = screen,
                    Id     = identifier
                };
                return(new TextArray(ddr.execute()));
                //VistaRpcQuery ddrResult = ddr.execute();
                //return new DdrRpcResult(ddrResult);
            }
            catch (System.Net.Sockets.SocketException se)
            {
                try
                {
                    cxn.disconnect();
                }
                catch (Exception) { }
                return(new TextArray()
                {
                    fault = new FaultTO(se)
                });
                //return new DdrRpcResult() { fault = new FaultTO(se) };
            }
            catch (Exception exc)
            {
                return(new TextArray()
                {
                    fault = new FaultTO(exc)
                });
                //return new DdrRpcResult() { fault = new FaultTO(exc) };
            }
            finally
            {
                if (cxn != null)
                {
                    ConnectionPools.getInstance().checkIn(cxn);
                }
            }
        }
        public string[] ddrLister(string siteId, string vistaFile, string iens, string fields, string flags, string maxRex, string from, string part, string xref, string screen, string identifier)
        {
            AbstractConnection cxn = null;

            try
            {
                logging.Log.logDDR(String.Format("DDR LISTER: Site {0}, File {1}, IENS {2}, Fields {3}, Flags {7}, From {4}, Screen {5}, Identifier {6}", siteId, vistaFile, iens, fields, from, screen, identifier, flags));
                cxn = (AbstractConnection)ConnectionPools.getInstance().checkOutAlive(siteId);

                DdrLister ddr = new DdrLister(cxn);
                ddr.File   = vistaFile;
                ddr.Iens   = iens;
                ddr.Fields = fields;
                ddr.Flags  = flags;
                if (String.Equals(flags, "I") && !String.IsNullOrEmpty(identifier))
                {
                    ddr.Options = "WID"; // this is how we get identifier part for unpacked query results
                }
                if (String.IsNullOrEmpty(xref))
                {
                    ddr.Xref = "#";
                }
                else
                {
                    ddr.Xref = xref;
                }
                ddr.Max    = maxRex;
                ddr.From   = from;
                ddr.Part   = part;
                ddr.Screen = screen;
                ddr.Id     = identifier;

                String[] result = null;
                result = ddr.execute();
                return(result);
            }
            catch (UnauthorizedAccessException uae)
            {
                logging.Log.LOG("Connection not properly authenticated: " + uae.Message);
                cxn.disconnect(); // will cause cxn pool to discard
                throw uae;
            }
            catch (System.Net.Sockets.SocketException se)
            {
                logging.Log.LOG("Socket error: " + se.Message);
                cxn.disconnect(); // will cause cxn pool to discard
                throw se;
            }
            catch (gov.va.medora.mdo.exceptions.ConnectionException ce)
            {
                logging.Log.LOG("Cxn error: " + ce.Message);
                cxn.disconnect(); // will cause cxn pool to discard
                throw ce;
            }
            catch (Exception exc)
            {
                logging.Log.LOG("DDR LISTER Exception: " + exc.Message);
                throw exc;
            }
            finally
            {
                try
                {
                    ConnectionPools.getInstance().checkIn(cxn);
                }
                catch (Exception) { }
            }
        }