Exemplo n.º 1
0
 public string ValidateNextCode()
 {
     if (RouteDetail.next_code.Count <= 0)
     {
         return(RouteDetail.next_pass);                                  // if no config no action
     }
     foreach (NextCodeVm code in RouteDetail.next_code)
     {
         var snip = (SnipVm)GetWsObj.GetSnippetBySlug(code.slug);
         if (!(snip.code != "" & snip.status == EnumStatus.A.ToString()))
         {
             continue;
         }
         if (!GetFlexObj.ExecuteScript(snip.code, GetWsObj.TokenAccessKey))
         {
             continue;
         }
         SetMsgAndReturn(EnumMessage.NextCodeExecute, new List <string>()
         {
             snip.name, snip.title, snip.returnmessage, RouteDetail.next_pass, RouteDetail.operation
         }, true);
         RouteDetail.next_pass = RouteDetail.operation;
         return(RouteDetail.operation);
     }
     return(RouteDetail.next_pass);
 }
Exemplo n.º 2
0
        private bool ExecuteScript()
        {
            Debug.Print("ParamItem - ExecuteScript");
            if (ParamItemDetail == null)
            {
                ReturnMsg = GetMsgObj.GetSystemMsg(EnumMessage.ParameterItemDetailNotFound, new List <string>()
                {
                    ParamItem.title
                });
                return(false);
            }
            if (ParamItemDetail.snippet == null)
            {
                return(true);
            }
            var c = GetWsObj.GetSnippetBySlug(ParamItemDetail.snippet);

            if (c == null)
            {
                return(true);
            }
            // If GetFlexObj.ExecuteScript(c.code, FormObject) Then
            if (GetFlexObj.ExecuteScript(c.code, GetWsObj.TokenAccessKey))
            {
                return(true);
            }
            ReturnMsg = GetMsgObj.GetSystemMsg(EnumMessage.SnipReturnFalse, new List <string>()
            {
                c.name, c.title, c.returnmessage
            });
            return(false);
        }