コード例 #1
0
        public void Should_Payment_Form_Contain_NoRecaptcha()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Transnational);
            Login();

            OrgId = CreateOrgWithFee();

            SettingUtils.UpdateSetting("UseRecaptcha", "false");

            Open($"{rootUrl}OnlineReg/{OrgId}");

            Find(id: "otheredit").Click();
            WaitForElement("#submitit", 3);
            Find(id: "submitit").Click();

            Wait(4);

            var element = Find(css: ".noRecaptcha");

            element.ShouldNotBeNull();
        }
コード例 #2
0
        private void LoadBatchOptions()
        {
            try
            {
                string appDirectory = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Solibri Batch Manager");
                if (!Directory.Exists(appDirectory))
                {
                    Directory.CreateDirectory(appDirectory);
                }
                batchOptionFile = System.IO.Path.Combine(appDirectory, batchOptionFile);

                if (!File.Exists(batchOptionFile))
                {
                    BatchOptions options = new BatchOptions();
                    options.WriteDefault();
                    SettingUtils.WriteSettings(batchOptionFile, options);
                    settings.Options = options;
                }
                else
                {
                    settings.Options = SettingUtils.ReadSettings(batchOptionFile);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
コード例 #3
0
        public void Should_Change_Payment_Methods()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Transnational);
            Login();

            OrgId = CreateOrgWithFee();

            SettingUtils.UpdateSetting("UseRecaptcha", "false");

            PayRegistration(OrgId, true);

            var startNewTransaction = Find(xpath: "//a[contains(text(),'Start a New Transaction')]");

            startNewTransaction.ShouldNotBeNull();

            var paymentInfo = db.PaymentInfos.SingleOrDefault(x => x.PeopleId == user.PeopleId);

            if (paymentInfo != null)
            {
                paymentInfo.PreferredPaymentType.ShouldBe("B");
            }
        }
コード例 #4
0
        public void Should_Hide_Deceased_People()
        {
            username = RandomString();
            password = RandomString();

            var FamilyMember = FamilyUtils.CreateFamilyWithDeceasedMember();

            var user = CreateUser(username, password, person: FamilyMember);

            Login();

            SettingUtils.UpdateSetting("HideDeceasedFromFamily", "false");

            Open($"{rootUrl}Person2/{FamilyMember.PeopleId}");
            WaitForElement("#family_members", 10);

            var deceasedMember = Find(css: "#family_members > li.alert-danger");

            deceasedMember.ShouldNotBe(null);

            SettingUtils.UpdateSetting("HideDeceasedFromFamily", "true");

            Open($"{rootUrl}Person2/Current");
            WaitForElement("#family_members", 10);

            deceasedMember = Find(css: "#family_members > li.alert-danger");
            deceasedMember.ShouldBe(null);
        }
コード例 #5
0
ファイル: ThemeManager.cs プロジェクト: radtek/NmtExplorer
        public static string GetThemeValue(string themeName, string itemName, string screenType)
        {
            string path  = GetThemeConfigurationFilePath(themeName);
            string xpath = String.Format("configuration/themeSettings/{0}", itemName);

            return(SettingUtils.GetValue(path, xpath, screenType));
        }
コード例 #6
0
        public void Should_Remember_Last_Year_Selected()
        {
            SettingUtils.UpdateSetting("CombinedGivingSummary", "false");

            var username1 = RandomString();
            var password1 = RandomString();
            var user1     = CreateUser(username1, password1);

            var username2 = RandomString();
            var password2 = RandomString();
            var user2     = CreateUser(username2, password2);

            var admin = LoginAsAdmin();

            Open($"{rootUrl}Person2/{user1.PeopleId}");
            WaitForElement(".active:nth-child(2) > a", 10);
            PageSource.ShouldContain("<a href=\"#giving\" aria-controls=\"giving\" data-toggle=\"tab\">Giving</a>");

            Find(text: "Giving").Click();
            WaitForElement("#GivingYear", 10);
            WaitForElementToDisappear(loadingUI);

            var dropdown      = Find(css: "#GivingYear");
            var selectElement = new SelectElement(dropdown);

            selectElement.SelectByText("All Years");

            WaitForElement("#Giving-detail-section", 10);

            Open($"{rootUrl}Person2/{user2.PeopleId}");
            WaitForElement("#GivingYear", 10);

            PageSource.ShouldContain("<input name=\"Year\" type=\"hidden\" value=\"All Years\">");
        }
コード例 #7
0
ファイル: ThemeManager.cs プロジェクト: radtek/NmtExplorer
        public static string GetLanguageValue(string themeName, string itemName, string langaugeID)
        {
            string path  = GetThemeConfigurationFilePath(themeName);
            string xpath = String.Format("configuration/languageSettings/{0}", itemName);

            return(SettingUtils.GetValue(path, xpath, langaugeID));
        }
コード例 #8
0
        private void OnGUI()
        {
            actorMeshPrefab = (GameObject)EditorGUILayout.ObjectField(actorMeshPrefab, typeof(GameObject), false);

            EditorGUILayout.Space(10);

            if (actorMeshPrefab == null)
            {
                return;
            }

            if (GUILayout.Button("Create Player", GUILayout.Height(30)))
            {
                actor = new GameObject(actorMeshPrefab.name);
                ActorController controller = actor.AddComponent <DefaultActorController>();
                controller.model = actor.GetComponent <ActorModel>();

                // Add Character Mesh object
                GameObject meshObj = PrefabUtility.InstantiatePrefab(actorMeshPrefab) as GameObject;
                meshObj.transform.SetParent(actor.transform);
                if (meshObj.GetComponent <Animator>())
                {
                    meshObj.GetComponent <Animator>().applyRootMotion = false;
                }
                else
                {
                    meshObj.AddComponent <Animator>().applyRootMotion = false;
                }


                // Add HitbBox
                GameObject hitBoxGO = GameObject.CreatePrimitive(PrimitiveType.Cube);
                hitBoxGO.name = "HitBox";
                hitBoxGO.transform.SetParent(actor.transform);
                hitBoxGO.AddComponent <HitBox>();
                hitBoxGO.GetComponent <Rigidbody>().isKinematic = true;
                hitBoxGO.GetComponent <LineRenderer>().enabled  = false;
                ColliderVisualizer hitBoxVisualizer = hitBoxGO.GetComponent <ColliderVisualizer>();
                hitBoxVisualizer.lineColor = new Color(0, 0.72f, 1f, 1f);
                MeshRenderer hitBoxRenderer = hitBoxGO.GetComponent <MeshRenderer>();
                hitBoxRenderer.material = (Material)AssetDatabase.LoadAssetAtPath("Assets/Plugins/CombatDesigner/Artworks/Materials/HitBoxMat.mat", typeof(Material));
                hitBoxRenderer.enabled  = false;
                SettingUtils.AddLayer("HitBox");
                hitBoxGO.layer = LayerMask.NameToLayer("HitBox");

                // Add HurtBox
                GameObject hurtBoxGO = GameObject.CreatePrimitive(PrimitiveType.Cube);
                hurtBoxGO.name = "HurtBox";
                hurtBoxGO.transform.SetParent(actor.transform);
                hurtBoxGO.AddComponent <HurtBox>();
                hurtBoxGO.GetComponent <LineRenderer>().enabled = false;
                ColliderVisualizer hurtBoxVisualizer = hurtBoxGO.GetComponent <ColliderVisualizer>();
                hurtBoxVisualizer.lineColor = new Color(1, 0.06f, 0.06f, 1);
                MeshRenderer hurtBoxRenderer = hurtBoxGO.GetComponent <MeshRenderer>();
                hurtBoxRenderer.material = (Material)AssetDatabase.LoadAssetAtPath("Assets/Plugins/CombatDesigner/Artworks/Materials/HurtBoxMat.mat", typeof(Material));
                hurtBoxRenderer.enabled  = false;
                SettingUtils.AddLayer("HurtBox");
                hurtBoxGO.layer = LayerMask.NameToLayer("HurtBox");
            }
        }
コード例 #9
0
        public void Should_Find_Transacionts()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Transnational);
            Login();

            OrgId = CreateOrgWithFee();

            SettingUtils.UpdateSetting("UseRecaptcha", "false");

            PayRegistration(OrgId, true);

            Open($"{rootUrl}Transactions/");

            var people = db.People.FirstOrDefault(p => p.PeopleId == user.PeopleId);

            Find(xpath: "//input[@id='name']").Clear();
            Find(xpath: "//input[@id='name']").SendKeys(people.FirstName);

            Find(xpath: "//form[@id='form']/div/div[2]/div[6]/div/div[2]/label").Click();
            Find(xpath: "//a[@id='filter']").Click();

            var element = Find(xpath: "//table[@id='resultsTable']/tbody/tr/td[7]");

            element.ShouldNotBeNull();
        }
コード例 #10
0
        private void SyncInstallationBindings()
        {
            InstallServiceCommand   = new WrappedCommand(new InstallServiceCommand(Path, Configurations.SERVICE_NAME));
            UninstallServiceCommand = new WrappedCommand(new UninstallServiceCommand(Path, Configurations.SERVICE_NAME));

            NetworkCredential credential = CredentialManager.GetCredentials(Configurations.SERVICE_NAME);

            if (credential is object)
            {
                Username             = credential.UserName;
                PasswordBox.Password = credential.Password;
            }

            if (File.Exists(Path))
            {
                Configuration configuration = ConfigurationManager.OpenExeConfiguration(Path);
                CasEndpoint     = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.CAS_API_ENDPOINT, defaultCasEndpoint);
                ServiceEndpoint = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.OPTOPLUS_API_ENDPOINT, defaultServiceEndpoint);
                InputPath       = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.INPUT_PATH, "");
                OutputPath      = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.OUTPUT_PATH, "");
                ProcessedPath   = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.PROCESSED_PATH, "");
                ErrorPath       = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.ERROR_PATH, "");
                SurfacePath     = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.SURFACE_PATH, "");
                AnalysisPath    = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.ANALYSIS_PATH, "");
                OutputFormat    = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.OUTPUT_FORMAT, "");
                Gax             = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.GAX, "");
                LapGax          = SettingUtils.ReadSetting(configuration.AppSettings.Settings, Configurations.LAPGAX, "");
            }
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: MinhHuong/WSN-PN
        private static void Main(string[] files)
        {
            Application.SetCompatibleTextRenderingDefault(false);
            Application.EnableVisualStyles();
            Application.DoEvents();

            //if (Common.Ultility.Ultility.IsWindowsOS)
            //{
            //    // start the splash thread at the beginning
            //    var splashThread = new Thread(SplashScreen.SplashScreen.ShowSplashScreen) {IsBackground = true};
            //    splashThread.Start();
            //}

            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            try
            {
                SettingUtils.ReadSettingValue();
            }
            catch (Exception) { }

            FormMain mainForm;

            if (Common.Utility.Utilities.IsWindowsOS)
            {
                //// tell the user what we do here
                //SplashScreen.SplashScreen.UpdateStatusText("Update checked");

                mainForm = new FormMain();

                //// after load the main form, close the splashscreen
                //SplashScreen.SplashScreen.CloseSplashScreen();
            }
            else
            {
                mainForm = new FormMain();
            }

            try
            {
                if (files.Length > 0)
                {
                    mainForm.OpenFile(files[0], false);
                }
                else
                {
                    mainForm.OpenFileLastFile();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Invalid File on arguments:" + ex.Message + ex.StackTrace);
            }

            Application.Run(mainForm);
        }
        public HttpResponseMessage Canvas(String tenantId, String flowId, String playerUrl)
        {
            String              redirectUrl   = null;
            String              signedRequest = null;
            CanvasRequest       canvasRequest = null;
            HttpResponseMessage response      = null;

            try
            {
                // Get the signed request from the form post
                signedRequest = System.Web.HttpContext.Current.Request.Form["signed_request"];

                // Grab the canvas request object from the post
                // The secret needs to be stored somewhere - actually, it doesn't - we don't need the secret at all
                canvasRequest = SalesforceCanvasUtils.VerifyAndDecode(null, signedRequest, "6156156167154975556");

                if (flowId == null ||
                    flowId.Trim().Length == 0)
                {
                    throw new ArgumentNullException("BadRequest", "A flow identifier is required.  Please pass in a parameter for \"flow-id\".");
                }

                if (tenantId == null ||
                    tenantId.Trim().Length == 0)
                {
                    throw new ArgumentNullException("BadRequest", "A tenant identifier is required.  Please pass in a parameter for \"tenant-id\".");
                }

                if (playerUrl == null ||
                    playerUrl.Trim().Length == 0)
                {
                    throw new ArgumentNullException("BadRequest", "A player is required.  Please pass in a parameter for \"player-url\".");
                }

                // Construct the redirect url so the player knows what to do
                redirectUrl  = "";
                redirectUrl += SettingUtils.GetStringSetting(SETTING_SERVER_BASE_PATH) + "/" + tenantId + "/play/" + playerUrl;
                redirectUrl += "?session-token=" + canvasRequest.client.oauthToken;
                redirectUrl += "&session-url=" + HttpUtility.HtmlEncode(canvasRequest.client.instanceUrl + canvasRequest.context.links.partnerUrl);

                // Create the run url stuff using utils
                redirectUrl = RunUtils.CompleteRunUrl(redirectUrl, Guid.Parse(flowId));

                // Tell the caller to redirect back to the desired location
                response = Request.CreateResponse(HttpStatusCode.RedirectMethod, redirectUrl);
                response.Headers.Add("Location", redirectUrl);
            }
            catch (Exception exception)
            {
                throw BaseHttpUtils.GetWebException(HttpStatusCode.BadRequest, BaseHttpUtils.GetExceptionMessage(exception));
            }

            return(response);
        }
コード例 #13
0
        public void SaveSetting()
        {
            SettingUtils helper = new SettingUtils(settingPath, "SearchTool.Properties.Settings");

            helper.SetSettingValue("Top", Top.ToString());
            helper.SetSettingValue("Left", Left.ToString());
            helper.SetSettingValue("RadioType", RadioType);
            helper.SetSettingValue("Topmost", Topmost.ToString());

            helper.Save();
        }
コード例 #14
0
 /// <summary>
 /// 此部分中提供的方法只是用于使
 /// NavigationHelper 可响应页面的导航方法。
 /// <para>
 /// 应将页面特有的逻辑放入用于
 /// <see cref="NavigationHelper.LoadState"/>
 /// 和 <see cref="NavigationHelper.SaveState"/> 的事件处理程序中。
 /// 除了在会话期间保留的页面状态之外
 /// LoadState 方法中还提供导航参数。
 /// </para>
 /// </summary>
 /// <param name="e">提供导航方法数据和
 /// 无法取消导航请求的事件处理程序。</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     this.navigationHelper.OnNavigatedTo(e);
     LogoStoryboard.Begin();
     if (SettingUtils.Get("username") != null && SettingUtils.Get("password") != null)
     {
         UsernameTextBox.Text = SettingUtils.Get("username") as string;
         PasswordBox.Password = SettingUtils.Get("password") as string;
         InfoTextBlock.Text   = "已登录!";
     }
 }
コード例 #15
0
        /// <summary>
        /// 此部分中提供的方法只是用于使
        /// NavigationHelper 可响应页面的导航方法。
        /// <para>
        /// 应将页面特有的逻辑放入用于
        /// <see cref="NavigationHelper.LoadState"/>
        /// 和 <see cref="NavigationHelper.SaveState"/> 的事件处理程序中。
        /// 除了在会话期间保留的页面状态之外
        /// LoadState 方法中还提供导航参数。
        /// </para>
        /// </summary>
        /// <param name="e">提供导航方法数据和
        /// 无法取消导航请求的事件处理程序。</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.navigationHelper.OnNavigatedTo(e);
            AppHelper.ShowStatusBar();

            string username = SettingUtils.Get("username") as string;

            if (username != null)
            {
                UserTextBlock.Text = username;
            }
        }
コード例 #16
0
ファイル: OptionForm.cs プロジェクト: MinhHuong/WSN-PN
        private void Button_OK_Click(object sender, EventArgs e)
        {
            try
            {
                Ultility.MC_INITIAL_SIZE               = (int)this.NUD_MC_Initial.Value;
                Ultility.SIMULATION_BOUND              = (int)this.NUD_SimulationBound.Value;
                SettingUtils.CHECK_UPDATE_AT_START     = CheckBox_CheckUpdate.Checked;
                Ultility.ABSTRACT_CUT_NUMBER           = (int)this.NUD_CutNumber.Value;
                Ultility.ABSTRACT_CUT_NUMBER_BOUND     = (int)this.NUD_CutNumberBound.Value;
                SettingUtils.DEFAULT_MODELING_LANGUAGE = this.ComboBox_DefaultModelingLanguage.Text;
                Ultility.PERFORM_DETERMINIZATION       = CheckBox_PerformDeterminization.Checked;

                Common.Utility.Utilities.SEND_EMAIL_USE_SSL = CheckBox_EmailSSL.Checked;

                SettingUtils.LATEX_AUTO_SAVE = CheckBox_Latex_Autosave.AutoCheck;
                SettingUtils.AUTO_SAVE       = CheckBox_AutoSave.Checked;
                SettingUtils.LINK_CSP        = CheckBox_LinkCSP.Checked;

                if (CheckBox_LinkCSP.Checked)
                {
                    if (Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.csp") != null)
                    {
                        Registry.CurrentUser.DeleteSubKeyTree(@"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.csp");
                    }
                    Registry.ClassesRoot.CreateSubKey(".csp").SetValue("", "CSP", Microsoft.Win32.RegistryValueKind.String);
                    Registry.ClassesRoot.CreateSubKey(@".csp\shell\open\command").SetValue("", Application.ExecutablePath + " \"%1\"", Microsoft.Win32.RegistryValueKind.String);
                }
                else
                {
                    if (Registry.ClassesRoot.OpenSubKey(".csp") != null)
                    {
                        Registry.ClassesRoot.DeleteSubKeyTree(".csp");
                    }
                }

                //BDD
                this.WriteBDDData();

                foreach (OptionPanelInterface tab in Tabs)
                {
                    tab.WriteData();
                }
            }
            catch (Exception ex)
            {
                //Common.Ultility.Ultility.LogException(ex, null);
            }

            SettingUtils.SaveSettingValue();
        }
コード例 #17
0
    public static void LoadSettings()
    {
        TextAsset textAsset = AssetManager.Load <TextAsset>("EmbeddedAsset/Manifest/FieldMap/settingUtils.txt", false);

        if (textAsset == (UnityEngine.Object)null)
        {
            return;
        }
        SettingUtils.jsNode = JSON.Parse(textAsset.text);
        if (SettingUtils.jsNode == null)
        {
            return;
        }
        JSONNode jsonnode = SettingUtils.jsNode["FieldMapSettings"];

        if (jsonnode == null)
        {
            return;
        }
        if (jsonnode["enable"] != null)
        {
            SettingUtils.fieldMapSettings.enable = jsonnode["enable"].AsBool;
        }
        SettingUtils._ReadFieldMapSettingsFromJSONNode(jsonnode);
        if (jsonnode["activeProfileId"] != null)
        {
            SettingUtils.fieldMapSettings.activeProfileId = jsonnode["activeProfileId"].AsInt;
        }
        if (SettingUtils.fieldMapSettings.activeProfileId == -1)
        {
            return;
        }
        JSONNode jsonnode2 = jsonnode["debugProfile"];

        if (jsonnode2 == null)
        {
            return;
        }
        String   aKey      = "profile_" + SettingUtils.fieldMapSettings.activeProfileId;
        JSONNode jsonnode3 = jsonnode2[aKey];

        if (jsonnode3 == null)
        {
            return;
        }
        SettingUtils._ReadFieldMapSettingsFromJSONNode(jsonnode3);
    }
コード例 #18
0
 private static void _ReadFieldMapSettingsFromJSONNode(JSONNode node)
 {
     if (node["language"] != null)
     {
         SettingUtils.fieldMapSettings.language = node["language"].Value;
     }
     if (node["fldMapNo"] != null)
     {
         SettingUtils.fieldMapSettings.fldMapNo = node["fldMapNo"].AsInt;
     }
     if (node["SC_COUNTER_SVR"] != null)
     {
         SettingUtils.fieldMapSettings.SC_COUNTER_SVR = node["SC_COUNTER_SVR"].AsInt;
     }
     if (node["MAP_INDEX_SVR"] != null)
     {
         SettingUtils.fieldMapSettings.MAP_INDEX_SVR = node["MAP_INDEX_SVR"].AsInt;
     }
     if (node["isDebugWalkMesh"] != null)
     {
         SettingUtils.fieldMapSettings.isDebugWalkMesh = node["isDebugWalkMesh"].AsBool;
     }
     if (node["debugObjName"] != null)
     {
         SettingUtils.fieldMapSettings.debugObjName = node["debugObjName"].Value;
     }
     if (node["debugTriIdx"] != null)
     {
         SettingUtils.fieldMapSettings.debugTriIdx = node["debugTriIdx"].AsInt;
     }
     for (Int32 i = 0; i < (Int32)SettingUtils.fieldMapSettings.debugPosMarker.Length; i++)
     {
         if (node["debugPosMarker" + i] != null)
         {
             SettingUtils.fieldMapSettings.debugPosMarker[i] = SettingUtils.ReadVector3(node, "debugPosMarker" + i);
         }
     }
     if (node["debugInt0"] != null)
     {
         SettingUtils.fieldMapSettings.debugInt0 = node["debugInt0"].AsInt;
     }
     if (node["debugFloat0"] != null)
     {
         SettingUtils.fieldMapSettings.debugFloat0 = node["debugFloat0"].AsFloat;
     }
 }
コード例 #19
0
        public void Should_Exclude_In_Small_Group_Filter()
        {
            var SGFxml = SpecialContentUtils.CreateSpecialContent(1, "SGF-MockedXML.xml", null);

            SpecialContentId = SGFxml.Id;
            SpecialContentUtils.UpdateSpecialContent(SpecialContentId, SGFxml.Name, SGFxml.Name, "<?xml version=\"1.0\" encoding=\"utf-8\"?>  <SGF divisionid=\"30\" layout=\"SGF-Layout\" gutter=\"SGF-Gutter\">    <SGFSettings>     <SGFSetting name=\"SubmitText\" value=\"Find Groups\" />     <SGFSetting name=\"ShowHeaders\" value=\"true\" />     <SGFSetting name=\"TextSize\" value=\"18\" />     <SGFSetting name=\"FontFamily\" value=\"Verdana,Arial,Helvetica,sans-serif\" />     <SGFSetting name=\"BGColor\" value=\"#FFFFFF\" />     <SGFSetting name=\"FGColor\" value=\"#000000\" />  </SGFSettings>    <SGFFilters>     <SGFFilter name=\"SGF:Gender\" title=\"Gender\" locked=\"false\" lockedvalue=\"\" />     <SGFFilter name=\"SGF:Childcare\" title=\"Childcare\" locked=\"false\" lockedvalue=\"\" />     <SGFFilter name=\"SGF:Location\" title=\"Location\" locked=\"false\" lockedvalue=\"\" />     <SGFFilter name=\"Campus\" title=\"Church\" locked=\"false\" lockedvalue=\"\" exclude=\"Do Not Attend\" />  </SGFFilters>    </SGF>", null, null, null);

            SettingUtils.UpdateSetting("SGF-OrgTypes", "MockedOrgType, Do Not Attend");

            SmallGroupFinderModel m = new SmallGroupFinderModel();

            m.load("MockedXML");

            var filter = m.getFilterItems(3);

            filter[0].value.ShouldBe("-- All --");
        }
        public HttpResponseMessage SessionSignIn(String tenantId, String flowId, String playerUrl, String sessionId, String sessionUrl)
        {
            String redirectUrl           = null;
            HttpResponseMessage response = null;

            try
            {
                if (flowId == null ||
                    flowId.Trim().Length == 0)
                {
                    throw new ArgumentNullException("BadRequest", "A flow identifier is required.  Please pass in a parameter for \"flow-id\".");
                }

                if (tenantId == null ||
                    tenantId.Trim().Length == 0)
                {
                    throw new ArgumentNullException("BadRequest", "A tenant identifier is required.  Please pass in a parameter for \"tenant-id\".");
                }

                if (playerUrl == null ||
                    playerUrl.Trim().Length == 0)
                {
                    throw new ArgumentNullException("BadRequest", "A player is required.  Please pass in a parameter for \"player-url\".");
                }

                // Construct the redirect url so the player knows what to do
                redirectUrl  = "";
                redirectUrl += SettingUtils.GetStringSetting(SETTING_SERVER_BASE_PATH) + "/" + tenantId + "/play/" + playerUrl;
                redirectUrl += "?session-token=" + sessionId;
                redirectUrl += "&session-url=" + sessionUrl;

                // Create the run url stuff using utils
                redirectUrl = RunUtils.CompleteRunUrl(redirectUrl, Guid.Parse(flowId));

                // Tell the caller to redirect back to the desired location
                response = Request.CreateResponse(HttpStatusCode.RedirectMethod, redirectUrl);
                response.Headers.Add("Location", redirectUrl);
            }
            catch (Exception exception)
            {
                throw BaseHttpUtils.GetWebException(HttpStatusCode.BadRequest, BaseHttpUtils.GetExceptionMessage(exception));
            }

            return(response);
        }
コード例 #21
0
        public void Should_Show_Pledge_Giving_Tab()
        {
            SettingUtils.UpdateSetting("CombinedGivingSummary", "false");

            username = RandomString();
            password = RandomString();
            var user = CreateUser(username, password);

            Login();

            Open($"{rootUrl}Person2/{user.PeopleId}");
            WaitForElement(".active:nth-child(2) > a", 10);
            PageSource.ShouldContain("<a href=\"#giving\" aria-controls=\"giving\" data-toggle=\"tab\">Giving</a>");

            Find(text: "Giving").Click();
            WaitForElement("#giving", 10);

            PageSource.ShouldContain("Contributions");
            PageSource.ShouldContain("Pledges");
        }
コード例 #22
0
        public void TestSearchBuilderOrgsDropdownOption()
        {
            const string finddivision = "input[type=radio][value$='First Division']";
            const string findorg      = "input[type=radio][value$='Online Giving']";
            const string settingname  = "ShowAllOrgsByDefaultInSearchBuilder";

            LoginAsAdmin();

            SettingUtils.DeleteSetting(settingname);
            WaitForPageLoad();
            DisplayOrgDropdowns();
            IsElementPresent(finddivision).ShouldBeTrue();
            IsElementPresent(findorg).ShouldBeTrue();

            SettingUtils.UpdateSetting(settingname, "false");
            WaitForPageLoad();
            DisplayOrgDropdowns();
            IsElementPresent(finddivision).ShouldBeFalse();
            IsElementPresent(findorg).ShouldBeFalse();
        }
コード例 #23
0
        public void Relaxed_Questions_Should_Not_Be_Visible()
        {
            CMSDataContext db              = CMSDataContext.Create(DatabaseFixture.Host);
            var            requestManager  = FakeRequestManager.Create();
            var            controller      = new CmsWeb.Areas.OnlineReg.Controllers.OnlineRegController(requestManager);
            var            routeDataValues = new Dictionary <string, string> {
                { "controller", "OnlineReg" }
            };

            controller.ControllerContext = ControllerTestUtils.FakeControllerContext(controller, routeDataValues);

            var FakeOrg = FakeOrganizationUtils.MakeFakeOrganization(requestManager, new CmsData.Organization()
            {
                OrganizationName   = "MockName",
                RegistrationTitle  = "MockTitle",
                Location           = "MockLocation",
                RegistrationTypeId = RegistrationTypeCode.JoinOrganization
            });

            OrgId = FakeOrg.org.OrganizationId;

            username = RandomString();
            password = RandomString();
            var user = CreateUser(username, password, roles: new string[] { "Edit", "Access" });

            Login();

            SettingUtils.UpdateSetting("RelaxedReqAdminOnly", "true");

            Open($"{rootUrl}Org/{OrgId}#tab-Registrations-tab");
            WaitForElementToDisappear(loadingUI);

            Find(css: "#Registration > form > div.row > div:nth-child(2) > div > a.btn.edit.ajax.btn-primary").Click();
            WaitForElementToDisappear(loadingUI);

            var inputDOB = Find(id: "ShowDOBOnFind");

            inputDOB.ShouldBeNull();
        }
コード例 #24
0
        public void Should_Hide_Giving_Tab()
        {
            SettingUtils.UpdateSetting("HideGivingTabMyDataUsers", "false");

            username = RandomString();
            password = RandomString();
            var user = CreateUser(username, password);

            Login();

            Open($"{rootUrl}Person2/{user.PeopleId}");
            WaitForElement(".active:nth-child(2) > a", 10);
            PageSource.ShouldContain("<a href=\"#giving\" aria-controls=\"giving\" data-toggle=\"tab\">Giving</a>");

            SettingUtils.UpdateSetting("HideGivingTabMyDataUsers", "true");

            Open($"{rootUrl}Person2/Current"); //refresh page
            WaitForElement(".active:nth-child(2) > a", 5);
            PageSource.ShouldNotContain("<a href=\"#giving\" aria-controls=\"giving\" data-toggle=\"tab\">Giving</a>");

            SettingUtils.DeleteSetting("HideGivingTabMyDataUsers");
        }
コード例 #25
0
        private void ApplicationStartUp(object sender, StartupEventArgs e)
        {
            try
            {
                Thread.CurrentThread.CurrentCulture   = new CultureInfo("ja-JP");
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("ja-JP");

                Reactive.Bindings.UIDispatcherScheduler.Initialize();
                var settingUtils = new SettingUtils();
                var userSetting  = settingUtils.getUserSetting();
                if (userSetting == null)
                {
                    if (!settingUtils.CreateUserSetting(out var message))
                    {
                        throw new Exception(message);
                    }
                }
                var imageDir = "./images";
                if (!Directory.Exists(imageDir))
                {
                    Directory.CreateDirectory(imageDir);
                }
                var defaultAccont = userSetting?.UserAccounts?.FirstOrDefault(ua => ua.DefaultAccount);
                if (defaultAccont != null)
                {
                    var token       = defaultAccont.Token;
                    var tokenSecret = defaultAccont.TokenSecret;
                    Authorization.GetToken(token: token, tokenSecret: tokenSecret);
                }
            }
            catch (Exception exception)
            {
                logger.Error(exception.Message);
                logger.Error(exception.StackTrace);
                MessageBox.Show("起動に失敗しました");
                System.Windows.Application.Current.Shutdown(1);
            }
        }
コード例 #26
0
        public void Should_RetrieveBatchDates_With_No_Date()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Acceptiva);
            Login();
            Wait(3);
            OrgId = CreateOrgWithFee();
            SettingUtils.UpdateSetting("UseRecaptcha", "false");
            SettingUtils.UpdateSetting("AutomaticSettle", "true");
            SettingUtils.UpdateSetting("AutoSyncBatchDates", "true");
            SettingUtils.UpdateSetting("AutoSyncBatchDatesWindow", "10");
            PayRegistration(OrgId);

            db.RetrieveBatchData(testing: true);
            var transaction = db.Transactions.FirstOrDefault(t => t.OrgId == OrgId);

            transaction.Settled.ShouldNotBeNull();
        }
コード例 #27
0
 private void tbNTLEAPath_TextChanged(object sender, EventArgs e)
 {
     SettingUtils.Change("NTLEAPath", tbNTLEAPath.Text);
 }
コード例 #28
0
 private void buttonApply_Click(object sender, RoutedEventArgs e)
 {
     SettingUtils.WriteSettings(batchOptionFile, settings.Options);
     this.DialogResult = true;
 }
コード例 #29
0
        public void ExtractData(INotifier notifier, String soapBody, String mode)
        {
            XmlTextReader xtr  = null;
            XmlDocument   doc  = null;
            XmlNode       node = null;

            if (soapBody != String.Empty)
            {
                if (SettingUtils.IsDebugging(mode))
                {
                    notifier.AddLogEntry("Parsing notification SOAP: " + soapBody);
                }

                xtr  = new XmlTextReader(new System.IO.StringReader(soapBody));
                doc  = new XmlDocument();
                node = doc.ReadNode(xtr);

                while (xtr.Read())
                {
                    if (xtr.IsStartElement())
                    {
                        // Get element name
                        switch (xtr.Name)
                        {
                        //extract session id
                        case "SessionId":
                            if (xtr.Read())
                            {
                                this.SessionID = xtr.Value.Trim();
                                if (SettingUtils.IsDebugging(mode))
                                {
                                    notifier.AddLogEntry("SessionId: " + this.SessionID);
                                }
                            }
                            break;

                        //extract session url
                        case "PartnerUrl":
                            if (xtr.Read())
                            {
                                this.SessionURL = xtr.Value.Trim();
                                if (SettingUtils.IsDebugging(mode))
                                {
                                    notifier.AddLogEntry("SessionURL: " + this.SessionURL);
                                }
                            }
                            break;

                        //extract object's name
                        case "sObject":
                            if (xtr["xsi:type"] != null)
                            {
                                string sObjectName = xtr["xsi:type"];
                                if (sObjectName != null)
                                {
                                    this.ObjectName = sObjectName.Split(new char[] { ':' })[1];
                                    if (SettingUtils.IsDebugging(mode))
                                    {
                                        notifier.AddLogEntry("ObjectName: " + this.ObjectName);
                                    }
                                }
                            }
                            break;

                        //extract notification id [note: salesforce can send a notification multiple times. it is, therefore, a good idea to keep track of this id.]
                        case "Id":
                            if (xtr.Read())
                            {
                                this.NotificationIDs.Add(xtr.Value.Trim());
                            }
                            break;

                        //extract record id
                        case "sf:Id":
                            if (xtr.Read())
                            {
                                this.ObjectIDs.Add(xtr.Value.Trim());
                                if (SettingUtils.IsDebugging(mode))
                                {
                                    notifier.AddLogEntry("ObjectId: " + xtr.Value.Trim());
                                }
                            }
                            break;
                        }
                    }
                }
            }
            else
            {
                if (SettingUtils.IsDebugging(mode))
                {
                    notifier.AddLogEntry("Notification has no data to parse.");
                }
            }
        }
        /// <summary>
        /// This is a utility method for translating chatter messages into a compatible format for ManyWho.
        /// </summary>
        public MessageAPI ChatterMessageToMessageAPI(String chatterBaseUrl, String parentId, ChatterMessage chatterMessage)
        {
            MessageAPI    message    = null;
            AttachmentAPI attachment = null;

            message = new MessageAPI();

            if (chatterMessage.Attachment != null)
            {
                attachment         = new AttachmentAPI();
                attachment.name    = chatterMessage.Attachment.Title;
                attachment.iconUrl = string.Format("{0}{1}",
                                                   SettingUtils.GetStringSetting("ManyWho.CDNBasePath"),
                                                   SalesforceServiceSingleton.CHATTER_DEFAULT_FILE_IMAGE_URL);
                attachment.description = chatterMessage.Attachment.Description;
                attachment.type        = chatterMessage.Attachment.FileType;
                attachment.size        = chatterMessage.Attachment.FileSize;
                attachment.downloadUrl = chatterMessage.Attachment.DownloadUrl;

                // We need to scrub the download url as this url is the REST API that does not work through the browser
                if (string.IsNullOrWhiteSpace(chatterMessage.Attachment.DownloadUrl) == false &&
                    chatterMessage.Attachment.DownloadUrl.IndexOf("servlet.shepherd", StringComparison.OrdinalIgnoreCase) < 0 &&
                    chatterMessage.Attachment.DownloadUrl.IndexOf("/services/data/v", StringComparison.OrdinalIgnoreCase) >= 0 &&
                    chatterMessage.Attachment.DownloadUrl.IndexOf("/chatter/files", StringComparison.OrdinalIgnoreCase) > 0)
                {
                    String[] urlParts = chatterMessage.Attachment.DownloadUrl.Split('/');

                    // Check to make absolutely sure we have enough parts before adapting the url
                    if (chatterMessage.Attachment.DownloadUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase) == true &&
                        urlParts.Length >= 8)
                    {
                        // E.g. https://c.cs80.visual.force.com/services/data/v27.0/chatter/files/069250000000ixwAAA/content?versionNumber=1
                        // Get the file identifier, and make sure it's pointing to the correct instance
                        attachment.downloadUrl = chatterBaseUrl + "/" + urlParts[8];
                    }
                    else if (chatterMessage.Attachment.DownloadUrl.StartsWith("/services/data", StringComparison.OrdinalIgnoreCase) == true &&
                             urlParts.Length >= 6)
                    {
                        // E.g. /services/data/v27.0/chatter/files/069250000000jBeAAI/content?versionNumber=1
                        // We don't have the full url, so we need to adapt a smaller part
                        attachment.downloadUrl = chatterBaseUrl + "/" + urlParts[6];
                    }
                }

                message.attachments = new List <AttachmentAPI>();
                message.attachments.Add(attachment);
            }

            message.id          = chatterMessage.Id;
            message.repliedToId = null;

            if (chatterMessage.Comments != null)
            {
                message.commentsCount = chatterMessage.Comments.Total;

                if (chatterMessage.Comments.Comments != null &&
                    chatterMessage.Comments.Comments.Count > 0)
                {
                    // Convert the child messages over for this message
                    message.comments = this.ChatterMessageToMessageAPI(chatterBaseUrl, message.id, chatterMessage.Comments.Comments);
                }
            }

            if (chatterMessage.MyLike != null)
            {
                message.myLikeId = chatterMessage.MyLike.Id;
            }

            message.createdDate = DateTime.Parse(chatterMessage.CreatedDate);
            message.comments    = null;

            if (chatterMessage.Likes != null &&
                chatterMessage.Likes.Likes != null &&
                chatterMessage.Likes.Likes.Count > 0)
            {
                message.likerIds = new List <String>();

                foreach (ChatterLikeItem chatterLikeItem in chatterMessage.Likes.Likes)
                {
                    if (chatterLikeItem.User != null)
                    {
                        message.likerIds.Add(chatterLikeItem.User.Id);
                    }
                }
            }

            // The actor will be non-null for root posts, but it's the user for comments
            if (chatterMessage.Actor != null)
            {
                message.sender = this.ChatterUserInfoToWhoAPI(chatterMessage.Actor);
            }
            else
            {
                message.sender = this.ChatterUserInfoToWhoAPI(chatterMessage.User);
            }

            message.text = this.GetMessageText(chatterMessage);

            return(message);
        }