public static OptionObject RunScript(OptionObject optionObject, string parameter)
        {
            string[] parameters    = parameter.Split(',');
            string   fieldNumber   = parameters.Length >= 2 ? parameters[1] : "";
            string   returnMessage = "The FieldValue is ";

            if (optionObject.IsFieldPresent(fieldNumber))
            {
                returnMessage += optionObject.GetFieldValue(fieldNumber);
            }

            returnMessage += ". Since no FieldObjects were modified, no Forms should be returned.";

            return(optionObject.ToReturnOptionObject(ErrorCode.Informational, returnMessage));
        }
 public static OptionObject RunScript(OptionObject optionObject, string parameter)
 {
     if (optionObject.IsFieldPresent("123"))
     {
         string fieldValue = optionObject.GetFieldValue("123");
         if (string.IsNullOrEmpty(fieldValue))
         {
             fieldValue = "I have set the FieldValue.";
         }
         else
         {
             fieldValue += " (I have appended the FieldValue.)";
         }
         optionObject.SetFieldValue("123", fieldValue);
     }
     return(optionObject.ToReturnOptionObject(ErrorCode.Success, "If FieldNumber 123 is found in OptionObject, then it should be the only FieldObject returned. Otherwise, no Forms should be returned."));
 }
Esempio n. 3
0
        public void OptionObject_ReturnOptionObject_AreNotEqual()
        {
            List <FieldObject> fieldObjects = new List <FieldObject>
            {
                new FieldObject("123", "Test")
            };
            RowObject    rowObject    = new RowObject("1||1", fieldObjects);
            FormObject   formObject   = new FormObject("1", rowObject);
            OptionObject optionObject = new OptionObject("USER00", "userId", "000111", "1", "123456", 1, "UAT");

            optionObject.AddFormObject(formObject);

            OptionObject returnOptionObject = optionObject.ToReturnOptionObject();

            Assert.AreNotEqual(optionObject, returnOptionObject);
            Assert.IsTrue(optionObject.IsFieldPresent("123"));
            Assert.IsFalse(returnOptionObject.IsFieldPresent("123"));
        }
Esempio n. 4
0
 public static OptionObject RunScript(OptionObject optionObject)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.Warning, "The code means the RunScript is providing a warning requiring a response from the user."));
 }
Esempio n. 5
0
 public static OptionObject RunScript(OptionObject optionObject)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.Informational, "The code means the RunScript was successful, however is providing an alert or informational notice."));
 }
 public static OptionObject RunScript(OptionObject optionObject)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.Confirm, "The code means the RunScript is prompting a confirmation."));
 }
 public static OptionObject RunScript(OptionObject optionObject)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.Success, "The code means the RunScript was successful."));
 }
 public static OptionObject RunScript(OptionObject optionObject)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.OpenUrl, "https://rarelysimple.com"));
 }
Esempio n. 9
0
        public void NewOptionObjectEntityIDEqualsTransformReturnEntityID()
        {
            OptionObject transformedOptionObject = newOptionObject.ToReturnOptionObject();

            Assert.AreEqual(newOptionObject.EntityID, transformedOptionObject.EntityID);
        }
 public static OptionObject RunScript(OptionObject optionObject)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.Error, "The code means the RunScript experienced an Error and to stop processing."));
 }
Esempio n. 11
0
 public static OptionObject RunScript(OptionObject optionObject, string scriptName)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.Alert, "No script was found with the name '" + scriptName + "'."));
 }
 public static OptionObject RunScript(OptionObject optionObject)
 {
     return(optionObject.ToReturnOptionObject(ErrorCode.OpenForm, "[PM]USER100"));
 }