예제 #1
0
        protected virtual Boolean SetMaximumWaitTime()
        {
            try
            {
                ReturnCode = MvxSock.SetMaxWait(ref serverId, MaximumWaitTime);

                if (ReturnCode.Value == 0)
                {
                    return(true);
                }
                else
                {
                    Trace.WriteLine(String.Format("The 'MvxSock.SetMaxWait' method retured the following non zero code.  {0}", ReturnCode));
                }
            }
            catch (Exception exception)
            { Trace.WriteLine(exception.ToString()); }

            String errorText = GetErrorText();

            Trace.WriteLineIf((errorText != null), errorText);

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(false);
        }
예제 #2
0
        protected virtual Boolean ConnectToServer()
        {
            try
            {
                ReturnCode = MvxSock.Connect(ref serverId, ConnectionData.Server, ConnectionData.Port, ConnectionData.UserName, ConnectionData.Password, ApiData.Api, null);

                if (ReturnCode.Value == 0)
                {
                    return(true);
                }
                else
                {
                    Trace.WriteLine(String.Format("The 'MvxSock.Connect' method retured the following non zero code.  {0}", ReturnCode));
                }
            }
            catch (Exception exception)
            { Trace.WriteLine(exception.ToString()); }

            String errorText = GetErrorText();

            Trace.WriteLineIf((errorText != null), errorText);

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(false);
        }
예제 #3
0
        protected virtual Boolean SetMaximumRecordsForApiToReturn()
        {
            try
            {
                StringBuilder stringBuilder = new StringBuilder();

                UInt32 size = 128;

                ReturnCode = MvxSock.Trans(ref serverId, String.Format("SetLstMaxRec   {0}", MaximumRecordsToReturn.ToString()), stringBuilder, ref size);

                if (ReturnCode.Value == 0)
                {
                    return(true);
                }
                else
                {
                    Trace.WriteLine(String.Format("The 'MvxSock.Trans' method retured non zero code:{0}.", ReturnCode));

                    String errorText = GetErrorText();

                    Trace.WriteLineIf((errorText != null), errorText);
                }
            }
            catch (Exception exception)
            { Trace.WriteLine(exception); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(false);
        }
예제 #4
0
        protected virtual Boolean SetEnableZippedTransactions()
        {
            try
            {
                ReturnCode = MvxSock.SetZippedTransactions(ref serverId, 1);

                if (ReturnCode.Value == 0)
                {
                    return(true);
                }
                else
                {
                    Trace.WriteLine(String.Format("The 'MvxSock.SetZippedTransactions' method retured non zero code:{0}.", ReturnCode));

                    String errorText = GetErrorText();

                    Trace.WriteLineIf((errorText != null), errorText);
                }
            }
            catch (Exception exception)
            { Trace.WriteLine(exception); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(false);
        }
예제 #5
0
        //METHODS
        public void SetFields(ref SERVER_ID _ServerId)
        {
            FieldDescription = DataConverter.ToString(MvxSock.GetField(ref _ServerId, "FLDS"));

            FieldName = DataConverter.ToString(MvxSock.GetField(ref _ServerId, "FLNM"));

            FieldType = DataConverter.ToString(MvxSock.GetField(ref _ServerId, "TYPE"));

            InputOutput = DataConverter.ToString(MvxSock.GetField(ref _ServerId, "TRTP"));

            Length = DataConverter.ToString(MvxSock.GetField(ref _ServerId, "LENG"));

            ProgramName = DataConverter.ToString(MvxSock.GetField(ref _ServerId, "MINM"));

            TransactionName = DataConverter.ToString(MvxSock.GetField(ref _ServerId, "TRNM"));
        }
예제 #6
0
        protected virtual Boolean SetRequestField(RequestFieldData requestFieldData)
        {
            try
            {
                ReturnCode = null;

                MvxSock.SetField(ref serverId, requestFieldData.FieldName, requestFieldData.FieldValue);

                return(true);
            }
            catch (Exception exception)
            { Trace.WriteLine(exception.ToString()); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(false);
        }
예제 #7
0
        protected virtual String GetErrorText()
        {
            String errorText;

            try
            {
                errorText = MvxSock.GetLastError(ref serverId).Trim();

                return(errorText.Length == 0 ? null : errorText);
            }
            catch (Exception exception)
            { Trace.WriteLine(exception.ToString()); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(null);
        }
예제 #8
0
        protected virtual Boolean ExecuteApi()
        {
            try
            {
                ReturnCode = MvxSock.Access(ref serverId, ApiData.Method);

                return(EvaluateMvxSockAccessReturnCode());
            }
            catch (Exception exception)
            { Trace.WriteLine(exception.ToString()); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            ReturnCode = null;

            return(false);
        }
예제 #9
0
        protected virtual Boolean ExecuteApi()
        {
            try
            {
                ReturnCode = MvxSock.Access(ref serverId, ApiData.Method);

                if (ReturnCode.Value == 0)
                {
                    return(true);
                }
                else
                {
                    Trace.WriteLine(String.Format("The 'MvxSock.Access' method retured the following non zero code.  {0}", ReturnCode));
                }
            }
            catch (Exception exception)
            { Trace.WriteLine(exception.ToString()); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(false);
        }
예제 #10
0
        protected override bool ProcessApiResults()
        {
            DataObjectCollection = new T_DataObjectCollection();

            try
            {
                while (MvxSock.More(ref serverId))
                {
                    if (!ProcessApiResult())
                    {
                        return(false);
                    }

                    ReturnCode = MvxSock.Access(ref serverId, null);

                    if (ReturnCode.Value != 0)
                    {
                        Trace.WriteLine(String.Format("The 'MvxSock.Access' method retured the following non zero code.  {0}", ReturnCode));

                        String errorText = GetErrorText();

                        Trace.WriteLineIf((errorText != null), errorText);

                        return(false);
                    }
                }

                return(true);
            }
            catch (Exception exception)
            { Trace.WriteLine(exception); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            return(false);
        }
예제 #11
0
        //FUNCTIONS
        protected virtual Boolean CloseServerConnection()
        {
            try
            {
                ReturnCode = MvxSock.Close(ref serverId);

                if (ReturnCode.Value == 0)
                {
                    return(true);
                }
                else
                {
                    Trace.WriteLine(String.Format("The 'MvxSock.Close' method retured non zero code:{0}", ReturnCode));
                }
            }
            catch (Exception exception)
            { Trace.WriteLine(exception.ToString()); }

            TraceUtilities.WriteMethodError(MethodBase.GetCurrentMethod());

            ReturnCode = null;

            return(false);
        }
예제 #12
0
 protected virtual String GetValueFromField(String fieldName)
 {
     return(MvxSock.GetField(ref serverId, fieldName));
 }