本文整理汇总了C#中Dev2.DataList.Contract.ErrorResultTO类的典型用法代码示例。如果您正苦于以下问题:C# ErrorResultTO类的具体用法?C# ErrorResultTO怎么用?C# ErrorResultTO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorResultTO类属于Dev2.DataList.Contract命名空间,在下文中一共展示了ErrorResultTO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateUserFriendlyModel
public string GenerateUserFriendlyModel(IExecutionEnvironment env, Dev2DecisionMode mode, out ErrorResultTO errors)
{
StringBuilder result = new StringBuilder("");
int cnt = 0;
errors = new ErrorResultTO();
// build the output for decisions
foreach(Dev2Decision dd in TheStack)
{
result.Append(dd.GenerateUserFriendlyModel(env, Mode, out errors));
// append mode if not at end
if((cnt + 1) < TheStack.Count)
{
result.Append(Mode);
}
result.AppendLine();
cnt++;
}
// append the arms
result.Append("THEN " + TrueArmText);
result.AppendLine();
result.Append("ELSE " + FalseArmText);
return result.ToString();
}
示例2: MockExecutionImpl
public System.Guid MockExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out DataList.Contract.ErrorResultTO tmpErrors)
{
tmpErrors = new ErrorResultTO();
tmpErrors.AddError("Something bad happened");
return Guid.Empty;
}
示例3: Webservice_Test_WhenRequestShouldTimeout_ExpectTimeoutMessage
public void Webservice_Test_WhenRequestShouldTimeout_ExpectTimeoutMessage()
{
//------------Setup for test--------------------------
var serviceXml = XmlResource.Fetch("WebService");
var sourceXml = XmlResource.Fetch("WebSource");
var response = JsonResource.Fetch("cryptsy_all_markets");
var service = new WebService(serviceXml) { Source = new WebSource(sourceXml) };
foreach(var parameter in service.Method.Parameters)
{
parameter.Value = parameter.DefaultValue;
}
var webExecuteHitCount = 0;
var resourceCatalog = new Mock<IResourceCatalog>();
var services = new WebServicesMock(resourceCatalog.Object,
(WebSource source, WebRequestMethod method, string uri, string data, bool error, out ErrorResultTO errors, string[] headers) =>
{
webExecuteHitCount++;
errors = new ErrorResultTO();
return response;
});
//------------Execute Test---------------------------
var result = services.Test(service.ToString(), Guid.Empty, Guid.Empty);
//------------Assert Results-------------------------
Assert.AreEqual(1, webExecuteHitCount);
Assert.AreEqual(GlobalConstants.WebServiceTimeoutMessage, result.RequestMessage);
}
示例4: ExecutionImpl
protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO errors, int update)
{
var execErrors = new ErrorResultTO();
errors = new ErrorResultTO();
errors.MergeErrors(execErrors);
var databaseServiceExecution = ServiceExecution as DatabaseServiceExecution;
if(databaseServiceExecution != null)
{
databaseServiceExecution.InstanceInputDefinitions = inputs; // set the output mapping for the instance ;)
databaseServiceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
}
//ServiceExecution.DataObj = dataObject;
var result = ServiceExecution.Execute(out execErrors, update);
var fetchErrors = execErrors.FetchErrors();
foreach(var error in fetchErrors)
{
dataObject.Environment.Errors.Add(error);
}
errors.MergeErrors(execErrors);
// Adjust the remaining output mappings ;)
return result;
}
示例5: GenerateRequestDictionaryFromDataObject
private void GenerateRequestDictionaryFromDataObject(out ErrorResultTO errors)
{
var compiler = DataListFactory.CreateDataListCompiler();
errors = new ErrorResultTO();
ErrorResultTO invokeErrors;
IBinaryDataList bdl = compiler.FetchBinaryDataList(DataObject.DataListID, out invokeErrors);
errors.MergeErrors(invokeErrors);
if(!invokeErrors.HasErrors())
{
foreach(IBinaryDataListEntry entry in bdl.FetchScalarEntries())
{
IBinaryDataListItem itm = entry.FetchScalar();
if(!DataListUtil.IsSystemTag(itm.FieldName))
{
var stringBuilder = new StringBuilder("");
try
{
stringBuilder = new StringBuilder(itm.TheValue);
}
// ReSharper disable EmptyGeneralCatchClause
catch(Exception)
// ReSharper restore EmptyGeneralCatchClause
{
}
Request.AddArgument(itm.FieldName, stringBuilder);
}
}
}
}
示例6: Execute
public override Guid Execute(out ErrorResultTO errors, int update)
{
WebserviceExecution.InstanceInputDefinitions = InstanceInputDefinition;
WebserviceExecution.InstanceOutputDefintions = InstanceOutputDefinition;
var result = WebserviceExecution.Execute(out errors, update);
return result;
}
示例7: ConvertToDataTable
public DataTable ConvertToDataTable(IBinaryDataList input, string recsetName, out ErrorResultTO errors, PopulateOptions populateOptions)
{
if(String.IsNullOrEmpty(recsetName))
{
throw new ArgumentNullException("recsetName");
}
if(input == null)
{
throw new ArgumentNullException("input");
}
var dbData = new DataTable();
IBinaryDataListEntry entry;
errors = null;
string error;
if(input.TryGetEntry(recsetName, out entry, out error))
{
if(entry.IsRecordset)
{
var cols = entry.Columns;
var dataColumns = cols.ToList().ConvertAll(column => new DataColumn(column.ColumnName));
dbData.Columns.AddRange(dataColumns.ToArray());
var fetchRecordsetIndexes = entry.FetchRecordsetIndexes();
while(fetchRecordsetIndexes.HasMore())
{
var binaryDataListItems = entry.FetchRowAt(fetchRecordsetIndexes.FetchNextIndex(), out error);
if(populateOptions == PopulateOptions.IgnoreBlankRows && binaryDataListItems.All(item =>
{
string theValue;
try
{
theValue = item.TheValue;
}
catch(Exception)
{
theValue = null;
}
return String.IsNullOrEmpty(theValue);
}))
{
continue;
}
dbData.LoadDataRow(binaryDataListItems.Select(item =>
{
string theValue;
try
{
theValue = item.TheValue;
}
catch(Exception)
{
theValue = null;
}
return theValue as object;
}).ToArray(), LoadOption.OverwriteChanges);
}
}
}
return dbData;
}
示例8: Execute
public override Guid Execute(out ErrorResultTO errors)
{
_pluginServiceExecution.InstanceInputDefinitions = InstanceInputDefinition;
_pluginServiceExecution.InstanceOutputDefintions = InstanceOutputDefinition;
var result = _pluginServiceExecution.Execute(out errors);
return result;
}
示例9: ExecuteConcreteAction
protected override IList<OutputTO> ExecuteConcreteAction(IDSFDataObject dataObject, out ErrorResultTO allErrors, int update)
{
IList<OutputTO> outputs = new List<OutputTO>();
allErrors = new ErrorResultTO();
var colItr = new WarewolfListIterator();
//get all the possible paths for all the string variables
var outputItr = new WarewolfIterator(dataObject.Environment.Eval(OutputPath, update));
colItr.AddVariableToIterateOn(outputItr);
var unameItr = new WarewolfIterator(dataObject.Environment.Eval(Username, update));
colItr.AddVariableToIterateOn(unameItr);
var passItr = new WarewolfIterator(dataObject.Environment.Eval(DecryptedPassword,update));
colItr.AddVariableToIterateOn(passItr);
var privateKeyItr = new WarewolfIterator(dataObject.Environment.Eval(PrivateKeyFile, update));
colItr.AddVariableToIterateOn(privateKeyItr);
if(dataObject.IsDebugMode())
{
AddDebugInputItem(new DebugEvalResult(OutputPath, "File or Folder", dataObject.Environment, update));
AddDebugInputItem(new DebugItemStaticDataParams(Overwrite.ToString(), "Overwrite"));
AddDebugInputItemUserNamePassword(dataObject.Environment, update);
if (!string.IsNullOrEmpty(PrivateKeyFile))
{
AddDebugInputItem(PrivateKeyFile, "Destination Private Key File", dataObject.Environment, update);
}
}
while(colItr.HasMoreData())
{
IActivityOperationsBroker broker = ActivityIOFactory.CreateOperationsBroker();
Dev2CRUDOperationTO opTo = new Dev2CRUDOperationTO(Overwrite);
try
{
IActivityIOPath dst = ActivityIOFactory.CreatePathFromString(colItr.FetchNextValue(outputItr),
colItr.FetchNextValue(unameItr),
colItr.FetchNextValue(passItr),
true, colItr.FetchNextValue(privateKeyItr));
IActivityIOOperationsEndPoint dstEndPoint = ActivityIOFactory.CreateOperationEndPointFromIOPath(dst);
string result = broker.Create(dstEndPoint, opTo, true);
outputs.Add(DataListFactory.CreateOutputTO(Result, result));
}
catch(Exception e)
{
outputs.Add(DataListFactory.CreateOutputTO(Result, "Failure"));
allErrors.AddError(e.Message);
break;
}
}
return outputs;
}
示例10: ExecuteConcreteAction
protected override IList<OutputTO> ExecuteConcreteAction(IDSFDataObject dataObject, out ErrorResultTO allErrors, int update)
{
IList<OutputTO> outputs = new List<OutputTO>();
allErrors = new ErrorResultTO();
var colItr = new WarewolfListIterator();
//get all the possible paths for all the string variables
var inputItr = new WarewolfIterator(dataObject.Environment.Eval(InputPath, update));
colItr.AddVariableToIterateOn(inputItr);
var unameItr = new WarewolfIterator(dataObject.Environment.Eval(Username, update));
colItr.AddVariableToIterateOn(unameItr);
var passItr = new WarewolfIterator(dataObject.Environment.Eval(DecryptedPassword,update));
colItr.AddVariableToIterateOn(passItr);
var privateKeyItr = new WarewolfIterator(dataObject.Environment.Eval(PrivateKeyFile, update));
colItr.AddVariableToIterateOn(privateKeyItr);
outputs.Add(DataListFactory.CreateOutputTO(Result));
if(dataObject.IsDebugMode())
{
AddDebugInputItem(InputPath, "Input Path", dataObject.Environment, update);
AddDebugInputItemUserNamePassword(dataObject.Environment, update);
if(!string.IsNullOrEmpty(PrivateKeyFile))
{
AddDebugInputItem(PrivateKeyFile, "Private Key File", dataObject.Environment, update);
}
}
while(colItr.HasMoreData())
{
IActivityOperationsBroker broker = ActivityIOFactory.CreateOperationsBroker();
IActivityIOPath ioPath = ActivityIOFactory.CreatePathFromString(colItr.FetchNextValue(inputItr),
colItr.FetchNextValue(unameItr),
colItr.FetchNextValue(passItr),
true, colItr.FetchNextValue(privateKeyItr));
IActivityIOOperationsEndPoint endpoint = ActivityIOFactory.CreateOperationEndPointFromIOPath(ioPath);
try
{
string result = broker.Get(endpoint);
outputs[0].OutputStrings.Add(result);
}
catch(Exception e)
{
outputs[0].OutputStrings.Add(null);
allErrors.AddError(e.Message);
break;
}
}
return outputs;
}
示例11: ExecuteConcreteAction
protected override IList<OutputTO> ExecuteConcreteAction(IDSFDataObject dataObject, out ErrorResultTO allErrors)
{
IList<OutputTO> outputs = new List<OutputTO>();
allErrors = new ErrorResultTO();
var colItr = new WarewolfListIterator();
//get all the possible paths for all the string variables
var inputItr = new WarewolfIterator(dataObject.Environment.Eval(InputPath));
colItr.AddVariableToIterateOn(inputItr);
var unameItr = new WarewolfIterator(dataObject.Environment.Eval(Username));
colItr.AddVariableToIterateOn(unameItr);
var passItr = new WarewolfIterator(dataObject.Environment.Eval(Password));
colItr.AddVariableToIterateOn(passItr);
outputs.Add(DataListFactory.CreateOutputTO(Result));
if(dataObject.IsDebugMode())
{
AddDebugInputItem(InputPath, "Input Path", dataObject.Environment);
AddDebugInputItemUserNamePassword(dataObject.Environment);
}
while(colItr.HasMoreData())
{
IActivityOperationsBroker broker = ActivityIOFactory.CreateOperationsBroker();
try
{
IActivityIOPath dst = ActivityIOFactory.CreatePathFromString(colItr.FetchNextValue(inputItr),
colItr.FetchNextValue(unameItr),
colItr.FetchNextValue(passItr),
true);
IActivityIOOperationsEndPoint dstEndPoint = ActivityIOFactory.CreateOperationEndPointFromIOPath(dst);
string result = broker.Delete(dstEndPoint);
outputs[0].OutputStrings.Add(result);
}
catch(Exception e)
{
outputs.Add(DataListFactory.CreateOutputTO(Result, "Failure"));
//outputs[0].OutputStrings.Add(null);
allErrors.AddError(e.Message);
break;
}
}
return outputs;
}
示例12: WriteDataList
public bool WriteDataList(Guid datalistID, IBinaryDataList datalist, ErrorResultTO errors) {
bool result = false;
if (datalistID != GlobalConstants.NullDataListID)
{
Repo[datalistID] = datalist;
result = true;
}
return result;
}
示例13: ExecutionImpl
protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
{
_errorsTo = new ErrorResultTO();
var pluginServiceExecution = GetNewPluginServiceExecution(dataObject);
pluginServiceExecution.InstanceInputDefinitions = inputs;
pluginServiceExecution.InstanceOutputDefintions = outputs;
tmpErrors = new ErrorResultTO();
tmpErrors.MergeErrors(_errorsTo);
var result = ExecutePluginService(pluginServiceExecution, update);
tmpErrors.MergeErrors(_errorsTo);
return result;
}
示例14: ConvertFrom
public DataListTranslatedPayloadTO ConvertFrom(IBinaryDataList payload, out ErrorResultTO errors)
{
if(payload == null)
{
throw new ArgumentNullException("payload");
}
StringBuilder result = new StringBuilder("<" + RootTag + ">");
errors = new ErrorResultTO();
var entries = payload.FetchAllEntries();
foreach(var entry in entries)
{
if(entry.IsRecordset)
{
AddEntryToBuilder(result, entry);
result.Append(">");
foreach(var col in entry.Columns)
{
result.Append("<");
result.Append(col.ColumnName);
result.Append(" " + Description + "=\"");
result.Append(col.ColumnDescription);
result.Append("\" ");
result.Append(IsEditable + "=\"");
result.Append(col.IsEditable);
result.Append("\" ");
// Travis.Frisinger - Added Column direction
result.Append(GlobalConstants.DataListIoColDirection + "=\"");
result.Append(col.ColumnIODirection);
result.Append("\" ");
result.Append("/>");
}
result.Append("</");
result.Append(entry.Namespace);
result.Append(">");
}
else
{
AddEntryToBuilder(result, entry);
result.Append("/>");
}
}
result.Append("</" + RootTag + ">");
DataListTranslatedPayloadTO tmp = new DataListTranslatedPayloadTO(result.ToString());
return tmp;
}
示例15: DoRecordSetAppending
internal static void DoRecordSetAppending(ErrorResultTO errors, IBinaryDataListEntry entry, StringBuilder result)
{
var cnt = entry.FetchLastRecordsetIndex();
var cols = entry.Columns;
if(!cols.Any(c => c.ColumnIODirection == enDev2ColumnArgumentDirection.Both || c.ColumnIODirection == enDev2ColumnArgumentDirection.Input))
{
return;
}
for(var i = 1; i <= cnt; i++)
{
string error;
var rowData = entry.FetchRecordAt(i, out error);
errors.AddError(error);
result.Append("<");
result.Append(entry.Namespace);
result.Append(">");
foreach(var col in rowData)
{
var fName = col.FieldName;
if(cols.Any(c => c.ColumnName == fName &&
(c.ColumnIODirection == enDev2ColumnArgumentDirection.Both || c.ColumnIODirection == enDev2ColumnArgumentDirection.Input)))
{
result.Append("<");
result.Append(fName);
result.Append(">");
try
{
result.Append(col.TheValue);
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception)
{
}
result.Append("</");
result.Append(fName);
result.Append(">");
}
}
result.Append("</");
result.Append(entry.Namespace);
result.Append(">");
}
}