public void TestPrm_FilterDescriptionContains()
        {
            System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll =
                new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
            coll.Add(new System.Management.Automation.PSObject("test result`r`n%% 1"));
            coll.Add(new System.Management.Automation.PSObject("test result`r`n%% 3"));

            CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
                @"$null = New-TMXTestSuite -Name 'suite%%`1  1'; " +
                @"$null = Add-TMXTestScenario -Name 'scenario`r`n%% 1'; " +
                @"$null = Add-TMXTestResultDetail -TestResultDetail 'detail 1'; " +
                @"$null = New-TMXTestSuite -Name 'suite%%`2  2'; " +
                @"$null = Add-TMXTestScenario -Name 'scenario`r`n%% 2'; " +
                @"$null = Close-TMXTestResult -Name 'test result`r`n%% 1' -Description 'abc' -TestPassed; " +
                @"$null = Add-TMXTestScenario -Name 'scenario`r`n%% 3'; " +
                @"$null = Close-TMXTestResult -Name 'test result`r`n%% 2' -Id 01 -TestPassed; " +
                @"$null = Add-TMXTestResultDetail -TestResultDetail 'detail 1'; " +
                @"$null = New-TMXTestSuite -Name 'suite%%`3  3'; " +
                @"$null = New-TMXTestSuite -Name 'suite%%`4  4'; " +
                @"$null = Add-TMXTestScenario -Name 'scenario`r`n%% 4'; " +
                @"$null = Add-TMXTestScenario -Name 'scenario`r`n%% 2'; " +
                @"$null = New-TMXTestSuite -Name 'suite%%`5  5'; " +
                @"$null = Close-TMXTestResult -Name 'test result`r`n%% 3' -Description 'cab' -TestPassed; " +
                @"$null = Close-TMXTestResult -Name 'a' -Id '003' -Description 'ccc' -TestPassed; " +
                @"Search-TMXTestResult -FilterDescriptionContains 'ab' | %{$_.Name;}",
                coll);
        }
Пример #2
0
        private void initRuby()
        {
            ScriptRuntimeSetup runtimeSetup = ScriptRuntimeSetup.ReadConfiguration();
            var languageSetup = IronRuby.RubyHostingExtensions.AddRubySetup(runtimeSetup);

            runtimeSetup.DebugMode = false;
            runtimeSetup.PrivateBinding = false;
            runtimeSetup.HostType = typeof(RhoHost);

            languageSetup.Options["NoAdaptiveCompilation"] = false;
            languageSetup.Options["CompilationThreshold"] = 0;
            languageSetup.Options["Verbosity"] = 2;

            m_runtime = IronRuby.Ruby.CreateRuntime(runtimeSetup);
            m_engine = IronRuby.Ruby.GetEngine(m_runtime);
            m_context = (RubyContext)Microsoft.Scripting.Hosting.Providers.HostingHelpers.GetLanguageContext(m_engine);

            m_context.ObjectClass.SetConstant("RHO_WP7", 1);
            m_context.ObjectClass.AddMethod(m_context, "__rhoGetCallbackObject", new RubyLibraryMethodInfo(
                new[] { LibraryOverload.Create(new Func<System.Object, System.Int32, System.Object>(RhoKernelOps.__rhoGetCallbackObject), false, 0, 0) },
                RubyMethodVisibility.Public,
                m_context.ObjectClass
            ));
            m_context.Loader.LoadAssembly("RhoRubyLib", "rho.rubyext.rubyextLibraryInitializer", true, true);

            System.Collections.ObjectModel.Collection<string> paths = new System.Collections.ObjectModel.Collection<string>();
            paths.Add("lib");
            paths.Add("apps/app");
            m_engine.SetSearchPaths(paths);
        }
Пример #3
0
        private void initRuby()
        {
            ScriptRuntimeSetup runtimeSetup = ScriptRuntimeSetup.ReadConfiguration();
            var languageSetup = IronRuby.RubyHostingExtensions.AddRubySetup(runtimeSetup);

            runtimeSetup.DebugMode = false;
            runtimeSetup.PrivateBinding = false;
            runtimeSetup.HostType = typeof(RhoHost);

            languageSetup.Options["NoAdaptiveCompilation"] = false;
            languageSetup.Options["CompilationThreshold"] = 0;
            languageSetup.Options["Verbosity"] = 2;

            m_runtime = IronRuby.Ruby.CreateRuntime(runtimeSetup);
            m_engine = IronRuby.Ruby.GetEngine(m_runtime);
            m_context = (RubyContext)Microsoft.Scripting.Hosting.Providers.HostingHelpers.GetLanguageContext(m_engine);

            m_context.ObjectClass.SetConstant("RHO_WP7", 1);
            m_context.Loader.LoadAssembly("RhoRubyLib", "rho.rubyext.rubyextLibraryInitializer", true, true);

            System.Collections.ObjectModel.Collection<string> paths = new System.Collections.ObjectModel.Collection<string>();
            paths.Add("lib");
            paths.Add("apps/app");
            m_engine.SetSearchPaths(paths);
        }
 public void TestPrm_Name_Complex_In_Series()
 {
     System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll = 
         new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
     coll.Add(null);
     coll.Add(new System.Management.Automation.PSObject("autoclosed"));
     coll.Add(new System.Management.Automation.PSObject("test result`r`n%% 1"));
     coll.Add(new System.Management.Automation.PSObject("test result`r`n%% 2"));
     coll.Add(new System.Management.Automation.PSObject("test result`r`n%% 3"));
     coll.Add(new System.Management.Automation.PSObject("autoclosed"));
     
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"$null = New-TmxTestSuite -Name 'suite%%`1  1'; " + 
         @"$null = Add-TmxTestScenario -Name 'scenario`r`n%% 1'; " + 
         @"$null = Add-TmxTestResultDetail -TestResultDetail 'detail 1'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`2  2'; " + 
         @"$null = Add-TmxTestScenario -Name 'scenario`r`n%% 2'; " + 
         @"$null = Close-TmxTestResult -Name 'test result`r`n%% 1' -TestPassed; " + 
         @"$null = Add-TmxTestScenario -Name 'scenario`r`n%% 3'; " + 
         @"$null = Close-TmxTestResult -Name 'test result`r`n%% 2' -TestPassed; " + 
         @"$null = Add-TmxTestResultDetail -TestResultDetail 'detail 1'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`3  3'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`4  4'; " + 
         @"$null = Add-TmxTestScenario -Name 'scenario`r`n%% 4'; " + 
         @"$null = Add-TmxTestScenario -Name 'scenario`r`n%% 2'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`5  5'; " + 
         @"$null = Close-TmxTestResult -Name 'test result`r`n%% 3' -TestPassed; " + 
         @"Search-TmxTestResult -OrderById | %{$_.Name;}",
         coll);
 }
Пример #5
0
		public void TestMercator_1SP_Projection()
		{
			CoordinateSystemFactory cFac = new SharpMap.CoordinateSystems.CoordinateSystemFactory();

			IEllipsoid ellipsoid = cFac.CreateFlattenedSphere("Bessel 1840", 6377397.155, 299.15281, LinearUnit.Metre);

			IHorizontalDatum datum = cFac.CreateHorizontalDatum("Bessel 1840", DatumType.HD_Geocentric, ellipsoid, null);
			IGeographicCoordinateSystem gcs = cFac.CreateGeographicCoordinateSystem("Bessel 1840", AngularUnit.Degrees, datum,
				PrimeMeridian.Greenwich, new AxisInfo("Lon", AxisOrientationEnum.East),
				new AxisInfo("Lat", AxisOrientationEnum.North));
            //System.Collections.ObjectModel.Collection<ProjectionParameter> parameters = new System.Collections.ObjectModel.Collection<ProjectionParameter>(5);
            System.Collections.ObjectModel.Collection<ProjectionParameter> parameters = new System.Collections.ObjectModel.Collection<ProjectionParameter>();
			parameters.Add(new ProjectionParameter("latitude_of_origin", 0));
			parameters.Add(new ProjectionParameter("central_meridian", 110));
			parameters.Add(new ProjectionParameter("scale_factor", 0.997));
			parameters.Add(new ProjectionParameter("false_easting", 3900000));
			parameters.Add(new ProjectionParameter("false_northing", 900000));
			IProjection projection = cFac.CreateProjection("Mercator_1SP", "Mercator_1SP", parameters);

			IProjectedCoordinateSystem coordsys = cFac.CreateProjectedCoordinateSystem("Makassar / NEIEZ", gcs, projection, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));

			ICoordinateTransformation trans = new CoordinateTransformationFactory().CreateFromCoordinateSystems(gcs, coordsys);

			SharpMap.Geometries.Point pGeo = new SharpMap.Geometries.Point(120, -3);
			SharpMap.Geometries.Point pUtm = trans.MathTransform.Transform(pGeo);
			SharpMap.Geometries.Point pGeo2 = trans.MathTransform.Inverse().Transform(pUtm);

			SharpMap.Geometries.Point expected = new Point(5009726.58, 569150.82);
			Assert.IsTrue(ToleranceLessThan(pUtm, expected, 0.02), String.Format("Mercator_1SP forward transformation outside tolerance, Expected {0}, got {1}", expected.ToString(), pUtm.ToString()));
			Assert.IsTrue(ToleranceLessThan(pGeo, pGeo2, 0.0000001), String.Format("Mercator_1SP reverse transformation outside tolerance, Expected {0}, got {1}", pGeo.ToString(), pGeo2.ToString()));
		}
        private void Ancestors_1(string driverName)
        {
            System.Collections.ObjectModel.Collection<PSObject> coll = 
                new System.Collections.ObjectModel.Collection<PSObject>();
            
            //coll.Add((new PSObject("  Value1\r\n  Value 2\r\n  Value \\3\r\n  Value /4\r\n ")));
            coll.Add((new PSObject("div3\r\nMy first paragraph.\r\nMy second paragraph.")));
            coll.Add((new PSObject("div2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph.")));
            coll.Add((new PSObject("div1\r\ndiv2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph.")));
            coll.Add((new PSObject("My First Heading\r\ndiv1\r\ndiv2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph.")));
            coll.Add((new PSObject("My First Heading\r\ndiv1\r\ndiv2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph.")));
//            coll.Add((new PSObject("Test results 26.07.2012 16:16
//  Value1
//  Value 2
//  Value \3
//  Value /4
// 
//  Value1
//  Value 2
//  Value \3
//  Value /4
// 
//  Value1
//  Value 2
//  Value \3
//  Value /4
// 
//Value1 Value 2 Value \3 Value /4
//  Value1
//  Value 2
//  Value \3
//  Value /4
// 
//Value1 Value 2 Value \3 Value /4
//Suites:1 Passed:0 Failed:1 Not tested:0
//Scenarios:2 Passed:0 Failed:2 Not tested:0
//Test cases:21 Passed:11 Failed:7 Not tested:3 Time spent:6 seconds
//4 cases of non-critical issues are counted as Passed
//111 suite1 FAILED
//Scenarios:2 Passed:0 Failed:2 Not tested:0
//Test cases:21 Passed:11 Failed:7 Not tested:3 Time spent:6 seconds
//description description description description description description description description description description>
//)));
            //coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value03Name)));
            //coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value04Name)));
            CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
                @"Start-SeWebDriver -DriverName '" + 
                driverName + 
                @"' | Enter-SeURL -URL '" +
                MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile06Controls1)) +
                @"' | Get-SeWebElement -XPath '" +
                Settings.TestFile06Controls1Element01XPath +
                //@"' | Get-SeWebElementAncestors | %{ $_ | Read-SeWebElementText; }",
                @"' | Get-SeWebElementAncestors | Read-SeWebElementText;",
                coll);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Collections.ObjectModel.Collection<System.Collections.ObjectModel.Collection<KeyValuePair<string, string>>> parameters = new System.Collections.ObjectModel.Collection<System.Collections.ObjectModel.Collection<KeyValuePair<string, string>>>();

            System.Collections.ObjectModel.Collection<KeyValuePair<string, string>> list = new System.Collections.ObjectModel.Collection<KeyValuePair<string, string>>();
            list.Add(new KeyValuePair<string, string>("@non_gl_stock_master_id", this.Request["TranId"]));

            parameters.Add(list);
            parameters.Add(list);

            SalesQuotationReport.ParameterCollection = parameters;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Collections.ObjectModel.Collection<System.Collections.ObjectModel.Collection<KeyValuePair<string, string>>> parameters = new System.Collections.ObjectModel.Collection<System.Collections.ObjectModel.Collection<KeyValuePair<string, string>>>();

            System.Collections.ObjectModel.Collection<KeyValuePair<string, string>> list = new System.Collections.ObjectModel.Collection<KeyValuePair<string, string>>();
            list.Add(new KeyValuePair<string, string>("@transaction_master_id", this.Request["TranId"]));

            parameters.Add(list);
            parameters.Add(list);

            DirectPurchaseInvoiceReport.ParameterCollection = parameters;
        }
 public void TestPrm_FilterDescriptionContains_Descending()
 {
     System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll =
         new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
     coll.Add(new System.Management.Automation.PSObject("suite4"));
     coll.Add(new System.Management.Automation.PSObject("suite1"));
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"$null = New-TMXTestSuite -Name suite1 -Description 'abc'; " +
         @"$null = New-TMXTestSuite -Name suite2 -Description 'bac'; " +
         @"$null = New-TMXTestSuite -Name suite3; " +
         @"$null = New-TMXTestSuite -Name suite4 -Description 'cab'; " +
         @"$null = New-TMXTestSuite -Name suite5 -Description 'bac'; " +
         @"Search-TMXTestSuite -FilterDescriptionContains 'ab' -Descending | %{$_.Name;}",
         coll);
 }
Пример #10
0
        /// <summary>
        /// Initialises the view.
        /// </summary>
        /// <param name="grid">The layoutRoot grid.</param>
        /// <param name="columnManager">Look ahead view column manager.</param>
        public void InitializeView(Grid grid, ColumnManager columnManager)
        {
            System.Collections.ObjectModel.Collection<ColumnManager> columns = new System.Collections.ObjectModel.Collection<ColumnManager>();
            columns.Add(columnManager);

            this.view = new ColumnView(grid, columns, true);
        }
Пример #11
0
        public System.Collections.ObjectModel.Collection<UIElement> getAssociations()
        {
            System.Collections.ObjectModel.Collection<UIElement> asses = new System.Collections.ObjectModel.Collection<UIElement>();

            if ((this.Child as StackPanel).Children.Count > 1)
            {
                Canvas assocCanvas = null;
                foreach (UIElement u in (this.Child as StackPanel).Children)
                    if (u is Canvas)
                    {
                        assocCanvas = u as Canvas;
                        break;
                    }

                if (assocCanvas != null)
                {
                    foreach (UIElement u in assocCanvas.Children)
                    {
                        if ((u as VisualElement).Content is UMLAssociation)
                        {
                            asses.Add(u);
                            //((u as VisualElement).Content as UMLAssociation).drawArrow(new Point(0, 0), new Point(300, 300));
                            //Canvas.SetTop((u as VisualElement), 30);
                            //Canvas.SetLeft((u as VisualElement), 5);
                            //Canvas.SetZIndex(u, 6);
                        }
                    }

                }
            }
            return asses;
        }
 public void TestPrm_Name_Simple_In_Series()
 {
     System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll = 
         new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
     coll.Add(new System.Management.Automation.PSObject("scenario1"));
     coll.Add(new System.Management.Automation.PSObject("scenario2"));
     coll.Add(new System.Management.Automation.PSObject("scenario4"));
     coll.Add(new System.Management.Automation.PSObject("scenario2"));
     coll.Add(new System.Management.Automation.PSObject("scenario3"));
     coll.Add(new System.Management.Automation.PSObject("scenario2"));
     coll.Add(new System.Management.Automation.PSObject("scenario5"));
     
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"$null = New-TmxTestSuite -Name suite1; " + 
         @"$null = Add-TmxTestScenario -Name scenario1; " + 
         @"$null = New-TmxTestSuite -Name suite2; " + 
         @"$null = New-TmxTestSuite -Name suite3; " + 
         @"$null = Add-TmxTestScenario -Name scenario2; " + 
         @"$null = Add-TmxTestScenario -Name scenario3; " + 
         @"$null = New-TmxTestSuite -Name suite4; " + 
         @"$null = Add-TmxTestScenario -Name scenario4; " + 
         @"$null = Add-TmxTestScenario -Name scenario2; " + 
         @"$null = Add-TmxTestScenario -Name scenario5; " + 
         @"$null = New-TmxTestSuite -Name suite5; " + 
         @"$null = Add-TmxTestScenario -Name scenario2; " + 
         @"Search-TmxTestScenario -OrderById | %{$_.Name;}",
         coll);
 }
 public void TestPrm_Id_Numeric()
 {
     System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll = 
         new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
     coll.Add(new System.Management.Automation.PSObject("1"));
     coll.Add(new System.Management.Automation.PSObject("2"));
     coll.Add(new System.Management.Automation.PSObject("3"));
     coll.Add(new System.Management.Automation.PSObject("4"));
     coll.Add(new System.Management.Automation.PSObject("5"));
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"$null = New-TmxTestSuite -Name abc1 -Id 1; " + 
         @"$null = New-TmxTestSuite -Name abc2 -Id 2; " + 
         @"$null = New-TmxTestSuite -Name abc3 -Id 3; " + 
         @"$null = New-TmxTestSuite -Name abc4 -Id 4; " + 
         @"$null = New-TmxTestSuite -Name abc5 -Id 5; " + 
         @"Search-TmxTestSuite -OrderById | %{$_.Id;}",
         coll);
 }
 public void TestPrm_Name_Complex_In_Series()
 {
     System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll = 
         new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
     coll.Add(new System.Management.Automation.PSObject("suite%%`1  1"));
     coll.Add(new System.Management.Automation.PSObject("suite%%`2  2"));
     coll.Add(new System.Management.Automation.PSObject("suite%%`3  3"));
     coll.Add(new System.Management.Automation.PSObject("suite%%`4  4"));
     coll.Add(new System.Management.Automation.PSObject("suite%%`5  5"));
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"$null = New-TmxTestSuite -Name 'suite%%`1  1'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`2  2'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`3  3'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`4  4'; " + 
         @"$null = New-TmxTestSuite -Name 'suite%%`5  5'; " + 
         @"Search-TmxTestSuite -OrderById | %{$_.Name;}",
         coll);
 }
 private void TestPrm_Id_WebDriverInput(string driverName)
 {
     System.Collections.ObjectModel.Collection<PSObject> coll = 
         new System.Collections.ObjectModel.Collection<PSObject>();
     coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink03Answer)));
     coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink04Answer)));
     
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"Start-SeWebDriver -DriverName '" + 
         driverName + 
         @"' | Enter-SeURL -URL '" +
         MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) +
         @"' | Get-SeWebElement -Id '" +
         Settings.TestFile05Controls1ElementLinkIds +
         //@"' | %{ $_ | Read-SeWebElementText; }",
         @"' | Read-SeWebElementText;",
         coll);
 }
Пример #16
0
 private void AddViews()
 {
     //TODO: create the Module views, add them to the WorkItem and show them in
     //		a Workspace. See: ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.practices.scsf.2007may/SCSF/html/03-01-040-How_to_Add_a_View_with_a_Presenter.htm
     System.Collections.ObjectModel.Collection<string> cl = new System.Collections.ObjectModel.Collection<string>();
     cl.Add(ACOT.Infrastructure.Interface.Constants.ModuleNames.ChkAddrModule);
     cl.Add
     if (OnModuleLoad != null)
         OnModuleLoad(this, new EventArgs<System.Collections.ObjectModel.Collection<string>>(cl));
 }
Пример #17
0
        private CascadingDropDownNameValue[] GetValues(System.Data.DataTable table)
        {
            System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();

            foreach(System.Data.DataRow dr in table.Rows)
            {
                values.Add(new CascadingDropDownNameValue(dr["party"].ToString(), dr["party_code"].ToString()));
            }

            return values.ToArray();
        }
Пример #18
0
        public System.Collections.ObjectModel.Collection<System.Web.UI.WebControls.ListItem> GetCurrencies()
        {
            System.Collections.ObjectModel.Collection<System.Web.UI.WebControls.ListItem> values = new System.Collections.ObjectModel.Collection<System.Web.UI.WebControls.ListItem>();

            foreach (Currency currency in Data.Helpers.Currencies.GetCurrencies(AppUsers.GetCurrentUserDB()))
            {
                values.Add(new System.Web.UI.WebControls.ListItem(currency.CurrencyCode, currency.CurrencyCode));
            }

            return values;
        }
        public void FF_TestPrm_DriverNameAsArray_Firefox()
        {
            System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll =
                new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
            //            System.Collections.ObjectModel.Collection<string> coll =
            //                new System.Collections.ObjectModel.Collection<string>();

            coll.Add((new PSObject(Settings.AnswerTrue)));
            coll.Add((new PSObject(Settings.AnswerTrue)));
            CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
                @"$driver1 = Start-SeWebDriver -DriverName '" +
                Settings.DriverNameFirefox +
                "'; " +
                @"$driver2 = Start-SeWebDriver -DriverName '" +
                Settings.DriverNameFirefox +
                "'; " +
                @"$null = $driver1; $null = $driver2; " +
                @"Stop-SeWebDriver -InstanceName $([SePSX.CurrentData]::Drivers.Keys);",
                coll);
        }
Пример #20
0
        /// <summary>
        /// Login method for customer
        /// </summary>
        /// <param name="email">email</param>
        /// <returns> return login response</returns>
        public DataSet UserLoginwithEmail(string email)
        {
            /*Add Parameters*/
            System.Collections.ObjectModel.Collection <DBParameters> parameters = new System.Collections.ObjectModel.Collection <DBParameters>();
            parameters.Add(new DBParameters()
            {
                Name = "UserEmail", Value = email, DBType = DbType.String
            });

            /*Convert Dataset to Model List object*/
            return((DataSet)this.ExecuteProcedure("CUSPUserLoginWithEmail", ExecuteType.ExecuteDataSet, parameters));
        }
Пример #21
0
        private void selectedViewsRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (selectedViewsRadioButton.Checked)
            {
                m_printMgr.PrintRange = Autodesk.Revit.DB.PrintRange.Select;

                System.Collections.ObjectModel.Collection <System.Windows.Forms.Control> controlsToEnableOrNot =
                    new System.Collections.ObjectModel.Collection <System.Windows.Forms.Control>();
                controlsToEnableOrNot.Add(selectedViewSheetSetLabel);
                controlsToEnableOrNot.Add(selectedViewSheetSetButton);
                m_printMgr.VerifySelectViewSheetSet(controlsToEnableOrNot);

                m_printMgr.VerifyPrintToSingleFile(singleFileRadioButton);
                if (m_printMgr.VerifyPrintToSeparateFile(separateFileRadioButton))
                {
                    separateFileRadioButton.Checked = true;
                }
                m_printMgr.VerifyPrintToSeparateFile(separateFileRadioButton);
                m_printMgr.VerifyCollate(collateCheckBox);
            }
        }
 private void Select_AllOptions(string driverName)
 {
     System.Collections.ObjectModel.Collection<PSObject> coll = 
         new System.Collections.ObjectModel.Collection<PSObject>();
     
     coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value01Name)));
     coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value02Name)));
     coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value03Name)));
     coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value04Name)));
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"Start-SeWebDriver -DriverName '" + 
         driverName + 
         @"' | Enter-SeURL -URL '" +
         MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) +
         @"' | Get-SeWebElement -XPath '" +
         //Settings.TestFile05Controls1ElementSelect01XPath +
         Settings.TestFile05Controls1ElementSelect04XPath +
         //@"' | Get-SeSelection -All | %{ $_ | Read-SeWebElementText; };",
         @"' | Get-SeSelection -All | Read-SeWebElementText;",
         coll);
 }
Пример #23
0
 /// <summary>
 /// Mark Message As Read.
 /// </summary>
 /// <param name="isSendByAdmin">isSendByAdmin.</param>
 /// <param name="customerId">customerId.</param>
 /// <returns>return Status</returns>
 public bool MarkMessageAsRead(bool isSendByAdmin, int customerId = 0)
 {
     try
     {
         System.Collections.ObjectModel.Collection <DBParameters> parameters = new System.Collections.ObjectModel.Collection <DBParameters>();
         parameters.Add(new DBParameters()
         {
             Name = "CustomerId", Value = customerId, DBType = DbType.Int32
         });
         parameters.Add(new DBParameters()
         {
             Name = "IsSendByAdmin", Value = isSendByAdmin, DBType = DbType.Boolean
         });
         this.ExecuteProcedure("CUSPMarkMessageAsRead", ExecuteType.ExecuteNonQuery, parameters);
         return(true);
     }
     catch (System.Data.SqlClient.SqlException)
     {
         return(false);
     }
 }
Пример #24
0
 /// <summary>
 /// Accept Cancel Book Borrow Request
 /// </summary>
 /// <param name="bookId">bookId</param>
 /// <param name="userId">userId</param>
 /// <param name="statusId">statusId</param>
 /// <param name="borrowId">borrowId</param>
 /// <param name="bookperiod">bookperiod</param>
 /// <returns>return status</returns>
 public DataSet AcceptCancelBookBorrowRequest(int bookId, int userId, int statusId, int borrowId, int bookperiod)
 {
     /*Add Parameters*/
     System.Collections.ObjectModel.Collection <DBParameters> parameters = new System.Collections.ObjectModel.Collection <DBParameters>();
     parameters.Add(new DBParameters()
     {
         Name = "BookId", Value = bookId, DBType = DbType.Int32
     });
     parameters.Add(new DBParameters()
     {
         Name = "UserId", Value = userId, DBType = DbType.Int32
     });
     parameters.Add(new DBParameters()
     {
         Name = "StatusId", Value = statusId, DBType = DbType.Int32
     });
     parameters.Add(new DBParameters()
     {
         Name = "BorrowId", Value = borrowId, DBType = DbType.Int32
     });
     parameters.Add(new DBParameters()
     {
         Name = "ActivityDate", Value = DateTime.Now, DBType = DbType.DateTime
     });
     parameters.Add(new DBParameters()
     {
         Name = "BookPeriodValue", Value = bookperiod, DBType = DbType.Int32
     });
     /*Convert Dataset to Model List object*/
     return((DataSet)this.ExecuteProcedure("CUSPAcceptCancelBookBorrowRequest", ExecuteType.ExecuteDataSet, parameters));
 }
Пример #25
0
		public void TestAlbersProjection()
		{
			CoordinateSystemFactory cFac = new SharpMap.CoordinateSystems.CoordinateSystemFactory();

			IEllipsoid ellipsoid = cFac.CreateFlattenedSphere("Clarke 1866", 6378206.4, 294.9786982138982, LinearUnit.USSurveyFoot);

			IHorizontalDatum datum = cFac.CreateHorizontalDatum("Clarke 1866", DatumType.HD_Geocentric, ellipsoid, null);
			IGeographicCoordinateSystem gcs = cFac.CreateGeographicCoordinateSystem("Clarke 1866", AngularUnit.Degrees, datum,
				PrimeMeridian.Greenwich, new AxisInfo("Lon", AxisOrientationEnum.East),
				new AxisInfo("Lat", AxisOrientationEnum.North));
            //System.Collections.ObjectModel.Collection<ProjectionParameter> parameters = new System.Collections.ObjectModel.Collection<ProjectionParameter>(5);
            System.Collections.ObjectModel.Collection<ProjectionParameter> parameters = new System.Collections.ObjectModel.Collection<ProjectionParameter>();
			parameters.Add(new ProjectionParameter("central_meridian", -96));
			parameters.Add(new ProjectionParameter("latitude_of_origin", 23));
			parameters.Add(new ProjectionParameter("standard_parallel_1", 29.5));
			parameters.Add(new ProjectionParameter("standard_parallel_2", 45.5));
			parameters.Add(new ProjectionParameter("false_easting", 0));
			parameters.Add(new ProjectionParameter("false_northing", 0));
			IProjection projection = cFac.CreateProjection("Albers Conical Equal Area", "albers", parameters);

			IProjectedCoordinateSystem coordsys = cFac.CreateProjectedCoordinateSystem("Albers Conical Equal Area", gcs, projection, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));

			ICoordinateTransformation trans = new CoordinateTransformationFactory().CreateFromCoordinateSystems(gcs, coordsys);

			SharpMap.Geometries.Point pGeo = new SharpMap.Geometries.Point(-75, 35);
			SharpMap.Geometries.Point pUtm = trans.MathTransform.Transform(pGeo);
			SharpMap.Geometries.Point pGeo2 = trans.MathTransform.Inverse().Transform(pUtm);

			SharpMap.Geometries.Point expected = new Point(1885472.7, 1535925);
			Assert.IsTrue(ToleranceLessThan(pUtm, expected, 0.05), String.Format("Albers forward transformation outside tolerance, Expected {0}, got {1}", expected.ToString(), pUtm.ToString()));
			Assert.IsTrue(ToleranceLessThan(pGeo, pGeo2, 0.0000001), String.Format("Albers reverse transformation outside tolerance, Expected {0}, got {1}", pGeo.ToString(), pGeo2.ToString()));
		}
Пример #26
0
        public System.Collections.ObjectModel.Collection <System.Web.UI.WebControls.ListItem> GetCurrencies()
        {
            System.Collections.ObjectModel.Collection <System.Web.UI.WebControls.ListItem> values = new System.Collections.ObjectModel.Collection <System.Web.UI.WebControls.ListItem>();

            using (System.Data.DataTable table = Data.Helpers.Currencies.GetCurrencyDataTable())
            {
                foreach (System.Data.DataRow dr in table.Rows)
                {
                    values.Add(new System.Web.UI.WebControls.ListItem(dr["currency_code"].ToString(), dr["currency_code"].ToString()));
                }
            }
            return(values);
        }
Пример #27
0
        /// <summary>
        /// Masters the drop-down bind.
        /// </summary>
        /// <param name="masterDropDownType">Type of the master drop down.</param>
        /// <param name="isActive">The is active.</param>
        /// <param name="filterId">The filter identifier.</param>
        /// <param name="isAddBlank">need this pram for select2 plug-in</param>
        /// <param name="filterText">the filter text</param>
        /// <param name="filterBool">the filter boolean</param>
        /// <returns>List of items</returns>
        public IList <MasterDropdown> MasterDropdownBind(int masterDropDownType, bool?isActive = null, int?filterId = null, bool isAddBlank = false, string filterText = "", bool?filterBool = null)
        {
            System.Collections.ObjectModel.Collection <DBParameters> parameters = new System.Collections.ObjectModel.Collection <DBParameters>();
            parameters.Add(new DBParameters()
            {
                Name = "MasterDropDownType", Value = masterDropDownType, DBType = DbType.Int32
            });
            parameters.Add(new DBParameters()
            {
                Name = "Active", Value = isActive, DBType = DbType.Boolean
            });
            parameters.Add(new DBParameters()
            {
                Name = "FilterID", Value = filterId, DBType = DbType.Int32
            });
            parameters.Add(new DBParameters()
            {
                Name = "FilterText", Value = filterText, DBType = DbType.String
            });
            if (filterBool.HasValue)
            {
                parameters.Add(new DBParameters()
                {
                    Name = "FilterBool", Value = filterBool, DBType = DbType.Boolean
                });
            }

            var result = this.ExecuteProcedure <MasterDropdown>("CUSPMasterDropdownBind", parameters);

            if (isAddBlank)
            {
                result.Insert(0, new MasterDropdown()
                {
                    ID = string.Empty, Name = string.Empty
                });
            }

            return(result);
        }
Пример #28
0
        internal override void PopulateWithIShellItems(System.Collections.ObjectModel.Collection <IShellItem> items)
        {
            IShellItem item;

            saveDialogCoClass.GetResult(out item);

            if (item == null)
            {
                throw new InvalidOperationException(LocalizedMessages.SaveFileNullItem);
            }
            items.Clear();
            items.Add(item);
        }
        private void visiblePortionRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (visiblePortionRadioButton.Checked)
            {
                _printMgr.PrintRange = Autodesk.Revit.DB.PrintRange.Visible;

                System.Collections.ObjectModel.Collection <System.Windows.Forms.Control> controlsToEnableOrNot =
                    new System.Collections.ObjectModel.Collection <System.Windows.Forms.Control>();
                controlsToEnableOrNot.Add(selectedViewSheetSetLabel);
                controlsToEnableOrNot.Add(selectedViewSheetSetButton);
                _printMgr.VerifySelectViewSheetSet(controlsToEnableOrNot);

                if (_printMgr.VerifyPrintToSingleFile(singleFileRadioButton))
                {
                    _printMgr.IsCombinedFile        = true;
                    singleFileRadioButton.Checked   = true;
                    separateFileRadioButton.Checked = false;
                }
                _printMgr.VerifyPrintToSeparateFile(separateFileRadioButton);
                _printMgr.VerifyCollate(collateCheckBox);
            }
        }
Пример #30
0
        private void Select_SelectAllOptions(string driverName)
        {
            System.Collections.ObjectModel.Collection <PSObject> coll =
                new System.Collections.ObjectModel.Collection <PSObject>();

            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value01Name)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value02Name)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value03Name)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value04Name)));
            CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
                @"$null = Start-SeWebDriver -DriverName '" +
                driverName +
                @"' | Enter-SeURL -URL '" +
                MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) +
                @"' | Get-SeWebElement -XPath '" +
                Settings.TestFile05Controls1ElementSelect04XPath +
                @"' | Set-SeSelection -All; " +
                @"Get-SeWebElement -XPath '" +
                Settings.TestFile05Controls1ElementSelect04XPath +
                //@"' | Get-SeSelection -Selected | %{ $_ | Read-SeWebElementText; };",
                @"' | Get-SeSelection -Selected | Read-SeWebElementText;",
                coll);
        }
Пример #31
0
        internal override void PopulateWithFileNames(
            System.Collections.ObjectModel.Collection <string> names)
        {
            IShellItem item;

            saveDialogCoClass.GetResult(out item);

            if (item == null)
            {
                throw new InvalidOperationException(LocalizedMessages.SaveFileNullItem);
            }
            names.Clear();
            names.Add(GetFileNameFromShellItem(item));
        }
Пример #32
0
        public CascadingDropDownNameValue[] GetStockItems(string knownCategoryValues, string category)
        {
            System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();

            using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable("core", "items", "maintain_stock", "true"))
            {
                foreach(System.Data.DataRow dr in table.Rows)
                {
                    values.Add(new CascadingDropDownNameValue(dr["item_name"].ToString(), dr["item_code"].ToString()));
                }

                return values.ToArray();
            }
        }
Пример #33
0
        internal override void PopulateWithFileNames(
            System.Collections.ObjectModel.Collection <string> names)
        {
            IShellItem item;

            saveDialogCoClass.GetResult(out item);

            if (item == null)
            {
                throw new InvalidOperationException(
                          "Retrieved a null shell item from dialog");
            }
            names.Add(GetFileNameFromShellItem(item));
        }
        private void TestPrm_PartialLinkText_WebElementInput(string driverName)
        {
            System.Collections.ObjectModel.Collection <PSObject> coll =
                new System.Collections.ObjectModel.Collection <PSObject>();
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink01Answer)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink02Answer)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink03Answer)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink04Answer)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink05Answer)));

            CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
                @"Start-SeWebDriver -DriverName '" +
                driverName +
                @"' | Enter-SeURL -URL '" +
                MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) +
                @"' | Get-SeWebElement -Id '" +
                Settings.TestFile05Controls1ElementLinksDiv +
                @"' -First | Get-SeWebElement -PartialLinkText '" +
                Settings.TestFile05Controls1ElementLinksPartialLinkText +
                //@"' | %{ $_ | Read-SeWebElementText; }",
                @"' | Read-SeWebElementText;",
                coll);
        }
Пример #35
0
        public CascadingDropDownNameValue[] GetStockItems(string knownCategoryValues, string category)
        {
            System.Collections.ObjectModel.Collection <CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection <CascadingDropDownNameValue>();

            using (System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable("core", "items", "maintain_stock", "true"))
            {
                foreach (System.Data.DataRow dr in table.Rows)
                {
                    values.Add(new CascadingDropDownNameValue(dr["item_name"].ToString(), dr["item_code"].ToString()));
                }

                return(values.ToArray());
            }
        }
Пример #36
0
        /// <summary>
        /// Check Duplicate Records in Database
        /// </summary>
        /// <typeparam name="TEntity">Model Type</typeparam>
        /// <param name="entity">Entity Model</param>
        /// <returns>returns entity is duplicate or not</returns>
        private bool HasDuplicate <TEntity>(TEntity entity, string productUid = null)
        {
            System.Collections.ObjectModel.Collection <DBParameters> parameters = new System.Collections.ObjectModel.Collection <DBParameters>();
            parameters.Add(new DBParameters()
            {
                Name = "tableName", Value = GetTableName(entity), DBType = DbType.String
            });
            parameters.Add(new DBParameters()
            {
                Name = "columnName", Value = this.Col1Name, DBType = DbType.String
            });
            parameters.Add(new DBParameters()
            {
                Name = "columnNameValue", Value = GetPropertyValue(entity, this.Col1Name).Replace("'", "''"), DBType = DbType.String
            });
            if (!string.IsNullOrEmpty(this.Col2Name))
            {
                parameters.Add(new DBParameters()
                {
                    Name = "columnName2", Value = this.Col2Name, DBType = DbType.String
                });

                parameters.Add(new DBParameters()
                {
                    Name = "columnName2Value", Value = GetPropertyValue(entity, this.Col2Name).Replace("'", "''"), DBType = DbType.String
                });

                parameters.Add(new DBParameters()
                {
                    Name = "IsCombinationCheck", Value = this.CombinationCheckRequired, DBType = DbType.Boolean
                });
            }

            parameters.Add(new DBParameters()
            {
                Name = "primaryKey", Value = GetKeyName(entity), DBType = DbType.String
            });

            parameters.Add(new DBParameters()
            {
                Name = "primaryKeyValue", Value = GetKeyValue(entity).ToString(), DBType = DbType.String
            });
            AppConfiguration appSettings = new AppConfiguration();
            DataSet          ds          = (DataSet)DBClient.ExecuteProcedure("UspGeneralCheckDuplicate", ExecuteType.ExecuteDataSet, parameters, appSettings.GetConnectionString);

            return(ds.Tables[0].Rows.Count > 0);
        }
        private void RefreshMapElements()
        {
            // Clears map elements.
            System.Collections.ObjectModel.Collection <MapElement> elements = MapControl.MapElements;
            elements.Clear();

            // Refresh player accuracy polygon.
            GeoCoordinateCollection playerAccuracyArea = ViewModel.PlayerAccuracyArea;

            if (playerAccuracyArea != null)
            {
                elements.Add(new MapPolygon()
                {
                    Path            = playerAccuracyArea,
                    StrokeThickness = 2,
                    FillColor       = _playerAccuracyFillColor,
                    StrokeColor     = _playerAccuracyStrokeColor
                });
            }

            // Refreshes zones.
            IEnumerable <GameMapViewModel.ZoneData> zones = ViewModel.Zones;

            if (zones != null)
            {
                foreach (GameMapViewModel.ZoneData zone in zones)
                {
                    elements.Add(new MapPolygon()
                    {
                        Path            = zone.Points,
                        FillColor       = _polygonFillColor,
                        StrokeColor     = _polygonStrokeColor,
                        StrokeThickness = 2
                    });
                }
            }
        }
Пример #38
0
        internal override void PopulateWithIShellItems(
            System.Collections.ObjectModel.Collection <IShellItem> items)
        {
            IShellItem item;

            saveDialogCoClass.GetResult(out item);

            if (item == null)
            {
                throw new InvalidOperationException(
                          "Retrieved a null shell item from dialog");
            }
            items.Clear();
            items.Add(item);
        }
Пример #39
0
 private static IEnumerable<CookieHeaderValue> GetCookies(HttpRequestHeaders header)
 {
     var result = new System.Collections.ObjectModel.Collection<CookieHeaderValue>();
     IEnumerable<string> cookies;
     if (header.TryGetValues("Cookie", out cookies))
     {
         foreach (string cookie in cookies)
         {
             CookieHeaderValue cookieHeaderValue;
             if (CookieHeaderValue.TryParse(cookie, out cookieHeaderValue))
                 result.Add(cookieHeaderValue);
         }
     }
     return result;
 }
Пример #40
0
        public void InvoiceSimpleGroceriesCustomerTwoPlusYearsOldTest()
        {
            var item = new Item()
            {
                Amount   = 150,
                Id       = 1,
                ItemType = ItemType.Default,
                Name     = "Choclate"
            };

            var item1 = new Item()
            {
                Amount   = 100,
                Id       = 1,
                ItemType = ItemType.Groceries,
                Name     = "Atta"
            };

            var items = new System.Collections.ObjectModel.Collection <Item>();

            items.Add(item);
            items.Add(item1);
            var invoice = new Invoice()
            {
                Items    = items,
                Customer = new Customer()
                {
                    IsLoyal = true
                }
            };

            var engine = new RuleEngine();
            var result = engine.CalculateBill(invoice);

            Assert.AreEqual(result.TotalAmount, Convert.ToDecimal(232.5));
        }
        public PlcComEventArgs(string[] values, string plcAddress, ushort sequenceNumber, long ownerObjectID)
        {
            m_Values = new System.Collections.ObjectModel.Collection <string>();
            string[] d = new string[values.Length];
            for (int i = 0; i < d.Length; i++)
            {
                m_Values.Add(d[i]);
            }
            //m_Values.AddRange(Values)

            m_PlcAddress        = plcAddress;
            m_TransactionNumber = sequenceNumber;

            m_OwnerObjectID = ownerObjectID;
        }
Пример #42
0
        public static ICollection <T> ToCollection <T>(this IEnumerable <T> items)
        {
            var col = new System.Collections.ObjectModel.Collection <T>();

            if (items == null)
            {
                return(col);
            }

            foreach (var item in items)
            {
                col.Add(item);
            }
            return(col);
        }
Пример #43
0
 /// <summary>
 /// For internal use only
 /// Generate a collection of CurrencyUnit objects from the XML file received
 /// </summary>
 /// <returns>Returns a awaitable task</returns>
 private Task InitializeCollectionAsync()
 {
     return(Task.Run(() =>
     {
         _CurrencyUnits = new System.Collections.ObjectModel.Collection <CurrencyUnit>();
         foreach (XElement resource in CurrencySheet.Root.Descendants().Where(x => x.Name.LocalName == "resource"))
         {
             CurrencyUnit unit = new CurrencyUnit(resource);
             if (unit.ToString() != "UNKNOW")
             {
                 _CurrencyUnits.Add(new CurrencyUnit(resource));
             }
         }
     }));
 }
Пример #44
0
        public IEnumerable <String> GetIPs()
        {
            System.Collections.ObjectModel.Collection <string> _IPs = new System.Collections.ObjectModel.Collection <string>();
            string      xpath     = "/AzurePublicIpAddresses/Region";
            XmlNodeList addresses = MicrosoftIPs.AzureIPs.SelectNodes(xpath);

            foreach (XmlNode address in addresses)
            {
                foreach (XmlNode childNode in address.ChildNodes)
                {
                    _IPs.Add(childNode.Attributes.GetNamedItem("Subnet").Value);
                }
            }
            return(_IPs);
        }
Пример #45
0
        public IEnumerable <String> GetIPs()
        {
            System.Collections.ObjectModel.Collection <string> _IPs = new System.Collections.ObjectModel.Collection <string>();
            string      xpath     = "/products/product/addresslist";
            XmlNodeList addresses = MicrosoftIPs.Office365IPs.SelectNodes(xpath);

            foreach (XmlNode address in addresses)
            {
                foreach (XmlNode childNode in address.ChildNodes)
                {
                    _IPs.Add(childNode.InnerText);
                }
            }
            return(_IPs);
        }
        public void TestPrm_FilterDescriptionContains()
        {
            System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll =
                new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
            coll.Add(new System.Management.Automation.PSObject("scenario1"));
            coll.Add(new System.Management.Automation.PSObject("scenario2"));
            coll.Add(new System.Management.Automation.PSObject("scenario5"));

            CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
                @"$null = New-TMXTestSuite -Name suite1; " +
                @"$null = Add-TMXTestScenario -Name scenario1 -Description 'abc'; " +
                @"$null = New-TMXTestSuite -Name suite2; " +
                @"$null = New-TMXTestSuite -Name suite3; " +
                @"$null = Add-TMXTestScenario -Name scenario2; " +
                @"$null = Add-TMXTestScenario -Name scenario3 -Description 'bac'; " +
                @"$null = New-TMXTestSuite -Name suite4; " +
                @"$null = Add-TMXTestScenario -Name scenario4; " +
                @"$null = Add-TMXTestScenario -Name scenario2 -Description 'cab'; " +
                @"$null = Add-TMXTestScenario -Name scenario5 -Description 'abab'; " +
                @"$null = New-TMXTestSuite -Name suite5; " +
                @"$null = Add-TMXTestScenario -Name scenario2 -Description ''; " +
                @"Search-TMXTestScenario -FilterDescriptionContains 'ab' | %{$_.Name;}",
                coll);
        }
Пример #47
0
        private void Select_SelectAllOptions_WrongInput(string driverName)
        {
            System.Collections.ObjectModel.Collection <PSObject> coll =
                new System.Collections.ObjectModel.Collection <PSObject>();

            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value01Name)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value02Name)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value03Name)));
            coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value04Name)));
            CmdletUnitTest.TestRunspace.RunAndGetTheException(
                @"$null = Start-SeWebDriver -DriverName '" +
                driverName +
                @"' | Enter-SeURL -URL '" +
                MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) +
                @"' | Get-SeWebElement -XPath '" +
                Settings.TestFile05Controls1ElementSelect04XPath +
                @"' | Set-SeSelection -All; " +
                @"Get-SeWebElement -XPath '" +
                Settings.TestFile05Controls1ElementButton01XPath +
                //@"' | Get-SeSelection -Selected | %{ $_ | Read-SeWebElementText; };",
                @"' | Get-SeSelection -Selected | Read-SeWebElementText;",
                "ParameterBindingException",
                "A positional parameter cannot be found that accepts argument 'button'.");
        }
Пример #48
0
        private void centerRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (!centerRadioButton.Checked)
                return;

            m_printSetup.PaperPlacement = PaperPlacementType.Center;

            m_printSetup.VerifyMarginType(marginTypeComboBox);

            System.Collections.ObjectModel.Collection<System.Windows.Forms.Control> controlsToEnableOrNot =
                new System.Collections.ObjectModel.Collection<System.Windows.Forms.Control>();
            controlsToEnableOrNot.Add(userDefinedMarginXTextBox);
            controlsToEnableOrNot.Add(userDefinedMarginYTextBox);
            if (m_printSetup.VerifyUserDefinedMargin(controlsToEnableOrNot))
            {
                userDefinedMarginXTextBox.Text = m_printSetup.UserDefinedMarginX.ToString();
                userDefinedMarginYTextBox.Text = m_printSetup.UserDefinedMarginY.ToString();

                if (!revertButton.Enabled)
                {
                    revertButton.Enabled = true;
                }
            }
        }
Пример #49
0
        protected internal override void UnpackToCore(MsgPack.Unpacker unpacker, System.Collections.ObjectModel.Collection <System.DateTime> collection)
        {
            if ((unpacker.IsArrayHeader == false))
            {
                throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader();
            }
            int count = default(int);

            count = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker);
            for (int i = 0; (i < count); i = (i + 1))
            {
                System.Nullable <System.DateTime> nullable = default(System.Nullable <System.DateTime>);
                if ((unpacker.Read() == false))
                {
                    throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i);
                }
                if (((unpacker.IsArrayHeader == false) &&
                     (unpacker.IsMapHeader == false)))
                {
                    nullable = this._serializer1.UnpackFrom(unpacker);
                }
                else
                {
                    MsgPack.Unpacker disposable = default(MsgPack.Unpacker);
                    disposable = unpacker.ReadSubtree();
                    try {
                        nullable = this._serializer1.UnpackFrom(disposable);
                    }
                    finally {
                        if (((disposable == null)
                             == false))
                        {
                            disposable.Dispose();
                        }
                    }
                }
                if (nullable.HasValue)
                {
                    collection.Add(nullable.Value);
                }
                else
                {
                    throw MsgPack.Serialization.SerializationExceptions.NewValueTypeCannotBeNull(string.Format(System.Globalization.CultureInfo.InvariantCulture, "item{0}", new object[] {
                        ((object)(i))
                    }), typeof(System.DateTime), typeof(System.Collections.ObjectModel.Collection <System.DateTime>));
                }
            }
        }
Пример #50
0
        public void LoadDriverAttributes()
        {
            Attributes.Clear();

            sqlConnection1 = new OleDbConnection(ConfigurationManager.ConnectionStrings["TransManager"].ToString());

            using (sqlConnection1)
            {
                sqlConnection1.Open();

                OleDbCommand cmd = new OleDbCommand();

                OleDbDataReader dr;

                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "vwDriverAttributes";
                cmd.Parameters.Add(new OleDbParameter("[DriverID]", _id));

                cmd.Connection = sqlConnection1;
                Log.WriteCommand(cmd);
                dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    Attribute attribute = new Attribute();
                    attribute.AttributeID     = dr.GetInt32(dr.GetOrdinal("AttributeID"));
                    attribute.Checked         = dr.GetInt32(dr.GetOrdinal("Checked")) == 1 ? true : false;
                    attribute.Description     = dr.GetValue(dr.GetOrdinal("Description")).ToString();
                    attribute.LinkAttributeID = dr.GetInt32(dr.GetOrdinal("DriverAttrID"));
                    attribute.AccessLevel     = dr.GetInt32(dr.GetOrdinal("AccessLevel"));
                    attribute.LinkID          = _id;
                    Attributes.Add(attribute);
                    if (attribute.Description.ToLower() == "wheelchair enabled")
                    {
                        _wheelchairenabled = attribute.Checked;
                    }
                    if (attribute.Description.ToLower() == "walker enabled")
                    {
                        _walkerenabled = attribute.Checked;
                    }
                    if (attribute.Description.ToLower() == "Local drives")
                    {
                        _localdrives = attribute.Checked;
                    }
                }
            }
        }
Пример #51
0
 /// <summary>
 /// Mark Notification As Read.
 /// </summary>
 /// <param name="ids">Comma separated Ids of notifications.</param>
 /// <returns>return Status</returns>
 public bool MarkNotificationAsRead(string ids)
 {
     try
     {
         System.Collections.ObjectModel.Collection <DBParameters> parameters = new System.Collections.ObjectModel.Collection <DBParameters>();
         parameters.Add(new DBParameters()
         {
             Name = "ID", Value = ids, DBType = DbType.String
         });
         this.ExecuteProcedure("CUSPMarkNotificationAsRead", ExecuteType.ExecuteNonQuery, parameters);
         return(true);
     }
     catch (System.Data.SqlClient.SqlException)
     {
         return(false);
     }
 }
Пример #52
0
        public CascadingDropDownNameValue[] GetUnits(string knownCategoryValues, string category)
        {
            StringDictionary kv       = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
            string           itemCode = kv["Item"];

            System.Collections.ObjectModel.Collection <CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection <CascadingDropDownNameValue>();

            using (System.Data.DataTable table = MixERP.Net.BusinessLayer.Core.Units.GetUnitViewByItemCode(itemCode))
            {
                foreach (System.Data.DataRow dr in table.Rows)
                {
                    values.Add(new CascadingDropDownNameValue(dr["unit_name"].ToString(), dr["unit_id"].ToString()));
                }

                return(values.ToArray());
            }
        }
Пример #53
0
        public CascadingDropDownNameValue[] GetUnits(string knownCategoryValues, string category)
        {
            StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
            string itemCode = kv["Item"];

            System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();

            using (System.Data.DataTable table = MixERP.Net.BusinessLayer.Core.Units.GetUnitViewByItemCode(itemCode))
            {
                foreach (System.Data.DataRow dr in table.Rows)
                {
                    values.Add(new CascadingDropDownNameValue(dr["unit_name"].ToString(), dr["unit_id"].ToString()));
                }

                return values.ToArray();
            }
        }
Пример #54
0
 private System.Collections.ObjectModel.Collection <T> GetCollection <T>(ObjectReader reader)
 {
     System.Collections.ObjectModel.Collection <T> collection = new System.Collections.ObjectModel.Collection <T>();
     try {
         while (reader.Read())
         {
             collection.Add((T)reader.Current());
         }
     }
     finally {
         if (reader != null)
         {
             reader.Close();
         }
     }
     return(collection);
 }
Пример #55
0
        public long Save(DateTime valueDate, int storeId, string partyCode, int priceTypeId, string referenceNumber, string data, string statementReference, string transactionType, int agentId, int shipperId, string shippingAddressCode, decimal shippingCharge, int cashRepositoryId, int costCenterId, string transactionIds, string attachmentsJSON)
        {
            System.Collections.ObjectModel.Collection <Common.Models.Transactions.StockMasterDetailModel> details = WebControls.StockTransactionFactory.Helpers.CollectionHelper.GetStockMasterDetailCollection(data, storeId);
            System.Collections.ObjectModel.Collection <int> tranIds = new System.Collections.ObjectModel.Collection <int>();

            System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
            System.Collections.ObjectModel.Collection <Common.Models.Core.AttachmentModel> attachments = js.Deserialize <System.Collections.ObjectModel.Collection <Common.Models.Core.AttachmentModel> >(attachmentsJSON);

            if (!string.IsNullOrWhiteSpace(transactionIds))
            {
                foreach (var transactionId in transactionIds.Split(','))
                {
                    tranIds.Add(Common.Conversion.TryCastInteger(transactionId));
                }
            }

            bool isCredit = !transactionType.ToLower().Equals("cash");

            if (isCredit && cashRepositoryId > 0)
            {
                throw new InvalidOperationException("Invalid cash repository specified in credit transaction.");
            }

            if (!Data.Helpers.Stores.IsSalesAllowed(storeId))
            {
                throw new InvalidOperationException("Sales is not allowed here.");
            }

            foreach (Common.Models.Transactions.StockMasterDetailModel model in details)
            {
                if (Data.Helpers.Items.IsStockItem(model.ItemCode))
                {
                    decimal available = Data.Helpers.Items.CountItemInStock(model.ItemCode, model.UnitName, model.StoreId);

                    if (available < model.Quantity)
                    {
                        throw new InvalidOperationException(string.Format(Resources.Warnings.InsufficientStockWarning, available, model.UnitName, model.ItemCode));
                    }
                }
            }

            return(Data.Helpers.DirectSales.Add(valueDate, storeId, isCredit, partyCode,
                                                agentId, priceTypeId, details, shipperId, shippingAddressCode, shippingCharge, cashRepositoryId,
                                                costCenterId, referenceNumber, statementReference, attachments));
        }
Пример #56
0
        public IEnumerable <String> GetIPsbyService(string regionName)
        {
            //turn whatever was passed into the correct case as expected by the XML
            regionName = MicrosoftIPs.AzureRegions[regionName.ToLower()];

            System.Collections.ObjectModel.Collection <string> _IPs = new System.Collections.ObjectModel.Collection <string>();
            string      xpath     = "/AzurePublicIpAddresses/Region[@Name =\"" + regionName + "\"]";
            XmlNodeList addresses = MicrosoftIPs.AzureIPs.SelectNodes(xpath);

            foreach (XmlNode address in addresses)
            {
                foreach (XmlNode childNode in address.ChildNodes)
                {
                    _IPs.Add(childNode.Attributes.GetNamedItem("Subnet").Value);
                }
            }
            return(_IPs);
        }
Пример #57
0
        public CascadingDropDownNameValue[] GetShippingAddresses(string knownCategoryValues, string category)
        {
            System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();

            StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
            string partyCode = kv["Party"];

            using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Core.ShippingAddresses.GetShippingAddressView(partyCode))
            {
                table.Columns.Add("shipping_address", typeof(string), MixERP.Net.BusinessLayer.Core.ShippingAddresses.GetDisplayField());

                foreach(System.Data.DataRow dr in table.Rows)
                {
                    values.Add(new CascadingDropDownNameValue(dr["shipping_address_code"].ToString(), dr["shipping_address"].ToString()));
                }
            }

            return values.ToArray();
        }
 public void TestPrm_Name_Simple_In_Series()
 {
     System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> coll = 
         new System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>();
     coll.Add(null);
     coll.Add(new System.Management.Automation.PSObject("autoclosed"));
     coll.Add(new System.Management.Automation.PSObject("tr 1"));
     coll.Add(new System.Management.Automation.PSObject("tr 1"));
     coll.Add(new System.Management.Automation.PSObject("tr 1"));
     coll.Add(new System.Management.Automation.PSObject("tr 2"));
     coll.Add(new System.Management.Automation.PSObject("tr 2"));
     
     coll.Add(new System.Management.Automation.PSObject("tr 2"));
     
     CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual(
         @"$null = New-TmxTestSuite -Name suite1; " + 
         @"$null = Add-TmxTestScenario -Name scenario1; " + 
         @"$null = Add-TmxTestResultDetail -TestResultDetail 'detail 1'; " + 
         @"$null = New-TmxTestSuite -Name suite2; " + 
         @"$null = New-TmxTestSuite -Name suite3; " + 
         @"$null = Add-TmxTestScenario -Name scenario2; " + 
         @"$null = Add-TmxTestResultDetail -TestResultDetail 'detail 1'; " + 
         @"$null = Close-TmxTestResult -Name 'tr 1' -KnownIssue; " + 
         @"$null = Close-TmxTestResult -Name 'tr 2' -TestPassed; " + 
         @"$null = Add-TmxTestScenario -Name scenario3; " + 
         @"$null = Add-TmxTestResultDetail -TestResultDetail 'detail 1'; " + 
         @"$null = Close-TmxTestResult -Name 'tr 1' -KnownIssue; " + 
         @"$null = Close-TmxTestResult -Name 'tr 2' -TestPassed; " + 
         @"$null = New-TmxTestSuite -Name suite4; " + 
         @"$null = Add-TmxTestScenario -Name scenario4; " + 
         @"$null = Add-TmxTestResultDetail -TestResultDetail 'detail 1'; " + 
         @"$null = Close-TmxTestResult -Name 'tr 1' -KnownIssue; " + 
         @"$null = Close-TmxTestResult -Name 'tr 2' -TestPassed; " + 
         @"$null = Add-TmxTestScenario -Name scenario2; " + 
         @"$null = Add-TmxTestScenario -Name scenario5; " + 
         @"$null = New-TmxTestSuite -Name suite5; " + 
         @"$null = Add-TmxTestScenario -Name scenario2; " + 
         @"Search-TmxTestResult -OrderById | %{$_.Name;}",
         coll);
 }
Пример #59
0
        protected void UpdateButton_Click(object sender, EventArgs e)
        {
            if(ReportParameterTable.Rows.Count.Equals(0))
            {
                return;
            }

            System.Collections.ObjectModel.Collection<KeyValuePair<string, string>> list = new System.Collections.ObjectModel.Collection<KeyValuePair<string, string>>();

            foreach(TableRow row in ReportParameterTable.Rows)
            {
                TableCell cell = row.Cells[1];

                if(cell.Controls[0] is TextBox)
                {
                    TextBox textBox = (TextBox)cell.Controls[0];
                    list.Add(new KeyValuePair<string, string>("@" + textBox.ID.Replace("_text_box", ""), textBox.Text));
                }
            }
            ReportViewer11.Path = this.ReportPath();
            ReportViewer11.ParameterCollection = MixERP.Net.WebControls.ReportEngine.Helpers.ParameterHelper.BindParameters(Server.MapPath(this.ReportPath()), list);
            ReportViewer11.InitializeReport();
        }
Пример #60
0
        protected override System.Collections.ObjectModel.Collection<System.Management.Automation.PSDriveInfo> InitializeDefaultDrives()
        {
            var drives = new System.Collections.ObjectModel.Collection<System.Management.Automation.PSDriveInfo>();
            var fileSystemDrives = this.SessionState.Drive.GetAllForProvider("FileSystem");
            foreach (var fileSystemDrive in fileSystemDrives)
            {
                if (! Directory.Exists(fileSystemDrive.Root))
                {
                    continue;
                }

                var driveInfo = new PSDriveInfo(
                    "X" + fileSystemDrive.Name,
                    this.ProviderInfo,
                    fileSystemDrive.Root,
                    "TxF for drive " + fileSystemDrive.Name,
                    null);

                var drive = new TxFDrive(driveInfo);
                drives.Add(drive);
            }
            return drives;
        }