public static OutlineParameter GetOneSimpleParameter(string url, string sessionid) { CatalogueApi catalogueApi = new CatalogueApi(url); ParameterTypeAliasArray aliases = catalogueApi.CatalogueParameters(sessionid); ParameterTypeAlias palias = aliases[0]; Guid g = Guid.NewGuid(); //orderNum: 31, productName: "Red Mug", sellerName: "Gift Shop" OutlineParameter outlineParameter = new OutlineParameter(Id: null, Name: "amount" + g.ToString().Replace('-', '_'), Path: null, Description: "amount" + g.ToString().Replace('-', '_'), ParameterTypeName: palias.ParameterTypeName, ParameterRoleName: palias.ParameterRoleName, DataTypeName: palias.DataTypeName, DataFormatName: palias.DataFormatName, DataElementPath: null, DisplayUnit: null); return(outlineParameter); }
public TestOutcome CreateParameter() { TestOutcome outcome = new TestOutcome(); outcome.moduleName = "OutlineParameters"; outcome.methodName = "OutlineParameterCreate"; try { OutlineParametersApi outlineParametersApi = new OutlineParametersApi(_url); OutlineParameter op = ParameterGenerator.GetOneSimpleParameter(_url, _session.SessionId); outlineParametersApi.OutlineParameterCreate(_session.SessionId, "main", op); Console.WriteLine(op.Id); outcome.outcome = "Success"; return(outcome); } catch (Exception ex) { outcome.outcome = ex.Message; return(outcome); } }
public TestOutcome UpdateParameter() { TestOutcome outcome = new TestOutcome(); outcome.moduleName = "OutlineParameters"; outcome.methodName = "OutlineParameterUpdate"; try { OutlineParametersApi outlineParametersApi = new OutlineParametersApi(_url); OutlineParameter outlineParameter = outlineParametersApi.OutlineParameterFind(_session.SessionId, "main/plate_id"); outlineParameter.Description = "a new description"; Folder ops = outlineParametersApi.OutlineParameterUpdate(_session.SessionId, outlineParameter.Id, outlineParameter); Console.WriteLine(ops.Description); outcome.outcome = "Success"; return(outcome); } catch (Exception ex) { outcome.outcome = ex.Message; return(outcome); } }