Exemplo n.º 1
0
        protected async System.Threading.Tasks.Task Grid0RowSelect(BlazorCrmWasm.Models.Crm.Contact args)
        {
            var dialogResult = await DialogService.OpenAsync <EditContact>("Edit Contact", new Dictionary <string, object>() { { "Id", args.Id } });

            grid0.Reload();

            await InvokeAsync(() => { StateHasChanged(); });
        }
Exemplo n.º 2
0
        protected async System.Threading.Tasks.Task Form0Submit(BlazorCrmWasm.Models.Crm.Contact args)
        {
            try
            {
                var crmCreateContactResult = await Crm.CreateContact(contact : contact);

                DialogService.Close(contact);
            }
            catch (System.Exception crmCreateContactException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Contact!");
            }
        }
Exemplo n.º 3
0
        public async System.Threading.Tasks.Task <Models.Crm.Contact> CreateContact(Models.Crm.Contact contact = default(Models.Crm.Contact))
        {
            var uri = new Uri(baseUri, $"Contacts");

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

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

            OnCreateContact(httpRequestMessage);

            var response = await httpClient.SendAsync(httpRequestMessage);

            return(await response.ReadAsync <Models.Crm.Contact>());
        }
Exemplo n.º 4
0
 protected async System.Threading.Tasks.Task Load()
 {
     contact = new BlazorCrmWasm.Models.Crm.Contact()
     {
     };
 }
Exemplo n.º 5
0
        public async System.Threading.Tasks.Task <HttpResponseMessage> UpdateContact(int?id = default(int?), Models.Crm.Contact contact = default(Models.Crm.Contact))
        {
            var uri = new Uri(baseUri, $"Contacts({id})");

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

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

            OnUpdateContact(httpRequestMessage);
            return(await httpClient.SendAsync(httpRequestMessage));
        }
Exemplo n.º 6
0
        protected async System.Threading.Tasks.Task Load()
        {
            var crmGetContactByIdResult = await Crm.GetContactById(id : Id);

            contact = crmGetContactByIdResult;
        }