Ejemplo n.º 1
0
        public async Task <WorkItemStatus> CreateWorkItemAsync(string activityName, GridCollection gridCollection, string callbackUrl)
        {
            XrefTreeArgument gridCollectionArg = null;

            if (gridCollection != null)
            {
                var json = JsonConvert.SerializeObject(gridCollection);
                gridCollectionArg      = new XrefTreeArgument();
                gridCollectionArg.Url  = $"data:application/json,{json}";
                gridCollectionArg.Verb = Verb.Get;
            }

            var callbackResultUrl = $"{callbackUrl}";
            var resultsArg        = new XrefTreeArgument();

            resultsArg.Url  = callbackResultUrl;
            resultsArg.Verb = Verb.Put;

            var workItemBundle = new WorkItem();

            workItemBundle.ActivityId = $"{this.clientId}.{activityName}Activity+{activityName}Activity{this.forgeEnv}";
            workItemBundle.Arguments  = new Dictionary <string, IArgument>()
            {
                { "gridCollection", gridCollectionArg },
                { "results", resultsArg }
            };

            var status = await this.designAutoClient.CreateWorkItemAsync(workItemBundle);

            return(status);
        }
Ejemplo n.º 2
0
    void Start()
    {
        menuScreenManager = GetComponentInParent <MenuScreenManager>();
        characterGrid     = new GridCollection <GameCharacter>(characterSet.characters, Columns);

        foreach (var existingPlayer in GameManager.Instance.players)
        {
            var playerSelection = new PlayerSelection(existingPlayer, existingPlayer.character, false);
            playerSelections.Add(playerSelection);
        }

        playerSelections.ObserveAdd()
        .Select(ev => ev.Value)
        .SelectMany(playerSelection => {
            var playerRemoved = playerSelections.ObserveRemove().Where(ev => ev.Value == playerSelection);
            return(playerSelection.confirmed.TakeUntil(playerRemoved).Select(_ => Unit.Default));
        })
        .Merge(playerSelections.ObserveRemove().Select(_ => Unit.Default))
        .Select(_ => AllPlayersReady())
        .Subscribe(allReady => {
            if (allReady)
            {
                confirmPrompt.Show();
            }
            else
            {
                confirmPrompt.Hide();
            }
        })
        .AddTo(this);
    }
Ejemplo n.º 3
0
 internal static void FindEditorControls(ref GridCollection grids, ControlCollection controls)
 {
     for (int i = 0; i < controls.Count; i++)
     {
         if (controls[i] is Grid)
         {
             grids.Add((Grid)controls[i]);
         }
         if (controls[i].Controls.Count > 0)
         {
             FindEditorControls(ref grids, controls[i].Controls);
         }
     }
 }
        // Implementation for step Execute Actual Query for Sum of Cost good sold for PM FYTD
        private void SumofCostgoodsoldforPMFYTD_ExecuteActualQuery()
        {
            Dictionary <string, object> beforeTestElementResourceSnapshot = _testResources.Snapshot();
            bool cancel = false;

            BeforeTestElement("Sum of Cost good sold for PM FYTD", "Execute Actual Query", beforeTestElementResourceSnapshot, ref cancel);
            if (cancel)
            {
                return;
            }
            _testResources.Merge(beforeTestElementResourceSnapshot);

            try
            {
                try
                {
                    // Read asset SSAS Matrix Production
                    Connection connection = Connection.ReadFromByteArray(Resources.TestResource_SSASMatrixProduction_b89de6cae6604205b75e0566246db3fc);
                    connection.ConnectionString      = parameterProvider.GetTypedParameter <string>(new Guid("b89de6ca-e660-4205-b75e-0566246db3fc"), "ConnectionString", connection.ConnectionString);
                    connection.ProviderInvariantName = parameterProvider.GetTypedParameter <string>(new Guid("b89de6ca-e660-4205-b75e-0566246db3fc"), "ProviderInvariantName", connection.ProviderInvariantName);
                    // Read asset Actual Query
                    string         query          = parameterProvider.GetTypedParameter <string>(new Guid("c672e003-103f-4291-84b7-77e5b3cdffa4"), "Value", Resources.TestResource_ActualQuery_c672e003103f429184b777e5b3cdffa4);
                    GridCollection gridCollection = GridCollectionLoader.LoadGrid(connection.ProviderInvariantName, connection.ConnectionString, query, false, parameterProvider.GetTypedParameter <int>(new Guid("7269c7f9-6895-4b93-acac-0ba41891004a"), "Timeout", 30));
                    try
                    {
                        Assert.Greater(gridCollection.Count, 0, "Expected a result set collection with at least 1 result sets.");
                        testStateTracker.PushAssertResult(new Guid("7269c7f9-6895-4b93-acac-0ba41891004a"), "Execute Actual Query : Grid Count", 0, gridCollection.Count, true);
                    }
                    catch
                    {
                        testStateTracker.PushAssertResult(new Guid("7269c7f9-6895-4b93-acac-0ba41891004a"), "Execute Actual Query : Grid Count", 0, gridCollection.Count, false);
                        throw;
                    }
                    _testResources["SqlTest_RightQuery"] = gridCollection[0];
                }
                catch (Exception exception)
                {
                    throw new TestExecutionStepException("Cost of goods Sold", "Sum of Cost good sold for PM FYTD", "Execute Actual Query", 2, exception);
                }
            }
            finally
            {
                Dictionary <string, object> afterTestElementResourceSnapshot = _testResources.Snapshot();
                AfterTestElement("Sum of Cost good sold for PM FYTD", "Execute Actual Query", afterTestElementResourceSnapshot);
                _testResources.Merge(afterTestElementResourceSnapshot);
            }
        }
        // Implementation for step Execute Expected Query for Sum of Cost good sold for PM FYTD
        private void SumofCostgoodsoldforPMFYTD_ExecuteExpectedQuery()
        {
            Dictionary <string, object> beforeTestElementResourceSnapshot = _testResources.Snapshot();
            bool cancel = false;

            BeforeTestElement("Sum of Cost good sold for PM FYTD", "Execute Expected Query", beforeTestElementResourceSnapshot, ref cancel);
            if (cancel)
            {
                return;
            }
            _testResources.Merge(beforeTestElementResourceSnapshot);

            try
            {
                try
                {
                    // Read asset DWH stage
                    Connection connection = Connection.ReadFromByteArray(Resources.TestResource_DWHstage_9c0a93a6e32045e78e7d50bba97c5f8f);
                    connection.ConnectionString      = parameterProvider.GetTypedParameter <string>(new Guid("9c0a93a6-e320-45e7-8e7d-50bba97c5f8f"), "ConnectionString", connection.ConnectionString);
                    connection.ProviderInvariantName = parameterProvider.GetTypedParameter <string>(new Guid("9c0a93a6-e320-45e7-8e7d-50bba97c5f8f"), "ProviderInvariantName", connection.ProviderInvariantName);
                    // Read asset Expected Query
                    string         query          = parameterProvider.GetTypedParameter <string>(new Guid("8629fb71-ec16-453f-9278-9ff33904fd31"), "Value", Resources.TestResource_ExpectedQuery_8629fb71ec16453f92789ff33904fd31);
                    GridCollection gridCollection = GridCollectionLoader.LoadGrid(connection.ProviderInvariantName, connection.ConnectionString, query, false, parameterProvider.GetTypedParameter <int>(new Guid("f184b763-539e-4f5d-984f-f4625f0a6b2e"), "Timeout", 30));
                    try
                    {
                        Assert.Greater(gridCollection.Count, 0, "Expected a result set collection with at least 1 result sets.");
                        testStateTracker.PushAssertResult(new Guid("f184b763-539e-4f5d-984f-f4625f0a6b2e"), "Execute Expected Query : Grid Count", 0, gridCollection.Count, true);
                    }
                    catch
                    {
                        testStateTracker.PushAssertResult(new Guid("f184b763-539e-4f5d-984f-f4625f0a6b2e"), "Execute Expected Query : Grid Count", 0, gridCollection.Count, false);
                        throw;
                    }
                    _testResources["SqlTest_LeftQuery"] = gridCollection[0];
                }
                catch (Exception exception)
                {
                    throw new TestExecutionStepException("Cost of goods Sold", "Sum of Cost good sold for PM FYTD", "Execute Expected Query", 1, exception);
                }
            }
            finally
            {
                Dictionary <string, object> afterTestElementResourceSnapshot = _testResources.Snapshot();
                AfterTestElement("Sum of Cost good sold for PM FYTD", "Execute Expected Query", afterTestElementResourceSnapshot);
                _testResources.Merge(afterTestElementResourceSnapshot);
            }
        }
        // Implementation for step Execute Actual Query for Sum of Cost good sold FYTD
        private void SumofCostgoodsoldFYTD_ExecuteActualQuery()
        {
            Dictionary <string, object> beforeTestElementResourceSnapshot = _testResources.Snapshot();
            bool cancel = false;

            BeforeTestElement("Sum of Cost good sold FYTD", "Execute Actual Query", beforeTestElementResourceSnapshot, ref cancel);
            if (cancel)
            {
                return;
            }
            _testResources.Merge(beforeTestElementResourceSnapshot);

            try
            {
                try
                {
                    // Read asset SSAS Matrix Production
                    Connection connection = Connection.ReadFromByteArray(Resources.TestResource_SSASMatrixProduction_b89de6cae6604205b75e0566246db3fc);
                    connection.ConnectionString      = parameterProvider.GetTypedParameter <string>(new Guid("b89de6ca-e660-4205-b75e-0566246db3fc"), "ConnectionString", connection.ConnectionString);
                    connection.ProviderInvariantName = parameterProvider.GetTypedParameter <string>(new Guid("b89de6ca-e660-4205-b75e-0566246db3fc"), "ProviderInvariantName", connection.ProviderInvariantName);
                    // Read asset Actual Query
                    string         query          = parameterProvider.GetTypedParameter <string>(new Guid("30ba6fe4-ea85-4003-adc6-5b4ae5e9619d"), "Value", Resources.TestResource_ActualQuery_30ba6fe4ea854003adc65b4ae5e9619d);
                    GridCollection gridCollection = GridCollectionLoader.LoadGrid(connection.ProviderInvariantName, connection.ConnectionString, query, false, parameterProvider.GetTypedParameter <int>(new Guid("d3c22b2a-f3da-4023-a32c-5c858f9fc1a5"), "Timeout", 30));
                    try
                    {
                        Assert.Greater(gridCollection.Count, 0, "Expected a result set collection with at least 1 result sets.");
                        testStateTracker.PushAssertResult(new Guid("d3c22b2a-f3da-4023-a32c-5c858f9fc1a5"), "Execute Actual Query : Grid Count", 0, gridCollection.Count, true);
                    }
                    catch
                    {
                        testStateTracker.PushAssertResult(new Guid("d3c22b2a-f3da-4023-a32c-5c858f9fc1a5"), "Execute Actual Query : Grid Count", 0, gridCollection.Count, false);
                        throw;
                    }
                    _testResources["SqlTest_RightQuery"] = gridCollection[0];
                }
                catch (Exception exception)
                {
                    throw new TestExecutionStepException("Cost of goods Sold", "Sum of Cost good sold FYTD", "Execute Actual Query", 2, exception);
                }
            }
            finally
            {
                Dictionary <string, object> afterTestElementResourceSnapshot = _testResources.Snapshot();
                AfterTestElement("Sum of Cost good sold FYTD", "Execute Actual Query", afterTestElementResourceSnapshot);
                _testResources.Merge(afterTestElementResourceSnapshot);
            }
        }
        // Implementation for step Execute Expected Query for Sum of Cost good sold FYTD
        private void SumofCostgoodsoldFYTD_ExecuteExpectedQuery()
        {
            Dictionary <string, object> beforeTestElementResourceSnapshot = _testResources.Snapshot();
            bool cancel = false;

            BeforeTestElement("Sum of Cost good sold FYTD", "Execute Expected Query", beforeTestElementResourceSnapshot, ref cancel);
            if (cancel)
            {
                return;
            }
            _testResources.Merge(beforeTestElementResourceSnapshot);

            try
            {
                try
                {
                    // Read asset DWH stage
                    Connection connection = Connection.ReadFromByteArray(Resources.TestResource_DWHstage_9c0a93a6e32045e78e7d50bba97c5f8f);
                    connection.ConnectionString      = parameterProvider.GetTypedParameter <string>(new Guid("9c0a93a6-e320-45e7-8e7d-50bba97c5f8f"), "ConnectionString", connection.ConnectionString);
                    connection.ProviderInvariantName = parameterProvider.GetTypedParameter <string>(new Guid("9c0a93a6-e320-45e7-8e7d-50bba97c5f8f"), "ProviderInvariantName", connection.ProviderInvariantName);
                    // Read asset Expected Query
                    string         query          = parameterProvider.GetTypedParameter <string>(new Guid("27860fdf-e98a-4c90-8980-0d9e987d1a72"), "Value", Resources.TestResource_ExpectedQuery_27860fdfe98a4c9089800d9e987d1a72);
                    GridCollection gridCollection = GridCollectionLoader.LoadGrid(connection.ProviderInvariantName, connection.ConnectionString, query, false, parameterProvider.GetTypedParameter <int>(new Guid("1a7140f7-bae1-417c-b3ae-b3c6cb1036a5"), "Timeout", 30));
                    try
                    {
                        Assert.Greater(gridCollection.Count, 0, "Expected a result set collection with at least 1 result sets.");
                        testStateTracker.PushAssertResult(new Guid("1a7140f7-bae1-417c-b3ae-b3c6cb1036a5"), "Execute Expected Query : Grid Count", 0, gridCollection.Count, true);
                    }
                    catch
                    {
                        testStateTracker.PushAssertResult(new Guid("1a7140f7-bae1-417c-b3ae-b3c6cb1036a5"), "Execute Expected Query : Grid Count", 0, gridCollection.Count, false);
                        throw;
                    }
                    _testResources["SqlTest_LeftQuery"] = gridCollection[0];
                }
                catch (Exception exception)
                {
                    throw new TestExecutionStepException("Cost of goods Sold", "Sum of Cost good sold FYTD", "Execute Expected Query", 1, exception);
                }
            }
            finally
            {
                Dictionary <string, object> afterTestElementResourceSnapshot = _testResources.Snapshot();
                AfterTestElement("Sum of Cost good sold FYTD", "Execute Expected Query", afterTestElementResourceSnapshot);
                _testResources.Merge(afterTestElementResourceSnapshot);
            }
        }
        public async Task Save()
        {
            try
            {
                await client.AddCategoryAsync(new CategoryModel { Name = SelectedObject.Name, Description = SelectedObject.Description });

                GridCollection.Insert(0, SelectedObject);
                MessageBoxService.Show("Category record saved");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new ItemCategory()
                {
                };
            }
        }
Ejemplo n.º 9
0
        public async Task Save()
        {
            try
            {
                await unitOfWork.ItemsRepository.SaveItems(SelectedObject);

                GridCollection.Insert(0, SelectedObject);
                MessageBoxService.Show("Category record saved");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new Item()
                {
                };
            }
        }
Ejemplo n.º 10
0
        public async Task Delete()
        {
            try
            {
                await unitOfWork.ItemsRepository.SoftDeleteAsync(SelectedObject.ItemId);

                GridCollection.Remove(SelectedObject);
                MessageBoxService.Show("Category record Deleted");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.Message);
            }
            finally
            {
                SelectedObject = new Item()
                {
                };
            }
        }
Ejemplo n.º 11
0
    void Start()
    {
        menuScreenManager = GetComponentInParent <MenuScreenManager>();
        trackGrid         = new GridCollection <Track>(trackList.tracks, Columns);

        selectedTrack.Value = trackGrid.First();

        selectionConfirmed.Subscribe(confirmed => {
            if (confirmed)
            {
                confirmPrompt.Show();
                TrackManager.Instance.track = selectedTrack.Value;
            }
            else
            {
                TrackManager.Instance.track = null;
                confirmPrompt.Hide();
            }
        });
    }
        public async Task Delete()
        {
            try
            {
                await client.DeleteCategoryAsync(new CategoryModel { Id = SelectedObject.CategoryId.ToString(), Name = SelectedObject.Name, Description = SelectedObject.Description });

                GridCollection.Remove(SelectedObject);
                MessageBoxService.Show("Category record Deleted");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new ItemCategory()
                {
                };
            }
        }
Ejemplo n.º 13
0
        public async Task Save()
        {
            try
            {
                await unitOfWork.UOMRepository.Insert(SelectedObject);

                await unitOfWork.SaveAsync();

                GridCollection.Insert(0, SelectedObject);
                MessageBoxService.Show("Category record saved");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new UnitOfMeasurement()
                {
                };
            }
        }
Ejemplo n.º 14
0
        public async Task Delete()
        {
            try
            {
                await unitOfWork.SalesOutletRepository.DeleteAsync(SelectedObject.SalesOutletId);

                await unitOfWork.SaveAsync();

                GridCollection.Remove(SelectedObject);
                MessageBoxService.Show("Category record Deleted");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new SalesOutlet()
                {
                };
            }
        }
Ejemplo n.º 15
0
        public async Task Delete()
        {
            try
            {
                await unitOfWork.PaymentMethods.DeleteAsync(SelectedObject.ID);

                await unitOfWork.SaveAsync();

                GridCollection.Remove(SelectedObject);
                MessageBoxService.Show("Category record Deleted");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new PaymentMethod()
                {
                };
            }
        }
Ejemplo n.º 16
0
        public async Task Delete()
        {
            try
            {
                await unitOfWork.InventoryRepository.DeleteAsync(SelectedObject.InventoryId);

                await unitOfWork.SaveAsync();

                GridCollection.Remove(SelectedObject);
                MessageBoxService.Show("Category record Deleted");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new ItemInventory()
                {
                    InventoryId = new Guid(), ItemId = ItemsData.FirstOrDefault().ItemId, CostCenterId = SalesOutletData.FirstOrDefault().SalesOutletId, Reference = "Opening stock", OtherDetails = "Remarks"
                };
            }
        }
Ejemplo n.º 17
0
        public async Task Save()
        {
            try
            {
                await unitOfWork.InventoryRepository.AdjustInventory(SelectedObject);

                await unitOfWork.SaveAsync();

                GridCollection.Insert(0, SelectedObject);
                MessageBoxService.Show("Inventory updated successfully.");
            }
            catch (Exception ex)
            {
                MessageBoxService.Show(ex.InnerException.Message);
            }
            finally
            {
                SelectedObject = new InventoryAdjustment()
                {
                    ID = new Guid(), ItemId = ItemsData.FirstOrDefault().ItemId, CostCenterId = SalesOutletData.FirstOrDefault().SalesOutletId
                };
            }
        }