protected async System.Threading.Tasks.Task Load() { canEdit = true; var crmGetContactByIdResult = await Crm.GetContactById(Id); contact = crmGetContactByIdResult; }
protected async void Load() { canEdit = true; var crmGetContactByIdResult = await Crm.GetContactById(int.Parse(Id)); contact = crmGetContactByIdResult; }
public async Task <Models.Crm.Contact> CreateContact(Models.Crm.Contact contact) { OnContactCreated(contact); context.Contacts.Add(contact); context.SaveChanges(); return(contact); }
public async Task <Models.Crm.Contact> CancelContactChanges(Models.Crm.Contact item) { var entity = context.Entry(item); entity.CurrentValues.SetValues(entity.OriginalValues); entity.State = EntityState.Unchanged; return(item); }
protected async void Form0Submit(RadzenCrm.Models.Crm.Contact args) { try { var crmUpdateContactResult = await Crm.UpdateContact(int.Parse(Id), contact); DialogService.Close(contact); } catch (Exception crmUpdateContactException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Contact"); } }
protected async System.Threading.Tasks.Task Form0Submit(RadzenCrm.Models.Crm.Contact args) { try { var crmUpdateContactResult = await Crm.UpdateContact(Id, contact); DialogService.Close(contact); } catch (System.Exception crmUpdateContactException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Contact"); } }
public async Task <Models.Crm.Contact> UpdateContact(int?id, Models.Crm.Contact contact) { OnContactUpdated(contact); var item = context.Contacts .Where(i => i.Id == id) .First(); var entry = context.Entry(item); entry.CurrentValues.SetValues(contact); entry.State = EntityState.Modified; context.SaveChanges(); return(contact); }
protected async void GridDeleteButtonClick(MouseEventArgs args, RadzenCrm.Models.Crm.Contact data) { try { var crmDeleteContactResult = await Crm.DeleteContact(data.Id); if (crmDeleteContactResult != null) { grid0.Reload(); } } catch (Exception crmDeleteContactException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to delete Contact"); } }
public async Task <Models.Crm.Contact> UpdateContact(int?id, Models.Crm.Contact contact) { OnContactUpdated(contact); var item = context.Contacts .Where(i => i.Id == id) .FirstOrDefault(); if (item == null) { throw new Exception("Item no longer available"); } var entry = context.Entry(item); entry.CurrentValues.SetValues(contact); entry.State = EntityState.Modified; context.SaveChanges(); return(contact); }
partial void OnContactCreated(Models.Crm.Contact item);
partial void OnContactGet(Models.Crm.Contact item);
partial void OnContactDeleted(Models.Crm.Contact item);
protected async void Grid0RowSelect(RadzenCrm.Models.Crm.Contact args) { var result = await DialogService.OpenAsync <EditContact>("Edit Contact", new Dictionary <string, object>() { { "Id", args.Id } }); await InvokeAsync(() => { StateHasChanged(); }); }
protected async void Load() { contact = new RadzenCrm.Models.Crm.Contact(); }
protected async System.Threading.Tasks.Task Load() { contact = new RadzenCrm.Models.Crm.Contact(); }