protected async System.Threading.Tasks.Task Load()
        {
            canEdit = true;

            var crmGetContactByIdResult = await Crm.GetContactById(Id);

            contact = crmGetContactByIdResult;
        }
예제 #2
0
        protected async void Load()
        {
            canEdit = true;

            var crmGetContactByIdResult = await Crm.GetContactById(int.Parse(Id));

            contact = crmGetContactByIdResult;
        }
예제 #3
0
        public async Task <Models.Crm.Contact> CreateContact(Models.Crm.Contact contact)
        {
            OnContactCreated(contact);

            context.Contacts.Add(contact);
            context.SaveChanges();

            return(contact);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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");
            }
        }
예제 #7
0
        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);
        }
예제 #8
0
        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");
            }
        }
예제 #9
0
        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);
        }
예제 #10
0
 partial void OnContactCreated(Models.Crm.Contact item);
예제 #11
0
 partial void OnContactGet(Models.Crm.Contact item);
예제 #12
0
 partial void OnContactDeleted(Models.Crm.Contact item);
예제 #13
0
        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(); });
        }
예제 #14
0
 protected async void Load()
 {
     contact = new RadzenCrm.Models.Crm.Contact();
 }
 protected async System.Threading.Tasks.Task Load()
 {
     contact = new RadzenCrm.Models.Crm.Contact();
 }