protected async System.Threading.Tasks.Task Grid0RowSelect(BlazorCrmWasm.Models.Crm.Opportunity args)
        {
            var dialogResult = await DialogService.OpenAsync <EditOpportunity>("Edit Opportunity", new Dictionary <string, object>() { { "Id", args.Id } });

            grid0.Reload();

            await InvokeAsync(() => { StateHasChanged(); });
        }
        protected async System.Threading.Tasks.Task Form0Submit(BlazorCrmWasm.Models.Crm.Opportunity args)
        {
            try
            {
                var crmCreateOpportunityResult = await Crm.CreateOpportunity(opportunity : opportunity);

                DialogService.Close(opportunity);
            }
            catch (System.Exception crmCreateOpportunityException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Opportunity!");
            }
        }
        protected async System.Threading.Tasks.Task Load()
        {
            var crmGetContactsResult = await Crm.GetContacts();

            getContactsResult = crmGetContactsResult.Value.AsODataEnumerable();

            var crmGetOpportunityStatusesResult = await Crm.GetOpportunityStatuses();

            getOpportunityStatusesResult = crmGetOpportunityStatusesResult.Value.AsODataEnumerable();

            opportunity = new BlazorCrmWasm.Models.Crm.Opportunity()
            {
            };
        }
Exemple #4
0
        public async System.Threading.Tasks.Task <HttpResponseMessage> UpdateOpportunity(int?id = default(int?), Models.Crm.Opportunity opportunity = default(Models.Crm.Opportunity))
        {
            var uri = new Uri(baseUri, $"Opportunities({id})");

            var httpRequestMessage = new HttpRequestMessage(HttpMethod.Patch, uri);

            httpRequestMessage.Content = new StringContent(ODataJsonSerializer.Serialize(opportunity), Encoding.UTF8, "application/json");

            OnUpdateOpportunity(httpRequestMessage);
            return(await httpClient.SendAsync(httpRequestMessage));
        }
Exemple #5
0
        public async System.Threading.Tasks.Task <Models.Crm.Opportunity> CreateOpportunity(Models.Crm.Opportunity opportunity = default(Models.Crm.Opportunity))
        {
            var uri = new Uri(baseUri, $"Opportunities");

            var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, uri);

            httpRequestMessage.Content = new StringContent(ODataJsonSerializer.Serialize(opportunity), Encoding.UTF8, "application/json");

            OnCreateOpportunity(httpRequestMessage);

            var response = await httpClient.SendAsync(httpRequestMessage);

            return(await response.ReadAsync <Models.Crm.Opportunity>());
        }