Esempio n. 1
0
        private void ParentEl_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.RightButton == MouseButtonState.Pressed)
            {
                var contextMenu = new ContextMenu();
                var reloadPanel = new MenuItem
                {
                    Header = "Сменить панель"
                };
                foreach (var panel in Integrations.GetPanelRZAByType(this.typePanelRZA_))
                {
                    if (panel.NamePanel == this.Name)
                    {
                        continue;
                    }
                    var panelItem = new MenuItem
                    {
                        Header = panel.NamePanel
                    };
                    panelItem.Click += new RoutedEventHandler((senderr, ee) => MenuItem_Click(senderr, ee, delegate { ReloadObject(panel); }));
                    reloadPanel.Items.Add(panelItem);
                }

                var deletePanel = new MenuItem
                {
                    Header = "Удалить панель"
                };
                deletePanel.Click += new RoutedEventHandler((senderr, ee) => MenuItem_Click(senderr, ee, delegate { DeleteObject(); }));

                contextMenu.Items.Add(reloadPanel);
                contextMenu.Items.Add(deletePanel);
                contextMenu.IsOpen = true;
                return;
            }
        }
Esempio n. 2
0
        private void initObjectModels()
        {
            // initializing footer objects
            terms         = new Terms(browser);
            privacy       = new Privacy(browser);
            security      = new Security(browser);
            status        = new Status(browser);
            help          = new Help(browser);
            footerLogo    = new pageObjectModels.footer.Logo(browser);
            contactGitHub = new ContactGitHub(browser);
            api           = new API(browser);
            training      = new Training(browser);
            shop          = new Shop(browser);
            footerBlog    = new pageObjectModels.footer.Blog(browser);
            about         = new About(browser);

            // initializing explore objects
            integrations = new Integrations(browser);
            showcases    = new Showcases(browser);
            trending     = new Trending(browser);

            // initializing header objects
            headerLogo = new pageObjectModels.header.Logo(browser);
            personal   = new Personal(browser);
            openSource = new OpenSource(browser);
            business   = new Business(browser);
            explore    = new Explore(browser);
            pricing    = new Pricing(browser);
            headerBlog = new pageObjectModels.header.Blog(browser);
            support    = new Support(browser);
            searchBar  = new pageObjectModels.header.SearchBar(browser);
            signIn     = new SignIn(browser);
            signUp     = new SignUp(browser);

            // initializing main objects
            signUpUsername  = new SignUpUsername(browser);
            signUpEmail     = new SignUpEmail(browser);
            signUpPassword  = new SignUpPassword(browser);
            signUpSubmit    = new SignUpSubmit(browser);
            signUpForGitHub = new SignUpForGitHubButton(browser);

            // initializing pricing objects
            joinGitHubForFree    = new JoinGitHubForFree(browser);
            upgradeAccount       = new UpgradeAccount(browser);
            createOrganization   = new CreateOrganization(browser);
            startEnterpriseTrial = new StartEnterpriseTrial(browser);

            // initializing blog objects
            featured      = new Featured(browser);
            allPosts      = new AllPosts(browser);
            newFeatures   = new NewFeatures(browser);
            engineering   = new Engineering(browser);
            enterprise    = new Enterprise(browser);
            conferences   = new Conferences(browser);
            meetups       = new Meetups(browser);
            newHires      = new NewHires(browser);
            watercooler   = new Watercooler(browser);
            blogSearchBar = new pageObjectModels.blog.SearchBar(browser);
        }
Esempio n. 3
0
        public IEnumerable <DatasetMember> GetDatasetMembers()
        {
            var dtSources = Integrations.Where(x => x != null).Skip(1); //Skip the root integration

            foreach (var source in dtSources)
            {
                yield return(new DatasetMember(source));
            }
        }
Esempio n. 4
0
        /// <summary> The mod's entry point </summary>
        /// <param name="helper"> Provides simplified APIs </param>
        public override void Entry(IModHelper helper)
        {
            // read config
            this.Config = helper.ReadConfig <ModConfig>();

            // pass stuff to other classes
            this.ModIntegration = new Integrations(this.Helper, this.Monitor, this.ModManifest, this.Config);

            /* Events */
            helper.Events.GameLoop.GameLaunched += this.GameLaunched;
            helper.Events.GameLoop.UpdateTicked += this.UpdateTicked;
            helper.Events.Input.ButtonPressed   += this.ButtonPressed;
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dsName"></param>
        /// <returns></returns>
        public DatasetMember GetDatasetMember(string dsName)
        {
            var dtSources = Integrations.Where(x => x != null);//.Skip(1);

            foreach (var source in dtSources)
            {
                if (source.Name == dsName)
                {
                    return(new DatasetMember(source));
                }
            }
            return(null);
        }
Esempio n. 6
0
        public SalesforceUtils(BaseCompany company)
        {
            this.company = company;
            this.intgr   = company.Intgr;

            //if the company doesn't have basic SF access info
            if (intgr == null || String.IsNullOrEmpty(intgr.SFuser))
            {
                throw new Exception("You need to Setup SF access!");
            }

            username = intgr.SFuser;
            password = intgr.SFpwd + intgr.SFToken;
        }
Esempio n. 7
0
        public SalesforceUtils(BaseCompany company)
        {
            //set this to use the new updated security protocol to make salesforce happy
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; // comparable to modern browsers

            this.company = company;
            this.intgr   = company.Intgr;

            //if the company doesn't have basic SF access info
            if (intgr == null || String.IsNullOrEmpty(intgr.SFuser))
            {
                throw new Exception("You need to Setup SF access!");
            }

            username = intgr.SFuser;
            password = intgr.SFpwd + intgr.SFToken;
        }
Esempio n. 8
0
        public override string ToString()
        {
            var output          = $"define {Type.Name}\n";
            var strIntegrations = string.Join(", ", Integrations.Select(x => x.Name).ToArray());

            output += "from " + strIntegrations + Environment.NewLine;
            foreach (var feature in Features)
            {
                var strFtr = $"set {feature.Member} = {feature.Value}\n";
                output += strFtr;
            }

            if (Targets != null)
            {
                output += "target " + string.Join(", ", Targets.Select(z => z.ToDonutScript())) + "\n";
            }
            return(output);
        }
Esempio n. 9
0
        private Integrations mapIntegration(DataRow dr, Integrations intgr)
        {
            intgr.SupportSignupLink     = returnRealOrBlank(dr["SupportSignUpLink"] as string);
            intgr.SupportSignupLinkInst = returnRealOrBlank(dr["SupportSignUpLinkInstructions"] as string);
            intgr.SFuser             = returnRealOrBlank(dr["IntUser"] as string);
            intgr.SFpwd              = returnRealOrBlank(dr["IntPwd"] as string);
            intgr.SFToken            = returnRealOrBlank(dr["IntToken"] as string);
            intgr.EmailNotifications = returnRealOrBlank(dr["EmailNotifications"] as string);

            intgr.GainsightCTAPriority = returnRealOrBlank(dr["GainsightCTAPriority"] as string);
            intgr.GainsightCTAStatus   = returnRealOrBlank(dr["GainsightCTAStatus"] as string);
            intgr.GainsightCTA         = returnRealOrBlank(dr["GainsightCTA"] as string);
            intgr.GainsightCTAType     = returnRealOrBlank(dr["GainsightCTAType"] as string);
            intgr.GainsightCTAUserId   = returnRealOrBlank(dr["GainsightCTAUserId"] as string);
            intgr.CompanyId            = (dr["CompanyId"] != DBNull.Value ? Convert.ToInt16(dr["CompanyId"]) : 0);
            intgr.IntegrationId        = (dr["IntegrationId"] != DBNull.Value ? Convert.ToInt16(dr["IntegrationId"]) : 0);

            return(intgr);
        }
Esempio n. 10
0
        private BaseCompany getCompanyInfo(BaseCompany gcompany)
        {
            string sqlWId   = "select * from Company where CompanyId = @p1";
            string sqlWGuid = "select * from Company where CompanyGUID = @p1";

            DataRow dr;

            if (String.IsNullOrEmpty(gcompany.CompanyGUID))
            {    //get by company ID
                dr = getFirstRow(getDataSetBySqlOneP(sqlWId, gcompany.CompanyId));
            }
            else   //get by GUID
            {
                dr = getFirstRow(getDataSetBySqlOneP(sqlWGuid, gcompany.CompanyGUID));
            }

            gcompany.CompanyGUID         = returnRealOrBlank(dr["CompanyGUID"] as string);
            gcompany.CompanyId           = (dr["CompanyId"] != DBNull.Value ? Convert.ToInt16(dr["CompanyId"]) : 0);
            gcompany.CompanyName         = returnRealOrBlank(dr["companyName"] as string);
            gcompany.CsmContactEmail     = returnRealOrBlank(dr["CSMContactPhone"] as string);
            gcompany.MainContactEmail    = returnRealOrBlank(dr["MainContactEmail"] as string);
            gcompany.MainContactPhone    = returnRealOrBlank(dr["MainContactPhone"] as string);
            gcompany.ProductsSoldDesc    = returnRealOrBlank(dr["ProductsSoldDesc"] as string);
            gcompany.SupportContactPhone = returnRealOrBlank(dr["SupportContactPhone"] as string);
            gcompany.SupportContactEmail = returnRealOrBlank(dr["SupportContactEmail"] as string);

            //get the integrations
            Integrations intgr = this.getIntegrations(gcompany);

            gcompany.Intgr = intgr;

            return(gcompany);


            /*
             * //database access here
             * gcompany.CompanyId = 1;
             * gcompany.CompanyName = "ACME Bricks";
             * gcompany.SupportSignupLink = "Http://mysupport.signup.com";
             * //should have been database
             * return gcompany;
             */
        }
Esempio n. 11
0
        public RavenConfiguration Initialize()
        {
            var settingsNames           = Settings.AsEnumerable().Select(pair => pair.Key).ToHashSet(StringComparer.OrdinalIgnoreCase);
            var serverWideSettingsNames = ServerWideSettings?.AsEnumerable().Select(pair => pair.Key).ToHashSet(StringComparer.OrdinalIgnoreCase);

            Http.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Embedded.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Server.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Core.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Replication.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Cluster.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Etl.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Queries.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Patching.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Logs.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Memory.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Storage.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Security.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Backup.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Indexing.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Monitoring.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Studio.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Databases.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            PerformanceHints.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Licensing.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Tombstones.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Subscriptions.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            TransactionMergerConfiguration.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Notifications.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Updates.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Migration.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Integrations.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);

            PostInit();

            Initialized = true;

            return(this);
        }
Esempio n. 12
0
 public void setupMysql()
 {
     using (MySqlConnection con = new MySqlConnection(cs))
     {
         con.Open();
         var sql = "SELECT * FROM Integrations;";
         using (var cmd = new MySqlCommand(sql, con))
         {
             using (MySqlDataReader rdr = cmd.ExecuteReader())
             {
                 while (rdr.Read())
                 {
                     Integration newIntegration = new Integration()
                     {
                         TwitchChannel  = rdr["TwitchChannel"].ToString(),
                         DiscordChannel = rdr["DiscordChannel"].ToString(),
                         DiscordGuild   = rdr["DiscordGuild"].ToString()
                     };
                     Integrations.Add(newIntegration);
                 }
             }
         }
     }
 }
        private void ParentEl_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.RightButton == MouseButtonState.Pressed)
            {
                var contextMenu   = new ContextMenu();
                var deleteSubMenu = new MenuItem
                {
                    Header = "Удалить табличку"
                };

                deleteSubMenu.Click += new RoutedEventHandler((senderr, ee) => MenuItem_Click(senderr, ee, delegate { DeleteObject(); }));
                var ChekSubMenu = new MenuItem
                {
                    Header = "Сменить табличку"
                };
                //deleteSubMenu.Click += new RoutedEventHandler((senderr, ee) => MenuItem_Click(senderr, ee, delegate { DeleteObject(); }));
                var menuAddTable = new MenuItem
                {
                    Header = "Добавить табличку"
                };
                Dictionary <TypeInformTable, string> provide = new Dictionary <TypeInformTable, string>()
                {
                    { TypeInformTable.DefaultTable, "Таблички по умолчанию" },
                    { TypeInformTable.DangerVoltage, "Таблички опасное напряжение" },
                    { TypeInformTable.NumberKTP, "Таблички номера блока" },
                    { TypeInformTable.CompartmentAssignment, "Таблички назначения отсека" },
                    { TypeInformTable.CategoryPlace, "Таблички категорий помещения" },
                    { TypeInformTable.FireZoneClasses, "Таблички класса пожарной зоны" },
                    { TypeInformTable.Pasport, "Таблички паспорта блока" },
                    { TypeInformTable.NameBlock, "Таблички имени блока" },
                    { TypeInformTable.TableDefault, "Пользовательская табличка" }
                };

                foreach (var tabel in provide)
                {
                    var nameTypeTable = new MenuItem
                    {
                        Header = tabel.Value
                    };
                    foreach (var pTabel in Integrations.GetInformTableByType(tabel.Key))
                    {
                        var newChek = new MenuItem
                        {
                            Header = pTabel.NameTable
                        };

                        newChek.Click += new RoutedEventHandler((senderr, ee) => MenuItem_Click(senderr, ee, delegate { AddTabel(senderr, ee, pTabel.NameTable); }));
                        nameTypeTable.Items.Add(newChek);
                    }
                    menuAddTable.Items.Add(nameTypeTable);
                }
                foreach (var tabel in Integrations.GetInformTableByType(this.TypeTable))
                {
                    if (this.ImageLogo != tabel.Image)
                    {
                        var newChek = new MenuItem
                        {
                            Header = tabel.NameTable
                        };
                        newChek.Click += new RoutedEventHandler((senderr, ee) => MenuItem_Click(senderr, ee, delegate { ReChekObject(senderr, ee); }));
                        ChekSubMenu.Items.Add(newChek);
                    }
                }
                contextMenu.Items.Add(deleteSubMenu);
                contextMenu.Items.Add(ChekSubMenu);
                contextMenu.Items.Add(menuAddTable);
                contextMenu.IsOpen = true;
                return;
            }
        }
Esempio n. 14
0
        public string createCTA(string name,
                                string comments,
                                CUser user, out ArrayList messages, out bool success)
        {
            if (user.Company == null)
            {
                throw new Exception("Can't create a CTA without a company and an Integration");
            }
            if (user.Company.Intgr == null)
            {
                throw new Exception("Can't create a CTA without a company and an Integration");
            }
            if (user.Company.Intgr.GainsightCTAStatus == null)
            {
                throw new Exception("Can't create a CTA without a Gainsight Info setup!");
            }
            if (user == null || user.ExternalSystemId == null)
            {
                throw new Exception("Can't create a CTA without a salesforce Account Id on the User record!");
            }

            Integrations integrations = user.Company.Intgr;

            //set up returns
            success  = false;
            messages = new ArrayList();

            //the id to return
            string idcreated = "";

            //first login
            if (!login(out messages))
            {
                success = false;

                //throw new Exception("Could not login to Salesforce");
            }

            try
            {
                // Create a new sObject of type Contact
                // and fill out its fields.
                sObject CTA = new SFAccess.sObject();
                System.Xml.XmlElement[] CTAFields = new System.Xml.XmlElement[12];

                // Create the ticket's fields
                System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
                CTAFields[0]            = doc.CreateElement("JBCXM__Account__c");
                CTAFields[0].InnerText  = user.ExternalSystemId;
                CTAFields[1]            = doc.CreateElement("JBCXM__Assignee__c");
                CTAFields[1].InnerText  = integrations.GainsightCTAUserId;// "00541000001LJxYAAW"; //------------------------------------me
                CTAFields[2]            = doc.CreateElement("JBCXM__DueDate__c");
                CTAFields[2].InnerText  = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
                CTAFields[3]            = doc.CreateElement("JBCXM__Priority__c"); //Alert Severity
                CTAFields[3].InnerText  = integrations.GainsightCTAPriority;       // "a0D41000001qZtYEAU"; //-------------------------------------high priority
                CTAFields[4]            = doc.CreateElement("JBCXM__Stage__c");    //Alert STatus
                CTAFields[4].InnerText  = integrations.GainsightCTAStatus;         // "a0D41000001qZsCEAU";//---------------- stands for Open - this is like a status
                CTAFields[5]            = doc.CreateElement("JBCXM__Type__c");
                CTAFields[5].InnerText  = integrations.GainsightCTAType;           // "a1141000000cVEcAAM";//--------------------------------------what is type id ;
                CTAFields[7]            = doc.CreateElement("JBCXM__Reason__c");
                CTAFields[7].InnerText  = integrations.GainsightCTAReason;         // "a0D41000001qZsIEAU";
                CTAFields[8]            = doc.CreateElement("JBCXM__Comments__c");
                CTAFields[8].InnerText  = comments;                                //--------------------------------------
                CTAFields[9]            = doc.CreateElement("Name");
                CTAFields[9].InnerText  = name;
                CTAFields[10]           = doc.CreateElement("JBCXM__CreatedDate__c");
                CTAFields[10].InnerText = DateTime.Now.ToString("yyyy-MM-dd");
                CTAFields[11]           = doc.CreateElement("JBCXM__Playbook__c");
                CTAFields[11].InnerText = integrations.GainsightCTAPlaybook;// "a0d41000000inGeAAI";

                //field to set          picklist Category      other
                //JBCXM__Priority__c    Alert Severity
                //JBCXM__Stage__c       Alert Status
                //JBCXM__Reason__c      Alert Reason
                //JBCXM__TypeName__c                           ? different object - type of CTA?  event or trial
                //JBCXM__Account__c                            from account object
                //JBCXM__Assignee__c                           this is from a user
                //JBCXM__DueDate__c                            user input
                //JBCXM__Comments__c                           user input


                CTA.type = "JBCXM__CTA__c";
                CTA.Any  = CTAFields;

                // Add this sObject to an array
                sObject[] CTAList = new sObject[1];
                CTAList[0] = CTA;

                // Make a create call and pass it the array of sObjects
                SaveResult[] results = binding.create(CTAList);
                // Iterate through the results list
                // and write the ID of the new sObject
                // or the errors if the object creation failed.
                // In this case, we only have one result
                // since we created one ticket.
                for (int j = 0; j < results.Length; j++)
                {
                    if (results[j].success)
                    {
                        messages.Add("\nA CTA was created with an ID of: "
                                     + results[j].id);
                        idcreated = results[j].id;
                    }
                    else
                    {
                        // There were errors during the create call,
                        // go through the errors array and write
                        // them to the console
                        for (int i = 0; i < results[j].errors.Length; i++)
                        {
                            Error err = results[j].errors[i];
                            messages.Add("Errors were found on item " + j.ToString());
                            messages.Add("Error code is: " + err.statusCode.ToString());
                            messages.Add("Error message: " + err.message);
                        }
                    }
                }
            }
            catch (SoapException e)
            {
                messages.Add("An unexpected error has occurred: " + e.Message +
                             " Stack trace: " + e.StackTrace);
            }
            //now logout
            logout();
            return(idcreated);
        }
Esempio n. 15
0
 public Donut.Data.DataIntegration GetRootIntegration()
 {
     return(Integrations.FirstOrDefault());
 }
 public IntegrationRequest(Integrations integrations)
 {
     this.integrations = integrations;
 }