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); }
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); }
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); }
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); }
//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")); }
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); }
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); }
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); }
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); }
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); }
//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); }
protected virtual String GetValueFromField(String fieldName) { return(MvxSock.GetField(ref serverId, fieldName)); }