Esempio n. 1
0
        async Task LoadCurrentContractAsync()
        {
            Loading = true;

            try
            {
                ContractFileSession = await ContractFileSessionService.GetAsync(Id);

                Contract = EditorContractXML.From(ContractFileSession.SerializedContract);
            }
            catch (Exception e)
            {
                initialException = e;
            }

            Loading = false;
        }
Esempio n. 2
0
        async Task SaveAsync()
        {
            Loading = true;

            ContractFileSession.SerializedContract = EditorContractXML.To(Contract);
            try
            {
                await ContractFileSessionService.UpdateAsync(ContractFileSession);

                await successSnackbar.ShowAsync();
            }
            catch (Exception)
            {
                contractAlertController.AddAlert("Error while saving contract occured", AlertScheme.Danger);
            }

            Loading = false;
            //await LoadCurrentContractAsync();
        }
        async Task CreateNewContractAsync()
        {
            var newContract = new EditorContract();
            var newSession  = ContractFileSession.FromContract(newContract);

            newSession.Id = newSessionId;

            Loading = true;

            try
            {
                await ContractFileSessionService.InsertAsync(newSession);

                NavigationManager.NavigateTo("/ContractFileSession/" + newSession.Id);
            }
            catch (Exception)
            {
                newContractAlertController.AddAlert("Something went wrong :(", AlertScheme.Danger);
            }

            Loading = false;
        }